Commit Graph

34373 Commits

Author SHA1 Message Date
Hayley Mapley d0facd2b73 Bug 24673 (18.11.x U18 follow-up): Fixing t/db_dependent/Koha/XSLT/Security.t
The test t/db_dependent/Koha/XSLT/Security.t failed on Jenkins for U18
when this bug's patches were backported, due to it returning a different
IO error message for XSLT.

This patch adds a condition to the regex which matches both messages:
'Failed to load external entity' and 'Failed to load HTTP resource'

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 16:00:40 +12:00
Katrin Fischer 9e593de322 Bug 24605: (QA follow-up) Fix unencoded series link in staff interface
Same change as the first patch, but for the staff detail page.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 6298eafa64)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0870bb6da6)
2020-04-14 15:19:06 +12:00
Nick Clemens 4a2faccfbb Bug 24605: Fix unencoded series link
To test:
1 - Add an 830 to a record with a volume subfield separated by a semicolon
    830$aThe series ;$vvol 8.
2 - View the record in the opac
3 - Click the series link, no results
4 - View the link url - the semicolon is not encoded
5 - Apply patch
6 - link works
7 - URL is corrrectly encoded

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit e3cffae41f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e94543c454)
2020-04-14 15:18:55 +12:00
Marcel de Rooy 2bad119d04 Bug 24809: (QA follow-up) Add prefix to prevent disambiguity
This seems not to be needed. Just at the safe side.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 96e6362ab7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 27be06c672)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 15:01:22 +12:00
Nick Clemens edf7b85292 Bug 24809: Get only timestamp of deleted items attached to existing bibs when check if bib deleted
To test:
 1 - Edit/create a file in the koha home dir '/var/lib/koha/{instance}/OAI.yaml' with content like below:
format:
  marcxml:
    metadataPrefix: marcxml
    metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
    schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
    include_items: 1
 2 - Set the systempreferences below to indicated values:
  OAI-PMH => Enable
  OAI-PMH:ConfFile => /var/lib/koha/{instace}/OAI.yaml
 3 - View a record with items and confirm the items show:
  http://localhost:8080/cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=marcxml&identifier=KOHA-OAI-TEST:4
 4 - Delete the items, then delete the record
 5 - Reload the URL from step 3
 6 - Internal Server Error:
  Empty String at /kohadevbox/koha/Koha/OAI/Server/Record.pm line 58.
    at /usr/share/perl/5.24/Carp.pm line 167
 7 - Apply patch
 8 - restart_all
 9 - Repeat
10 - Reload URL from step 3
11 - Success

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 68488f4055)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d474a4edb1)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 15:01:05 +12:00
Fridolin Somers 7a92d126df Bug 24527: misc/cronjobs/update_totalissues.pl problem with multiple items
misc/cronjobs/update_totalissues.pl when issuing statistics table, no-incremental,  has a problem for biblio with multiple items.
The first SQL query gets the biblios linked to items with issues in statistics :

SELECT
  biblio.biblionumber, COUNT(statistics.itemnumber)
FROM
  biblio
LEFT JOIN
  items
ON
  (biblio.biblionumber=items.biblionumber)
LEFT JOIN
  statistics
ON
  (items.itemnumber=statistics.itemnumber)
WHERE
  statistics.type = 'issue'
$limit
GROUP BY
  biblio.biblionumber

The second SQL query is :
SELECT
  biblio.biblionumber, 0
FROM
  biblio
LEFT JOIN
  items
ON
  (biblio.biblionumber=items.biblionumber)
LEFT JOIN
  statistics
ON
  (items.itemnumber=statistics.itemnumber)
WHERE
  statistics.itemnumber IS NULL
GROUP BY
  biblio.biblionumber

The problem is that this second query will set to 0 where ANY item has no entry in statistics table.
So when running it sets 0 to the biblio that had a value from first
query.

I think the best fix is to use "WHERE statistics.type = 'issue'" inside que JOIN :
LEFT JOIN statistics ON (items.itemnumber=statistics.itemnumber AND statistics.type = 'issue')

Test plan :
1) Begin with an empty database
2) Create a biblio 1 with no items
3) Create a biblio 2 with 3 items
4) Create a biblio 3 with 2 items
5) Checkout and checkin all items of biblio 2
6) Checkout and checkin the firt item of biblio 3
7) run misc/cronjobs/update_totalissues.pl --use-stats -v
8) Check biblio 1 has biblioitems.totalissues = 0
9) Check biblio 2 has biblioitems.totalissues = 3
10) Without patch the biblio 3 has biblioitems.totalissues = 0
11) With patch the biblio 3 has biblioitems.totalissues = 1
12) Check misc/cronjobs/update_totalissues.pl --incremental is OK

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 91da9841d7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f6d61ce5e0)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 14:36:34 +12:00
Nick Clemens fc703cae7c Bug 24711: Don't add logout input to login form
To test:
1 - Set OpacPublic syspref to 'Disable'
2 - Log in to OPAC
3 - Log out
4 - Try to log in again
5 - No error, but you get the login form again
6 - Apply patch
7 - Repeat
8 - This time you can log in again

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit a137b170c0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c188cf91a0)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 13:59:05 +12:00
Fridolin Somers 28d7dca810 Bug 23968: Add div this id around OPACMySummaryNote content
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cffa7623e1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit faed28348d)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 13:39:04 +12:00
Fridolin Somers 87eac5cc3a Bug 23968: fix OPACMySummaryNote feature
The system preference OPACMySummaryNote is used to display on the logged-in patron summary page at OPAC.
It does not display anymore.

Looks like it comes from code :
[% IF OPACMySummaryNote %][% Koha.Preference('OPACMySummaryNote') | $raw %][% END %]
OPACMySummaryNote used to be a provided variable.

Test plan:
1) Enable system preference OPACMySummaryNote
2) Enter some HTML into it
3) Go to OPAC and loggin
4) Check you see the HTML in opac-user.pl
5) Disable the preference
6) Check you dont see the HTML anymore

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d5c501bf63)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0f75bffeeb)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 13:38:10 +12:00
Hayley Mapley 55f94a201e Bug 24846: DBRev 18.11.15.001
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-27 11:25:34 +13:00
Jonathan Druart a1bd61ae14 Bug 24846: Update items.onloan with the new due date
Signed-off-by: Donna Bachowski <donna@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit b56562f2d0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 50cc72db58)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-27 11:07:54 +13:00
Jonathan Druart a809b16949 Bug 24846: Add new tool to batch extend due dates
With events sometimes leading to unforeseen branch closures (think Coronavirus as
an example), it would be helpful to have a tool that would allow librarians to
update due dates in bulk based on branch and current due date of the material.

It allows to select checkouts given the following parameters:
 * libraries
 * patron's categories
 * range of the due date

You can set a hard due date, or define a number of days to extend the
due date.

Test plan:
Check some items out
Use the new tool to extend the due dates
Test the different filters to make sure they all work

Note: What about holidays?

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 0ff5dc25ff)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7b0d904f88)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-27 11:01:38 +13:00
Jonathan Druart 93d0d20110 Bug 24846: Link to the new tool
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 32e5ec841a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ceecc18c2e)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-27 10:54:04 +13:00
Jonathan Druart 24b4fdebf0 Bug 24846: Add new permission batch_extend_due_dates
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bb6c483a24)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-27 10:27:47 +13:00
David Cook 7d0a022977 Bug 24673: Add CSRF token support to opac-messaging.pl
This patch adds CSRF token support to opac-messaging.pl,
which allows users to manually update their messaging preferences,
but prevents bad actors from tricking people into updating their
preferences from cross-site requests.

Test plan:
0. Set SMSSendDriver global system preference to "Test" if unset
1. Log into the OPAC
2. Navigate to a URL in your browser like the following:
http://localhost:8080/cgi-bin/koha/opac-messaging.pl?modify=yes
&1=email&digest=1&2-DAYS=5&2=email&digest=2&4=email&SMSnumber=0444444444
3. Observe that the preference and SMS number update

4. Apply the patch

5. Navigate to a URL in your browser like the following:
http://localhost:8080/cgi-bin/koha/opac-messaging.pl?modify=yes
&1=email&digest=1&2-DAYS=5&2=email&digest=2&4=email&SMSnumber=0444444444
6. Observe that you get an error message of "Wrong CSRF token" instead
of the previous behaviour
7. Navigate to a URL in your browser like the following:
http://localhost:8080/cgi-bin/koha/opac-messaging.pl
8. Update "Advance notice" to 3 and update "SMS number" to 61111111111
9. Observe that the "Advance notice" and "SMS number" fields update
correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 35cdeadbdf)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-24 14:33:11 +13:00
Jonathan Druart f97f271fd2 Bug 24878: Add auth check for copy-holidays
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 6ef4c45b84)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-24 14:14:34 +13:00
Jonathan Druart 54dfd0a0cd Bug 24878: Add authentication checks to the calendar tool
There is a security hole in 2 scripts that are used by the UI to edit
holidays.

To test:
1) Go to Tools -> Calendar, for Centerville
   Check no holiday for 30/4/2020
2) To add a new holiday without login execute
   a curl command with necessary parameters
3) Reload page from 1), verify the new holiday
   edit and delete the holiday
4) Apply the patch
5) Do 2) again, this time you get a lengthy output,
   with the magic words:

   <title>Koha &rsaquo;
       Log in to Koha
   </title>

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Only tested newHoliday but the fix is the same.
No errors

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 656e7814b3)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-24 14:14:17 +13:00
Hayley Mapley bfdc5866e8 Update release notes for 18.11.15 release
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-24 09:39:32 +13:00
Hayley Mapley 1ec18529f8 Increment version for 18.11.15 release
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-24 09:02:19 +13:00
Koha translators 95de66270e Translation updates for Koha 18.11.15
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-24 08:51:01 +13:00
Jonathan Druart e4e45fab6c Bug 24389: Better error handle when claiming late orders
A successful message says that the email has been sent and the order has
been claimed, but nothing happened.

Test plan:
0. Do not apply this patch
1. Create a new vendor, does not create a contact
2. Create some orders, close the basket
3. Go to the late orders page and claims some orders
=> You get a successful message, but the claim has not been done!
4. Apply this patch
5. Claim the orders
=> You get an error
6. Set a contact for the vendor
7. Claim the orders
=> Success

In the docker container, you may need to:
% apt install postfix
% postfix start
Edit /etc/hosts
127.0.0.1       localhost localhost.localdomain

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c2c7c6e754)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5bccfa152a)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-18 10:32:29 +13:00
Jonathan Druart 41213f62d4 Bug 21296: [18.11.x] Fix wrong resolution conflict
On
  commit a230878b6f
  Bug 21296: suspend hold ignores system preference on intranet

See comment 10.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-17 08:40:05 +13:00
Owen Leonard a230878b6f Bug 21296: suspend hold ignores system preference on intranet
This patch modifies the DataTable configuration for the table of holds
which displays under the "Holds" tab on the patron's checkout and
details pages. A variable is now defined in the JavaScript with the
value of the "SuspendHoldsIntranet" system preference. This variable is
passed to the DataTable configuration to determine whether the column is
visible or not.

One of the changes made in this patch moves a <script> block so that it
appears before some of the JS includes on the page. This helps keep the
string-defining JS together in one block.

To test, apply the patch and set the "SuspendHoldsIntranet" system
preference to "Allow."

 - Open the checkout page for a patron with one or more holds.
 - Under the "Holds" tab, the table of holds should have a "Suspend"
   column with controls for suspending or resuming holds.
 - Check that the same is true on the patron detail page.
 - Set the "SuspendHoldsIntranet" system preference to "Don't allow."
 - Test the checkout and detail pages again and confirm that the
   "Suspend" column does not appear.

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 541dfa7dde)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cc87e68e0d)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-16 13:08:06 +13:00
Andrew Isherwood 72a4f68197 Bug 23980: Revert "Bug 23229: Only load ILL table JS when needed"
This reverts commit f95749a66b.

https://bugs.koha-community.org/show_bug.cgi?id=23980

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fixed commit title, no errors

Revised test plan:
- Do not apply the patch
- View koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
- TEST: Verify that it includes a "jsinclude" block near the bottom of the template
- Apply the patch
- Re-open the template
- TEST: Verify that the "jsinclude" block is now gone

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-10 10:47:22 +13:00
Andrew Isherwood f59ea116e5 Bug 23980: Revert "Bug 23229: (QA follow-up) Fix indentation"
This reverts commit d4676ff453.

https://bugs.koha-community.org/show_bug.cgi?id=23980

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fixed commit title

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-03-10 10:47:22 +13:00
Jonathan Druart 89ab97da99 Bug 23064: Use Koha::Subscription in ModSubscription
We must use Koha::Subscription instead of raw SQL.
It will fix issue with default and integer values.

Test plan:
Edit a subscription and set number of issues = "f"
Save
=> Without this patch there is a SQL error in the log:
  Incorrect integer value: 'f' for column 'numberlength'
=> With this patch the other changes are effective.

Note: We also could change the type attribute of the input to "number",
to have a client-side check

Also, the return value of ModSuggestion is never used, so we are safe
with that.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
The <strict_sql_modes> flag must be present and set to 1 in the <config> section of koha-conf.xml

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-24 10:37:10 +13:00
Marcel de Rooy 610a6cf78b Bug 23290: [RMaint version] Mitigate XML/XSLT vulnerabilities
This is a squashed version for backporting to stable branches.
IMPORTANT: It does not move XSLT_Handler to XSLT/Base as in master.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d8bf40281b)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-24 09:10:06 +13:00
Hayley Mapley 35205cb39f Update release notes for 18.11.14 release
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-21 14:06:42 +13:00
Hayley Mapley aa15cdfd79 Increment version for 18.11.14 release
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-21 13:36:50 +13:00
Koha translators 81899770dc Translation updates for Koha 18.11.14
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-21 13:18:02 +13:00
Martin Renvoize 3f4c326bf7 Bug 14759: Replace Text::Unaccent with Unicode::Normalize
As shown in the comments on the bug, it appears that Unicode::Normalize
is the most reliable way to strip accents from strings for this use
case.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 27de0d6179)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 708fd8b4b1)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-21 10:33:10 +13:00
Jonathan Druart 70d1f0a1ba Bug 14759: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit ad92c14058)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7ad9807353)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-21 10:07:08 +13:00
Jonathan Druart b6a6bfb9fb Bug 24313: Always display XSLT errors in logs
From
  commit 295ae33800
  Bug 20272: Replace error numbers by codes in XSLT_Handler

"""
    Make XSLT_Handler a little bit less noisy by defaulting print_warns to
    false unless $ENV{DEBUG} is set. (See also bug 19018).
"""

I think we should warn the errors in the logs. They are not debug messages here, we should not rely on DEBUG.
If too noisy we should fix the original issues, not hide all the errors (which make the XSLT debugging super hard)

Test plan:
Break a XSLT, reload the page and confirm that there are useful errors in the Koha log file

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit ec79582374)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8bcafbe3cf)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 16:11:13 +13:00
Joonas Kylmälä 296524c978 Bug 24016: (QA follow-up) Format code to adhere to perltidy format
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 3bfbf25897)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8ecc071915)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 15:34:39 +13:00
Lari Taskula 416528064e Bug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv alone
Koha::Patron::Message->store has this

    my $userenv = C4::Context->userenv;
    $self->manager_id( $userenv ? $userenv->{number} : undef);

This breaks in REST API when userenv is not set.

Let API user pass manager_id without relying on C4::Context->userenv.

To test:
1. prove t/db_dependent/Koha/Patron/Messages.t
2. Observe success

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 49eac22b1f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e13770ad11)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 15:34:10 +13:00
Lari Taskula c3ad074be4 Bug 24016: Add a failing test for overwrite-able manager_id in Koha::Patron::Message
To test:
1. prove t/db_dependent/Koha/Patron/Messages.t
2. Observe failure

t/db_dependent/Koha/Patron/Messages.t .. 2/12
   Failed test 'Manager id should be overwrite-able even if defined in userenv'
   at t/db_dependent/Koha/Patron/Messages.t line 90.
          got: '1100'
     expected: '1101'
 Looks like you failed 1 test of 12.
t/db_dependent/Koha/Patron/Messages.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/12 subtests

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c74820c227)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3d73723a9f)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 15:03:07 +13:00
Nick Clemens ab03647466 Bug 22302: Unit tests
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 91294e2623)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd5d08d66b)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 14:41:27 +13:00
Nick Clemens 350cdb06ad Bug 22302: Make ITEMTYPECAT descriptions fallback to lib description if no opac description
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit b985cf5b88)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2a6c77f6aa)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 14:33:03 +13:00
Owen Leonard 20fd3d519b Bug 9993: On editing basket group delivery place resets to logged in branch
This patch modifies basketgroups.pl so that existing data about a basket
group's billing and delivery place are correctly preselected in the edit
form. These fields shouldn't reset to the logged-in user's home branch
just because they have an empty value.

To test, apply the patch and go to Acquisitions -> Vendor -> Basket
groups.

When adding or editing a basket group the pre-selected value for
"Billing place" and "Delivery place" should be correct:

   - When creating a new basket group: The logged-in user's library
     should be pre-selected.

   - When editing a basket group which has a library defined for either
     the billing or delivery places, the correct library should be
     pre-selected.

   - When editing a basket group which has no library defined for either
     the billing or delivery place there should be no library
     pre-selected (the "--" option should be pre-selected).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 69afaa4239)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ed5e9732d9)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 13:21:36 +13:00
Hayley Mapley 0a8b2b9a77 Revert "Bug 24054: Typo in ClaimReturnedWarningThreshold system preference"
This reverts commit 43a1e7600d.
Fixed typo in dependency which did not exist in 18.11.
2020-02-20 09:41:31 +13:00
Jonathan Druart 5eb60264e3 Bug 24213: Fix Koha::Object->get_from_storage if the object has been deleted
Without this patch it fails with something like:
  DBIC result _type  isn't of the _type Subscription at t/db_dependent/Biblio.t line 627.

Test plan:
- Apply the first patch (Add tests)
- Confirm that they fail
- Apply this patch
- Confirm that the tests pass

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit a27c5c9dcd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f79f4dc5b1)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-18 15:54:14 +13:00
Jonathan Druart e11243cf04 Bug 24213: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit d3462a97cc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f45c4b8f3a)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-18 15:29:51 +13:00
Hayley Mapley aa6eaa2ecb Bug 22868: DBRev 18.11.13.001 (fix)
Previous DBRev contained wrong version number in updatedatabase.pl.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-18 14:11:52 +13:00
Kyle M Hall d08c330b5c Bug 24330: When importing patrons from CSV, automatically strip BOM from file if it exists
We have a partner that exports UTF-8 CSV files, and is experiencing the same thing as the author of this article: https://www.freecodecamp.org/news/a-quick-tale-about-feff-the-invisible-character-cd25cd4630e7/

In short, Excel is inserting an invisible UTF-8 character at the start of the file, so that the column name "cardnumber" is actually named "\x{feff}cardnumber", causing "cardnumber" to be blank.

A simple solution is provided here: https://stackoverflow.com/questions/24390034/remove-bom-from-string-with-perl

Test Plan:
1) Download the example.csv file
2) Attempt to import it using the patron import tool
3) Note the invalid column name error
4) Apply this patch, restart all the things!
5) Attempt the import again
6) Assuming you have a branchcode MPL and a cataegory code S, the patron should import!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Maggie Wong <maggie.wong@yccece.edu.hk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 91980f27a3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 40ae65e326)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-18 13:49:03 +13:00
Marcel de Rooy 7de9062388 Bug 23896: logaction should pass the correct interface to Koha::Logger
Trivial fix.

Test plan:
Run t/db../Log.t to ensure that we did not break stuff.
If you set opac to debug in log4perl config, inspect opac-error.log to see
if you have extra loglines from running the test script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit b078794fcb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 87eb710ad0)
2020-02-18 10:59:16 +13:00
Hayley Mapley cea8fccd11 Bug 22868: DBRev 18.11.14.001
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-18 10:19:46 +13:00
Jonathan Druart 3f0b11ad41 Bug 22868: Move suggestions_manage subperm out of acquisition perm
Bug 11911 replaced the permission of suggestions.pl (create a purchase
suggestion) from catalogue => 1 to acquisition => 'suggestions_manage'.
However we have a lot of acquisition scripts that have lax permissions
(acquisition => '*' which means any sub permissions of acquisition is
enough).

That causes problem when a circulation staff can create purchase
suggestions but not access acquisition information.

One solution is to move the suggestions_manage subpermission out of the
acquisition permission and create a new suggestion permission.

Test plan:
0. Setup
* Create a patron with several permission (and full acquisition
permission)
* Create another patron with several permission, and suggestions_manage
permission
* Create another patron without the suggestions_manage permission
1. Apply the patch and execute the update database entry
2. Note that the third patron you create still does not have
suggestions_manage
3. Confirm that you can create a purchase suggestion if you have
suggestions_manage, but cannot access acquisition pages if you do not
have any subpermissions of the acquisition permission

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 462db68024)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f0c60dfe6f)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-18 10:03:31 +13:00
Owen Leonard d58a654129 Bug 23113: members/pay.tt account_grp is not longer used
This patch removes obsolete markup from pay.tt.

To test, apply the patch and search the Koha codebase for instances of
"account_grp" There should be none.

Log in to the staff client and go to the account of a patron who has
fines. Confirm that the "Accounting" page ("Make a payment" tab) works
correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 39b9750f8e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bd2d76f68b)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-17 17:30:51 +13:00
Lucas Gass 9623de5c9b Bug 24497: Turn off smartIndent for SQL
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c9f03be65a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 527196aa88)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-17 16:45:58 +13:00
Jonathan Druart c8f6f22040 Bug 24061: Close after timeout if onafterprint no supported
Not supported on Chrome < 63
https://www.w3schools.com/tags/ev_onafterprint.asp

Signed-off-by: Gabriel DeCarufel <gabriel@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit f01e98801d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9052160d60)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-14 15:37:28 +13:00