]> git.koha-community.org Git - koha.git/log
koha.git
21 months agoBug 31908: Replace an exit by a safe_exit in Auth.pm L1314
Marcel de Rooy [Mon, 14 Nov 2022 11:09:43 +0000 (11:09 +0000)]
Bug 31908: Replace an exit by a safe_exit in Auth.pm L1314

No change in user experience. But since we can mock safe_exit,
we can enhance test results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
23 months agoUpdate release notes for 21.05.21 release v21.05.21
Victor Grousset/tuxayo [Thu, 1 Dec 2022 00:03:35 +0000 (01:03 +0100)]
Update release notes for 21.05.21 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoIncrement version for 21.05.21 release
Victor Grousset/tuxayo [Wed, 30 Nov 2022 23:48:45 +0000 (00:48 +0100)]
Increment version for 21.05.21 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoFix translations for Koha 21.05.21
Victor Grousset/tuxayo [Wed, 30 Nov 2022 23:44:54 +0000 (00:44 +0100)]
Fix translations for Koha 21.05.21

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoTranslation updates for Koha 21.05.21
Koha translators [Wed, 30 Nov 2022 19:10:09 +0000 (16:10 -0300)]
Translation updates for Koha 21.05.21

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 28553: (QA follow-up) default to auto renew email when cron switched used
David Cook [Tue, 13 Sep 2022 06:46:46 +0000 (06:46 +0000)]
Bug 28553: (QA follow-up) default to auto renew email when cron switched used

This patch defaults to using "email" rather than "sms" notices
when AutoRenewalNotices is set to use the --send-notices cron switch

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 88f63e01d29917e9323c57be97aaa91b9e00fd92)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 681730ee1af9ad167f9526903eee6b6681d7d9ff)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit dc92b692e2704c64d1700e7c4fcbf667f6b1402e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 28553: Patrons can be set to receive auto_renew notices as SMS, but Koha does...
Kyle M Hall [Mon, 18 Jul 2022 16:37:48 +0000 (12:37 -0400)]
Bug 28553: Patrons can be set to receive auto_renew notices as SMS, but Koha does not generate them

Following bug 18532, one can set a patron's messaging prefs to deliver an auto-renew notice via SMS.
However, the auto_renewals cron only knows how to generate email notices. We should not allow the selection of non-functional transport types.

Test Plan:
 1 - Set pref AutoRenewalNotices - 'according to patron messaging preferences'
 2 - Set circ rule with:
    Loan period: 5 days
    No renewal before: 5
    AutoRenewal: Yes
    Renewals allowed: 5
 3 - Set SMS Send driver to Email
 4 - Find a patron and set them to receive auto renewal notices via SMS and no other transport
 5 - Provide a proivder and sms number for the patron
 6 - Checkout an item to the patron, set due date to yesterday
 7 - Run auto renewals:
    perl misc/cronjobs/automatic_renewals.pl -v --send-notices -c
 8 - Item renewed, no message sent
 9 - Check in item, checkout again due yesterday
10 - Apply patch
11 - Browse to Tools->notices and slips
12 - Edit AUTO_RENEWALS and AUTO_RENEWALS_DIGEST to copy email template to sms and add a title
13 - perl misc/cronjobs/automatic_renewals.pl -v --send-notices -c
14 - Item renewed, confirm patron has a notice in their account
15 - Check the digest option, check in item, checkout again as due, repeat cronjob and note digest notic
16 - sign off

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fef29151e0dd6287f8e4e49effc9d9666bf87582)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e672ea689221f8c6dd7e139acd3ffbd92c7c569f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit ff27eecd567e0a2e2f7cc2062c811b6b864cceea)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29603: Compiled SCSS
Victor Grousset/tuxayo [Thu, 17 Nov 2022 23:46:26 +0000 (00:46 +0100)]
Bug 29603: Compiled SCSS

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29603: Fix responsive behavior of facets menu in OPAC search results
Owen Leonard [Thu, 27 Jan 2022 15:29:32 +0000 (15:29 +0000)]
Bug 29603: Fix responsive behavior of facets menu in OPAC search results

The OPAC was originally featured a search results facets box that would
collapse at narrower browser widths and show a "Refine your search" link
under the breadcrumbs menu. At some point this broke, with the "Refine
your search" link appearing at the bottom instead.

This patch revises the page to restore the previous behavior.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Perform catalog search in the OPAC which will return multiple results.
- View the page at various browser widths. At narrower widths the facets
  menu should appear as a "collapsed" box with a "Refine your search"
  link.
- Clicking the link should toggle the facets menu visibility.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 915815ddae7a69e549e0114eddd2be6a44f1486b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 2e72aae7e40baddc8927d6c2a0e7fdafaa17c981)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug ?????: Compiled SCSS due to compiler change or previous oversight
Victor Grousset/tuxayo [Thu, 17 Nov 2022 23:34:19 +0000 (00:34 +0100)]
Bug ?????: Compiled SCSS due to compiler change or previous oversight

Likely compiler change.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.20 release v21.05.20
Victor Grousset/tuxayo [Mon, 24 Oct 2022 16:24:06 +0000 (18:24 +0200)]
Update release notes for 21.05.20 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoIncrement version for 21.05.20 release
Victor Grousset/tuxayo [Mon, 24 Oct 2022 16:08:43 +0000 (18:08 +0200)]
Increment version for 21.05.20 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoFix translations for Koha 21.05.20
Victor Grousset/tuxayo [Mon, 24 Oct 2022 15:47:13 +0000 (17:47 +0200)]
Fix translations for Koha 21.05.20

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoTranslation updates for Koha 21.05.20
Koha translators [Mon, 24 Oct 2022 11:57:27 +0000 (08:57 -0300)]
Translation updates for Koha 21.05.20

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 31219: Prevent JS injection in patron extended attributes
Jonathan Druart [Mon, 25 Jul 2022 07:23:25 +0000 (09:23 +0200)]
Bug 31219: Prevent JS injection in patron extended attributes

We are sanitizing other attributes but "extended patron attributes".

Test plan:
Make a patron attribute editable at the OPAC
Edit an existing patron, or register a new one
Use a script tag in the new value ("<script>alert("booh!")</script>" for
instance)
With this patch the value is remove if containing an HTML tag that is
not br b i em big small strong (see C4::Scrubber)

Signed-off-by: Mark Hofstetter <koha@trust-box.at>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ddaa78bdab360f41b9e3672de7f50cd3053b9116)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30252: lower version of 'Locale::XGettext::TT2' to 0.6
Mason James [Wed, 9 Mar 2022 04:22:50 +0000 (17:22 +1300)]
Bug 30252: lower version of 'Locale::XGettext::TT2' to 0.6

this patch reduces the required version of 'Locale::XGettext::TT2' to 0.6

version 0.7 of of Locale::XGettext::TT2 is incompatible with the current version of libintl-perl (1.26), so we use 0.6 instead

 https://packages.debian.org/stretch/libintl-perl
 https://metacpan.org/release/GUIDO/Template-Plugin-Gettext-0.6/view/lib/Locale/XGettext/TT2.pm

we will move to 'Locale::XGettext::TT2' 0.7 when libintl-perl-1.32 arrives
 https://tracker.debian.org/pkg/libintl-perl

small change, no test plan

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6c49c489d6d8ad9dd8e3e02d9d623895f79d3607)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29325: Fix commit_file.pl
Tomas Cohen Arazi [Tue, 26 Oct 2021 16:54:15 +0000 (13:54 -0300)]
Bug 29325: Fix commit_file.pl

This patch fixes the broken commit_file.pl script.

It doesn't deal with commiting the import from the UI.

To test:
1. Pick a file for staging:
   $ kshell
  k$ misc/stage_file.pl --file TestDataImportKoha.mrc
=> SUCCESS: All good
2. Commit!
  k$ misc/commit_file.pl --batch-number 1
=> FAIL: You see
DBIx::Class::Storage::DBI::_exec_txn_begin(): DBI Exception: DBD::mysql::db begin_work failed: Already in a transaction at /kohadevbox/koha/C4/Biblio.pm line 303
3. Apply this patch
4. Repeat 2
=> SUCCESS: Commit succeeds
5. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: (QA follow-up) Remove unexisting parameters of BatchRevertRecords

There is no interval and callback as in BatchCommitRecords.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: Call progress callback one last time to confirm comppletion

Previously after finishing the loop we were still in a transaction that never completed - we should report progress when done
one final time to commit the last records

To test:
1 - Stage a file with > 100 records
2 - Commit file
3 - Confirm batch is imported and no records left as staged

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: Fix import from staff client

same test as before, but via the staff client

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: Handle the transaction in BatchCommitRecords

Requiring the callback to commit was breaking reversion, and likely elsewhere

Let's simplify and say that the routine iteself will handle the txn and commit

TO test:
1 - Stage a file
2 - Import a file
3 - Revert a file
4 - Test staff client and command line

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 29325: (QA follow-up) Tidy up

tools/manage-marc-import.pl: sub commit_batch does no longer need $schema
tools/manage-marc-import.pl: sub revert_batch: calling BatchRevertRecords which has no interval and callback
misc/commit_file.pl: sub print_progress_and_commit does no longer commit, renamed
misc/commit_file.pl: sub print_progress does no longer have a schema parameter
misc/commit_file.pl: sub revert_batch reported deleted items as added

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 514b6628613b27aed1138d16ab9f2393b79bb897)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.19 release v21.05.19
Victor Grousset/tuxayo [Tue, 27 Sep 2022 13:42:51 +0000 (15:42 +0200)]
Update release notes for 21.05.19 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoIncrement version for 21.05.19 release
Victor Grousset/tuxayo [Tue, 27 Sep 2022 12:05:52 +0000 (14:05 +0200)]
Increment version for 21.05.19 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoFix translations for Koha 21.05.19
Victor Grousset/tuxayo [Tue, 27 Sep 2022 12:02:49 +0000 (14:02 +0200)]
Fix translations for Koha 21.05.19

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoTranslation updates for Koha 21.05.19
Koha translators [Tue, 27 Sep 2022 08:16:12 +0000 (05:16 -0300)]
Translation updates for Koha 21.05.19

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData)
Frédéric Demians [Mon, 11 Jul 2022 10:05:54 +0000 (12:05 +0200)]
Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData)

Test plan:

(A) Reproduce the bug:

A1 In Administration > System preferences > Web services:
   - Enable OAI-PMH
   - Enable OAI-PMH:AutoUpdateSets
   - Enable OAI-PMH:AutoUpdateSetsEmbedItemData

A2 In Tools > Export data > Export bibliographic records, export 1 (one)
   biblio record. Be sure that this biblio record has at least one item.
   Don't tick "Don't export items".

A3 Delete the exported biblio record, and its items.

A4 In command line, on the server load the exported file:
   ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc

A5 Retrieve the biblio record in Koha. Note the absence of the item(s). This is
   the bug.

(B) Apply the patch

B1 Delete the record (without item) loaded at A4.

B2 In command line, on the server load the exported file:
   ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc

B2 Retrieve the biblio record in Koha. Note the presence of the item(s).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d5e65dd4c0352c4fb2d96f4cabfc6e6311770cd0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 06b48f16e420ccac12cc0560d0091c404e647be6)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 084c14787f751e8aabee7db6f701c5d4c71cf497)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 31138: Don't ignore DataTables errors and raise them to the end-user
Jonathan Druart [Tue, 12 Jul 2022 08:09:25 +0000 (10:09 +0200)]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76b984bb6ccee55ba1ddfdb5b08c6ee2e75eaa37)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7a5d048b51b60dcb7123e2fd0b73e5d95f9e554e)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 6ac8f34e9906d840cb6b8e04427f064f2d9518b3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 27045: (follow-up) Fix delimiter in header rows
Katrin Fischer [Sat, 16 Jul 2022 11:23:54 +0000 (11:23 +0000)]
Bug 27045: (follow-up) Fix delimiter in header rows

The header rows still showed \t because the newly defined
variable wasn't used there.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eea061ca30e4810b07ca2920bfe1e55762fab02)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ed114537d3a965bc5f636e4f138cdf35c2515d3b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 6c47479066eae4d6c3c42aaeb6e2b7dc86d92ef4)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 27045: Fix other exports using CSV profiles
Jonathan Druart [Fri, 20 Nov 2020 14:33:14 +0000 (15:33 +0100)]
Bug 27045: Fix other exports using CSV profiles

This patch corrects the export of the 2 other reports
using CSV profiles:

* Late issues (serials)
* Basket (acquisitions)

To test:
1) Late issues
* Update the late issues sample report to use tab as separator
* Create a subscription
* Go to serial collection and 'generate next' to get some late issues
* Go to Claims
* Export the late issues and verify format is correct
* Verify exported file has tabs

2) Basket summary
* Create an order with several order lines
* Create an SQL type CSV profile for basket export using tab as separator
  Example: aqorders.quantity|aqordres.listprice|Title=biblio.title
* Export the basket using your configured CSV profile
* Verify exported file has tabs

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cd84171ab57a35138fa5c585d2ed6de442e453c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9af01ea2e3c6735420431cd41a97e29a28167165)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit cdfecb6fb771c872b6ebb528ef2e99b9c69283b7)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 27045: Fix items lost report export if delimiter is tab
Jonathan Druart [Fri, 20 Nov 2020 14:33:02 +0000 (15:33 +0100)]
Bug 27045: Fix items lost report export if delimiter is tab

When choosing tabulation as the delimiter for a CSV profile
for the lost item report, the tabs appear in the file as \t
instead of as proper tabs.

title\tauthor\tstocknumber\tcallnumber
"E Street shuffle :"\"Heylin, Clinton."\\

To test:
* Upate the existing sample lost item CSV profile to use tabs as
  separator
* Make sure you have some lost items in your database or create some
* Go to Reports > Lost items
* Run the report
* Check all or some of the checkboxes in the result list
* Export using the link on top and the CSV profile
* Verify the tabs are not exported correctly
* Apply patch
* Verify tabs now are proper tabs instead of \t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 983965ee4790fd7841af87fcfdb8395ccea9e813)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4db8368fd558066ab321353e9eb346563f871f72)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit becbc5bec1bece7f5dbf9089c7e1bd593e9d850c)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 14680: Always subtract discount from price to calculate estimated cost
Nick Clemens [Tue, 12 Jul 2022 18:10:54 +0000 (18:10 +0000)]
Bug 14680: Always subtract discount from price to calculate estimated cost

This patch simply removes a discrepancty where when a discount is provided on the order form
we add the discount to the price, and when it comes form the vendor we subtract the discount.

Discounts should always descrease the estimated cost

To test:
 0 - Have a vendor with a discount of 10% specified
 1 - Export a record from your Koha
 2 - Stage the record for import and match on biblionumber
 3 - Add to a basket in acq from the staged file
 4 - Select the title, and set order price to $10 and do not fill the discount field
 5 - Add the order - note $10 RRP and $9 actual/budgeted cost
 6 - Repeat 2&3
 7 - Select the tile, set price $10 and discount 50%
 8 - Add the order - note $20 RRP and $10 actual/budgeted cost! FAIL
 9 - Apply patch, restart all
10 - Repeat 2-7
11 - Add the order, note $10 RRP and $5 actual.budgeted cost

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c734c6903a823eeb58be9ab1c4af251def776b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 96eed0f5e00657808e506ba6d5e0a98a3529bf95)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit da1633125fef9995bc9917693807ffb07054be15)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29051: Update svc api to allow seen renewals
Martin Renvoize [Wed, 11 May 2022 15:21:48 +0000 (16:21 +0100)]
Bug 29051: Update svc api to allow seen renewals

This patch updates the svc/renew api endpoint to allow seen renewals
when appropriate

Signed-off-by: Caroline <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3311ebffc2b2965239674501cf56818c9e90cec)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e9153d7f1566981e14741a8ea50f9da4da483196)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit e20d79123b267599b1df4c0f1a5a82e0b3cf5a09)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29051: Enable seen renewal in the staff client
Martin Renvoize [Wed, 11 May 2022 15:13:23 +0000 (16:13 +0100)]
Bug 29051: Enable seen renewal in the staff client

This patch updates the javascript for the checkouts table to add the
checkbox back in for the case where too_unseen is the error returned by
CanBookBeRenewed, allowing such issues to be renewed.

Signed-off-by: Caroline <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 91a67e3c8acd4d0cad73e01b10569c712b6b4c01)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 36e39cab65fbb6fd36754dcd20839814e5386d9b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit b513d0b03800eb9ac70265d7ff61d2e23fb42d6b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 31473: Fix fragile test about bad OpacHiddenItems conf
Tomas Cohen Arazi [Fri, 26 Aug 2022 19:45:10 +0000 (16:45 -0300)]
Bug 31473: Fix fragile test about bad OpacHiddenItems conf

There's been a behavior change in recent MariaDB that made some cases
deal with truncated data in DOUBLE context instead of DECIMAL.

Probably this:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-27380

This made the affected test fail consistently on those versions.

This trick for checking OpacHiddenItems is correct (as introduced on bug
28125 doesn't really make use of the warning, just prints it in
about.pl) so one option was to just check for a warning.

I decided to keep the test, but add the optional DECIMAL|DOUBLE check on
the qr. This way other eventual changes will make it fail and serve as a
warning in case something more relevant changes.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 28610: Elasticsearch 7 - hits.total is now an object
Kevin Carnes [Tue, 8 Feb 2022 13:48:19 +0000 (14:48 +0100)]
Bug 28610: Elasticsearch 7 - hits.total is now an object

In Elasticsearch 7 hits.total is now an object which is not always an exact
value. You can always get an exact total by adding a track_total_hits
parameter set to true when using the Elasticsearch search method

To test:
1) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
2) If you observe an error about types, apply patch for bug 25669
3) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
4) Observe that tests with count fail
5) Apply patch
6) Observe that tests with count pass
7) Sign off

Sponsored-by: Lund University Library
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 301ed1567b78956b7d6ec9ef2378e37f87ca1371)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30209: Upgrade 'libdbd-sqlite2-perl' package to 'libdbd-sqlite3-perl'
Mason James [Wed, 2 Mar 2022 01:46:09 +0000 (14:46 +1300)]
Bug 30209: Upgrade 'libdbd-sqlite2-perl' package to 'libdbd-sqlite3-perl'

to test...

1/ apply patch, build and install new package

2/ check that libdbd-sqlite3-perl package is installed

     $ dpkg -l | grep libdbd-sqlite
     ii  libdbd-sqlite3-perl:amd64              1.62-3          amd64

    note: libdbd-sqlite3-perl package installs DBD::SQLite module, which uses sqlite3 :)

        https://packages.debian.org/stretch/libdbd-sqlite3-perl
        https://metacpan.org/pod/DBD::SQLite

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2c5f49550bffde753b33fe605878ab689bf86697)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.18 release v21.05.18
Victor Grousset/tuxayo [Sat, 27 Aug 2022 23:17:35 +0000 (01:17 +0200)]
Update release notes for 21.05.18 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoIncrement version for 21.05.18 release
Victor Grousset/tuxayo [Sat, 27 Aug 2022 20:51:21 +0000 (22:51 +0200)]
Increment version for 21.05.18 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoFix translations for Koha 21.05.18
Victor Grousset/tuxayo [Fri, 26 Aug 2022 23:57:39 +0000 (01:57 +0200)]
Fix translations for Koha 21.05.18

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoTranslation updates for Koha 21.05.18
Koha translators [Fri, 26 Aug 2022 18:54:33 +0000 (15:54 -0300)]
Translation updates for Koha 21.05.18

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 25669: (follow-up) Minor fixes
Kevin Carnes [Wed, 25 May 2022 09:19:21 +0000 (09:19 +0000)]
Bug 25669: (follow-up) Minor fixes

Bulk doesn't support include_type_name, update requirement to
Search::Elasticseach@6.80, and remove data type name from tests.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e926de5e8f359acf6b8beff541fe13ce2a5ac49e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 22c9ea9737d614a26b06092cda9708e27013e494)
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 3a46ff9702146b8def00c1c4000a316dc0fa10ed)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 25669: Use include_type_name parameter in ES calls
Nick Clemens [Mon, 28 Mar 2022 12:00:25 +0000 (12:00 +0000)]
Bug 25669: Use include_type_name parameter in ES calls

This patch includes the parameter:
include_type_name
on our ES calls

It removes the deprecation warning we are seeing, and should allow using ES7 with no other chnages.

For ES8 we will need to remove the hardcoded type,

I would suggest a second patch, with a new syspref "ElasticsearchLegacyType" set to 'True' by default.
Description can explain that this must be set to false, and data reindexed after upgrading to ES7 and before
upgrading to ES8 - then we can drop this pref when we drop ES7 support

When we drop ES6 support the pref can be set default true for upgrades, default 'false' for new installs

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 150a4b03f337f6a58869c67d3681caa64441d53a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 99757c2d975d224ea191622116e6eb839fff70c1)
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit a1fdcc4f440601272c2e30e92843a60a3850bd6b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR
Katrin Fischer [Mon, 6 Jun 2022 21:34:26 +0000 (21:34 +0000)]
Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR

In input fields we always use the decimal . while the display format
uses the decimal separtor definded by CurrencyFormat. When adding a
manual invoice without this patch, the amount is shown with comma, but
it should be . in the input field.

To test:
1- Go in Administration->Debit types
2- Click on New debit type
3- Fill the form:
   Code: USEDBOOK
   Default amount: 0.50
   Description: Used book
   Can be manually invoiced: Yes
4- Save
5- Go to any patron account
6- Go to the "Accounting" tab
7- Click on "Create manual invoice"
8- Fill the form
9- Choose the created debit (Used book)
10- Verify that the format is incorrect (0,50 instead of 0.50)
11- Apply the patch
12- Verify the amount is now using the correct format

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c54e1de8b2beec131f51fdfe866fd27ee8bc0759)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 533a858684d8e5cf69caea560b64aefebc88b626)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 8a5ab91aed151fe2f0473fd5920e1297b3035ccb)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30914: (24153 follow-up) Fix cleanup_database.pl --transfers --old-reserves
Jonathan Druart [Tue, 7 Jun 2022 12:11:06 +0000 (14:11 +0200)]
Bug 30914: (24153 follow-up) Fix cleanup_database.pl --transfers --old-reserves

Silly mistake, 'delete if verbose' must be 'delete if confirm'

Test plan:
Try the cleanup_database.pl script to delete transfers and old issues.
Using --transfers --old-reserves and the --confirm flag the entries must be
removed

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a6166405c7d7886466a8d1264c98970b4973f77f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b503c186e4ca8012b24441e746045c7439c44b97)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 144372e72ed59f9ded5db00b9f4f9e38bfa0ada9)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29958: Do not set dateaccessioned on updates
Martin Renvoize [Fri, 24 Jun 2022 14:39:07 +0000 (15:39 +0100)]
Bug 29958: Do not set dateaccessioned on updates

This patch reomves the second occurence of setting daeaccessioned today,
outside of the 'add/update' handling in Koha::Item->store.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f5fbcf73626139bcc01aca73b912fa29ff51f7d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e0fcd54a6edd728ab67924d5ab3ef3df8d4e52dd)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 898adc6ff6ef8e6c16e279508a9d073d2547084b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29958: Regression tests
Tomas Cohen Arazi [Tue, 5 Jul 2022 12:14:16 +0000 (09:14 -0300)]
Bug 29958: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3684a53dc328047f5f608d4b3d6b37abcbf30400)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 91c4d411157a22bbeb58b43b878705f44c71f1f3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 35643f28f91428ca0fa6c1c8c4f5d6b8ba40d13a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30848: [21.05.x] Export C4::Biblio::GetMarcSubfieldStructure()
Victor Grousset/tuxayo [Mon, 15 Aug 2022 20:46:57 +0000 (22:46 +0200)]
Bug 30848: [21.05.x] Export C4::Biblio::GetMarcSubfieldStructure()

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30848: Add exec flag to test
Nick Clemens [Fri, 17 Jun 2022 13:09:02 +0000 (13:09 +0000)]
Bug 30848: Add exec flag to test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8c926c976a7a5057c578d8f5d41f4cdaa1d8ab5e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4edaa27fc2a7a487a9558dc66acce9b636fa06b3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit b10ac8189facd7b6e36f986dd392730a27b7ccbd)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30848: Fix issue exposed by unit tests
Martin Renvoize [Mon, 13 Jun 2022 13:26:33 +0000 (14:26 +0100)]
Bug 30848: Fix issue exposed by unit tests

This patch changes the 'map' to a simple for loop so that we can easily
map multiple subfields to a field without overwriting the first previous
subfields in the structure.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6c381c4b22d30388f8e24966a6c6e7c78201dba3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 965e9856196a30520ffaea7cc99f7724f7b123d3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 4541f43789495b0163fd5125620e0b25991ffede)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30848: Expand unit tests
Martin Renvoize [Mon, 13 Jun 2022 13:25:30 +0000 (14:25 +0100)]
Bug 30848: Expand unit tests

Add to the unit tests to test Library and Itemtype expansions as well as
linking multiple subfields of the same marc field to such expansions.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6b04e3e18f1c534e3d7d91dde458d30e02e13f33)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 66999034d4ce274dec14340c1494dc280292984a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 8987b899709e5a8329f0f71b46aae476de83358b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30848: Add an ExpandCodedFields RecordProcessor filter
Martin Renvoize [Thu, 26 May 2022 09:24:50 +0000 (10:24 +0100)]
Bug 30848: Add an ExpandCodedFields RecordProcessor filter

This patch introduces a RecordProcessor filter for MARC::Record objects
that replaces Koha codes with descriptions in the MARC::Record passed to the processor.

Target usage:

  my $biblio = Koha::Biblios->find(
      $biblio_id,
      { prefetch => [ metadata ] }
  );

  my $record = $biblio->metadata->record;

  my $processor = Koha::RecordProcessor->new(
    {
        filters => ('ExpandCodedFields'),
        options => {
            interface     => 'opac',
            frameworkcode => $biblio->frameworkcode
        }
    }
  );

  $processor->process( $record );

Test plan
* Read the included unit test and confirm it makes sense and passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 62bba6d9e12bdf9e3dbf231beae68afe43618f4b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0a861042947adbc12b4d865c89c6a87effe965b9)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 52dd29792ef8c746827e6071cd85e46a5dcbc8c1)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t
Mason James [Wed, 6 Jul 2022 10:54:55 +0000 (22:54 +1200)]
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.t | wc -l
 2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8884068904b77ecb8dff7875a056129443b08e6b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fea07bfab8d4a58bc07929585939a9472c384a59)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 1df5e78deb59d1ae87d315389c84a77ef9409194)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30958: OPAC overdrive search result page broken for translations
Alex Buckley [Mon, 13 Jun 2022 22:54:54 +0000 (22:54 +0000)]
Bug 30958: OPAC overdrive search result page broken for translations

Note: You will need a valid OverDrive subscription to test this.

This patch fixes a JavaScript error thrown on the OPAC overdrive search
results page for libraries using translation templates and who don't
have the OverDrivePasswordRequired system preference = 'Required'.

Test plan:
1. Install the en-NZ translation: https://wiki.koha-community.org/wiki/Installation_of_additional_languages_for_OPAC_and_INTRANET_staff_client

2. Enable the en-NZ language:
   - In the OPACLanguages system preference -> tick 'English New Zealand
     (en-NZ)' checkbox and untick 'English (en)'

3. Fill in the OverDrive system preferences:
   - Make sure you set: OverDrivePasswordRequired = "Not required"

4. Perform an OPAC search

5. Click on the Overdrive results link

6. Open the browser console and notice there is a JS error, and the
   OverDrive results do not load

7. Apply patch

8. Update the en_NZ translation:

9. Repeat steps 4, 5 and 6 and notice there is no JavaScript error and
   the OverDrive results do display

Sponsored-by: Melbourne Athenaeum Library, Australia
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ade61b5e0c185fd7263ab6f101b1a4082d0ea0dd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f5c43cf2636e3e59d58b6ea739491dea192a51d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 6fb34f0d66d6b0882225c5edf099cdf79cdcc617)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.17 release v21.05.17
Victor Grousset/tuxayo [Tue, 26 Jul 2022 01:46:14 +0000 (03:46 +0200)]
Update release notes for 21.05.17 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoIncrement version for 21.05.17 release
Victor Grousset/tuxayo [Tue, 26 Jul 2022 00:24:02 +0000 (02:24 +0200)]
Increment version for 21.05.17 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoFix translations for Koha 21.05.17
Victor Grousset/tuxayo [Mon, 25 Jul 2022 23:50:33 +0000 (01:50 +0200)]
Fix translations for Koha 21.05.17

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoTranslation updates for Koha 21.05.17
Koha translators [Mon, 25 Jul 2022 10:56:42 +0000 (07:56 -0300)]
Translation updates for Koha 21.05.17

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorit...
Kyle Hall [Wed, 15 Jun 2022 16:06:55 +0000 (12:06 -0400)]
Bug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorities-home.pl )

There appears to be a cross site scripting attack vulnerability in opac-authorities-home.pl, but may be accessible from any page using C4::Output::pagination_bar.

https://MYKOHA.LOCAL/cgi-bin/koha/opac-authorities-home.pl?and_or=and%27%22()%26%25%3Csad%3E%3CScRiPt%20%3Ealert(document.domain)%3C/ScRiPt%3E&authtypecode=CORPO_NAME&excluding=1&marclist=all&op=do_search&operator=contains&orderby=HeadingAsc&type=opac&value=1

Test Plan:
1) Use the URL above to show the XSS vulnerability exists
2) Apply this patch
3) Restart all the things!
4) Reload the page, no XSS vulnerability!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29504: (follow-up) Account for other blockers
Martin Renvoize [Wed, 15 Dec 2021 09:20:52 +0000 (09:20 +0000)]
Bug 29504: (follow-up) Account for other blockers

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7a7716b6d8039476a6cc2d6403092cc2df42458e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3eceb3d5fe9c8c5ae6ce04720364acd21be0a7e6)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 96a6472747ae77e5415fddb9824b003ce3998494)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29504: Allow 'ADDITIONAL_MATERIALS' check to be confirmed
Martin Renvoize [Mon, 22 Nov 2021 11:33:25 +0000 (11:33 +0000)]
Bug 29504: Allow 'ADDITIONAL_MATERIALS' check to be confirmed

The additional materials check when CircConfirmParts is enabled was
errantly relying upon the 'FORCE_CHECKOUT' permission.  This patch
updates the template to allow confirmation as well as cancellation of
chekout.

Test plan
1. Set a staff member with circ permissions, but not FORCE_CHECKOUT
2. Turn on CircConfirmItemParts
3. Log in as staff member in step 1
4. Attempt to checkout an item with a 952$3
5. The only option given is the Continue button (with a red X) and when
   clicked, the item does not get checked out.
6. Apply patch
7. Repeat step 4.
8. You should now have the option to 'Yes, check out (Y)' or
   'No, don't check out (N)'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 49ef741405d0b81ba0cb37dd81fa9a4b5aba5bbb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 39f89b43fd0a1083b85b4902b4338aee04224a44)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit cf1afb56857b2a7faffd2f8dfd5accb2ed845f95)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30234: Fix local cover image display for other holdings
Jonathan Druart [Mon, 7 Mar 2022 10:30:35 +0000 (11:30 +0100)]
Bug 30234: Fix local cover image display for other holdings

Bug 26145 added the ability to add local cover images to items.
If SeparateHoldings is set, items from other libraries are displayed in
a separate tab, and not considered as visible. We have a JS test to
assume that images not shown are not present, this only apply for the
images for the bibliographic record, as they can come from different
sources.

Test plan:
Turn on LocalCoverImages and SeparateHoldings
Create a record with different items coming from different libraries
Attach images to items and to the biblio
Notice that with this patch you can see the images from the "Other
holdings" tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 54734f68f21a2d4d248e339d144b67e071317236)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 73604cdbcc1e777d39c85fc9337246d6b4821b28)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 2ef2b2d3b26626a5d61dd60b1ddac1ed448c6c51)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
Fridolin Somers [Thu, 2 Jun 2022 07:23:23 +0000 (21:23 -1000)]
Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch

In C4::AuthoritiesMarc::merge, we search all biblio records using an authority with Koha::Authorities->linked_biblionumbers().
This method uses simple_search_compat() with no results limit, even saying in comment :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/Authorities.pm#L80

With Zebra searchengin it is correct.

But not with Elasticsearch, there is an hardcoded limit at 100 in case no limit is given :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/SearchEngine/Elasticsearch/Search.pm#L346

This means authorities links are wrong after a merge or an edit in case the authority is used in more than 100 biblio records.

:(

I propose to fix by using by default the real server max given by Koha::SearchEngine::Elasticsearch::Search::max_result_window().
This will allow a huge limit nearly impossible to reach.
See Bug 30882 to how increase this limit.

Test plan :
1) Use Elasticsearch search engine
2) Use an authority id=111 linked to 200 biblio records
3) Perform a search 'an:111', you get 200 results
4) Create a new authority id=222 linked to 2 biblio records
5) Perform a search 'an:222', you get 2 results
6) Perform a merge of the two authorties, keeping id=222
7) Perform a search 'an:111'
   without patch you get 100 results
   with patch you get no results
8) Perform a search 'an:222'
   without patch you get 102 results
   with patch you get 202 results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 48d4b016ab8f5b7199efe75384c592e39e5dfce6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eae8863fcb37b86a32425525c43d53304423f9cd)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit e82827673a6c1133e2bd0dbf79f48a1a2f69eec8)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 31005: Don't inlcude attributes only required for other categories
Nick Clemens [Thu, 23 Jun 2022 17:29:26 +0000 (17:29 +0000)]
Bug 31005: Don't inlcude attributes only required for other categories

To test:
 1 - Create a new patron attribute - check boxes to make it mandatory and visible etc.
 2 - Limit it to 'Patron' or other category
 3 - Edit a patron not in that category
 4 - Attempt to save
 5 - 500 Error
 6 - Missing mandatory extended attribute (type=MAND)
 7 - Apply patch
 8 - Attempt aedit again
 9 - It succeeds!
10 - Edit a patron in the category with MAND required
11 - on the edit page, right click teh attribute - click 'delete node'
12 - Submit the form
13 - 500 error, but this time that's good, the attribute check works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bc0264bae4769fc75133f0e10f13fc6edd86f016)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a2d22ee029291dd17ab0a6f03355943ef08d8d93)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit c914420371226df591e5d3516c5d1f09f434f8eb)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 31005: Unit test
Nick Clemens [Thu, 23 Jun 2022 17:22:53 +0000 (17:22 +0000)]
Bug 31005: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39c39430766f66008a465e1d023830c49b1f6122)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2dbf1bf80f35655b1d9474b9f3dac398082d96ab)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit e15a421dae2b265072940278b244992425e3017b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30551: Make cash register report take branchcode from cash register
Shi Yao Wang [Fri, 15 Apr 2022 16:37:34 +0000 (12:37 -0400)]
Bug 30551: Make cash register report take branchcode from cash register

This patch makes it so cash register reports puts branchcode from the
cash register where the payment was made into "Transaction library"
column instead of taking the branchcode of the manager.

Test plan:
1- Use cash registers (administration > system preferences > UseCashRegisters)
2- Create another library if you only have one (administration > libraries > new library)
3- Create a cash register in each library if they don't already have one (administration > cash registers > new cash register)
4- Create a fee on your own account and pay it right after in both libraries.
5- Go to reports > cash register and generate the statistics.
6- Notice "transaction library" in both rows are the same even though the fees were paid in two different libraries and two different cash registers.
7- Apply the patch and click submit to re-generate statistics
8- Notice it now shows the correct library where the transactions were done

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43299fe5cc1c8110112a76ba88e9ab03aaeda43c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit bb8602c19045c40c283fdff07fae5ee4edcfc5bf)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29418: (follow-up) Fix links generated in XSLTs
Tomas Cohen Arazi [Tue, 5 Jul 2022 00:09:05 +0000 (21:09 -0300)]
Bug 29418: (follow-up) Fix links generated in XSLTs

This patch addresses the case of links that are generated on the XSLT
side, those linking to host records using 773$t and 773$a.

To test:
1. Repeat the test plan from the other patches
2. When sitting on the detail view of the host record, click on the link
   to open the child.
=> SUCCESS: The link works, because of the previous patches
3. Click on the 'In:' link so the search takes you to the host record
=> FAIL: The link leads no results
4. Apply this patch
5. Restart all
6. Reload the child record page and click on the link
=> SUCCESS: Voila! The host record is retrieved!
7. Bonus points: Retry the full test plan, but add a " or ? to the
   author in both host and child records
=> SUCCESS: Things don't work before this patch, and work afterwards.
8. Sign off :-D

Sponsored-by: Theke Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29418: Make detail rendering use the cleaned-up title for searching
Tomas Cohen Arazi [Fri, 1 Jul 2022 14:54:34 +0000 (11:54 -0300)]
Bug 29418: Make detail rendering use the cleaned-up title for searching

This patch makes both staff and OPAC detail pages generate a valid
search link so you can trace related records in the Show analytics
link.

To test:
1. Pick a bibliographic record (I chose 'Unconditional' from the sample
   data
2. Add " and ? to the title statement. I changed it to
   'Uncond"itional?¿'
3. Add a child record to it
4. Open the detail page for the host record
=> FAIL: It doesn't show the 'Show analytics' link
5. Repeat 4 for the same record, in the OPAC
=> FAIL: It doesn't show the 'Show analytics' link
6. Apply this patch
7. Repeat 4 and 5.
=> SUCCESS: Links are shown!
8. Follow the links
=> SUCCESS: The links take you to the right resultset!
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29418: Make clean_search_term escape double quotes
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:19:27 +0000 (15:19 -0300)]
Bug 29418: Make clean_search_term escape double quotes

We noticed that several characters will break Zebra queries. So search
terms need to be quoted for things to work. In this context, double
quotes inside search terms are problematic because double quotes are
what we use for quoting strings.

This patch makes the clean_search_term method escape double quotes.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/Koha/SearchEngine/Zebra/QueryBuilder.t
=> FAIL: It doesn't work as it should!
3. Apply this patch
4. Repeat 2
=> SUCCESS: It does the job!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 29418: Unit tests
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:18:44 +0000 (15:18 -0300)]
Bug 29418: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoRevert "Bug 30035: Fix month name in prediction pattern"
Victor Grousset/tuxayo [Wed, 13 Jul 2022 22:04:58 +0000 (00:04 +0200)]
Revert "Bug 30035: Fix month name in prediction pattern"

This reverts commit c9253082bbbe3bc2529188b0e908053d72b77eff.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoRevert "Bug 30035: Fix failing test"
Victor Grousset/tuxayo [Wed, 13 Jul 2022 22:04:54 +0000 (00:04 +0200)]
Revert "Bug 30035: Fix failing test"

This reverts commit 5b38309599018a84e1c5a4e0566ea6d1ce9f87de.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.16 release v21.05.16
Victor Grousset/tuxayo [Mon, 27 Jun 2022 23:36:37 +0000 (01:36 +0200)]
Update release notes for 21.05.16 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoIncrement version for 21.05.16 release
Victor Grousset/tuxayo [Mon, 27 Jun 2022 14:50:30 +0000 (16:50 +0200)]
Increment version for 21.05.16 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30808: Add the 22.05 release team.
Martin Renvoize [Thu, 19 May 2022 12:40:56 +0000 (13:40 +0100)]
Bug 30808: Add the 22.05 release team.

Test plan
1/ Check against
   https://wiki.koha-community.org/wiki/Release_Teams

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a0f14c6ab69c3104447c1957b21ba6c121a66cec)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 9e0685881cedaf15388f4292ea79dc88044efbd6)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoFix translations for Koha 21.05.16
Victor Grousset/tuxayo [Mon, 27 Jun 2022 14:45:15 +0000 (16:45 +0200)]
Fix translations for Koha 21.05.16

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoTranslation updates for Koha 21.05.16
Koha translators [Mon, 27 Jun 2022 12:30:06 +0000 (09:30 -0300)]
Translation updates for Koha 21.05.16

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30781: Fix warning in GetPreparedLetter
Fridolin Somers [Thu, 19 May 2022 03:50:13 +0000 (17:50 -1000)]
Bug 30781: Fix warning in GetPreparedLetter

Test by running :
  prove t/db_dependent/Letters.t
Check you dont see warning :
  Use of uninitialized value $val in substitution iterator

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 34b84b68e509c9172b850dad4dbc5b7e9f518225)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0783b96359e392b95538a7aca78f263ae178e1ca)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 994868be66f808d6d98ffdce3e46e233fd751712)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30781: Add unit test for substitute with undefined value
Fridolin Somers [Thu, 19 May 2022 03:47:18 +0000 (17:47 -1000)]
Bug 30781: Add unit test for substitute with undefined value

Add unit test that generates warn.
This may be usefull as no regression test.

Run prove t/db_dependent/Letters.t
You see warn :
t/db_dependent/Letters.t .. 1/84 Use of uninitialized value $val in substitution iterator at /kohadevbox/koha/C4/Letters.pm line 607.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2e0243c378158755660d7bc95e15ad32dd6d0ebf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3b3b7f0ad9b46f3c17ebc8f0fda7e05184fa5547)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 9068cc1c4227646011974ffe20a6f11115ed2d3e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30354: Don't assign warn as letter
Nick Clemens [Thu, 24 Mar 2022 15:31:05 +0000 (15:31 +0000)]
Bug 30354: Don't assign warn as letter

TO test:
1 - Check out an item marked for autop renewal to a patron and make it overdue
2 - Set system preference AutoRenewalNotices to follow messaging prefs
3 - set that borrower to receive both email and SMS AUTO_RENEWALS_DGST
4 - confirm your AUTO_RENEWALS_DGST does not have SMS content but does have email
5 - run the auto_renew cron
6 - item is renewed, but error from cron, and cron dies:

No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/automatic_renewals.pl line 305.
Can't use string ("1") as a HASH ref while "strict refs" in use at /kohadevbox/koha/C4/Letters.pm line 898.

7 - Apply patch
8 - Make item eligible for auto renewal agian (or checkin/checkout)
9 - Run the cron
10 - There is still 2 warn, but cron does not die:

No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/    automatic_renewals.pl line 305.

11 - Patron receives email and item is renewed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b4685ca2054d7b5484f09c4c879fb36919443a13)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30663: Implement overrides handling in POST /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:23:23 +0000 (11:23 -0300)]
Bug 30663: Implement overrides handling in POST /suggestions

This patch implements the override checks in the controller as expected
by the previous patch.

To test:
1. Apply this bug patches up to 'Add x-koha-override options...'
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/suggestions.t
=> FAIL: Tests fail! The controller doesn't care about overrides or
         sysprefs about suggestions limits.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Things work!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ce9664e1b01e9f3dc807855d76927b9184453aee)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30663: Add x-koha-override options to /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:20:46 +0000 (11:20 -0300)]
Bug 30663: Add x-koha-override options to /suggestions

This patch adds the x-koha-override header parameter to the route that
is used to create suggestions, POST /suggestions.

The idea is that adding suggestions will be rejected under certain
conditions unless x-koha-override is passed with appropriate values. The
added overrides are:

* any
* max_total
* max_pending

Tests are added for the expected behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 25317416e62a267a4f4b06cf35f37ad38e04b40a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30663: Add Koha::Suggestions helper methods
Tomas Cohen Arazi [Tue, 3 May 2022 14:18:10 +0000 (11:18 -0300)]
Bug 30663: Add Koha::Suggestions helper methods

This patch adds the following helper methods:

* filter_by_pending
* filter_by_suggested_days_range

This methods follow basically what's done in opac-suggestions.pl
I chose 'pending' as opposed to 'open' to follow what we use in the UI
which might be the case because of being more accurate for end users.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Suggestions.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 54dbb852486b004a73dc6aabae6dda4fcecb2573)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30628: Fix patron selection in batch patron modification tool
Jonathan Druart [Thu, 28 Apr 2022 08:32:28 +0000 (10:32 +0200)]
Bug 30628: Fix patron selection in batch patron modification tool

bug 28014 added Datatables to this view, but the form is submitted with
only the checkboxes from the first page.

Solution adapted from https://stackoverflow.com/questions/33240409/how-to-submit-checkboxes-from-all-pages-with-jquery-datatables

Test plan:
Have more than 20 cardnumbers, use the batch patron modification tool
Select (not all) patrons from the first page and second page
Submit the form
Notice that the patrons you have selected appear on the confirmation
page.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7e053bf5462494cf91f2f2be745416d2d7ad261b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30610: Update on click binding for print receipt
Martin Renvoize [Mon, 25 Apr 2022 14:37:33 +0000 (15:37 +0100)]
Bug 30610: Update on click binding for print receipt

This patch updates the binding for the on click even of the print
receipt button so that subsequent pages in the datatable work with the
reciept printing button.

Test plan
1) Enable cash management and process enough transactions to display
   more than one page of transactions in the register details page.
2) Confirm the 'Print receipt' button works on the first page of
   transactions
3) Confirm the 'Print receipt' button works on subsequent transactions
   pages in the datatable.
4) Confirm the same for the past transactions table.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 126c70c982089c74c75d1c99d33c01c9cc4cf001)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30630: Prevent crash on check-in if HoldsAutoFill is ON
Jonathan Druart [Thu, 28 Apr 2022 07:43:06 +0000 (09:43 +0200)]
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON

RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item

Test plan:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item
Without this patch you got
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
 at /kohadevbox/koha/C4/Reserves.pm line 1576
With this patch applied the operation succeeds

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 73a2e3558944effbdb4a19e6c8a331679d41fcf8)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug ?????: Compiled SCSS due to compiler change or previous oversight
Victor Grousset/tuxayo [Fri, 17 Jun 2022 03:27:44 +0000 (05:27 +0200)]
Bug ?????: Compiled SCSS due to compiler change or previous oversight

Either it has been forgotten in a previous release or it's the compiler
version difference between me and the previous RMaint

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 24001: (follow-up) Fix t_Profile.t
Fridolin Somers [Fri, 29 Apr 2022 06:24:45 +0000 (20:24 -1000)]
Bug 24001: (follow-up) Fix t_Profile.t

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 333b698d6264859d6cae3ab112cca6c4ce52c623)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 24001: Fix Card template/rpinter profile creation and edit
Nick Clemens [Fri, 4 Mar 2022 16:19:35 +0000 (16:19 +0000)]
Bug 24001: Fix Card template/rpinter profile creation and edit

This patch adjusts the template/profiles to use the default of '0'
This should probably be NULL, and the columns foreign keys, this code
could use a further rewrite, but this should fix a long standing bug

To test:
 1 - Using the fresh install, with all the sample data.
 2 - Go to Home › Tools › Patron card creator › Templates
 3 - New > Card template
 4 - Save
 5 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'profile_id' at row 1
 6 - Edit an existing template
 7 - Save
 8 - Error: Can't bless non-reference value at /kohadevbox/koha/C4/Creators/Profile.pm line 89
 9 - Create a new 'Printer profile'
10 - Save
11 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'template_id' at row 1
12 - Apply the attached patch.
13 - Verify you can create a new 'Card template' and 'Printer profile' with no errors
14 - Verify you can edit and save both of the newly created objects above

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 65c784d3fd9b745613c35c84bef10422a7170043)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 24001: Fix patron card template edition
Blou [Tue, 30 Jun 2020 16:50:09 +0000 (12:50 -0400)]
Bug 24001: Fix patron card template edition

Error when saving Patron card Template:
Can't bless non-reference value at
/home/vagrant/kohaclone/C4/Creators/Profile.pm line 89

This is caused by the profile dropdown offering invalid choices and is
fixed by adding a filter to limit options to creator = 'Patroncards'.
The UI already handles the case where no valid profile is avaiable.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8be82f861621cdf86bcd4b683254365542897ed4)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.15 release v21.05.15
Andrew Fuerste-Henry [Sun, 29 May 2022 16:27:06 +0000 (16:27 +0000)]
Update release notes for 21.05.15 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoIncrement version number for 21.05.15 release
Andrew Fuerste-Henry [Sun, 29 May 2022 16:20:30 +0000 (16:20 +0000)]
Increment version number for 21.05.15 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoFix translations for Koha 21.05.15
Andrew Fuerste-Henry [Sun, 29 May 2022 16:17:53 +0000 (16:17 +0000)]
Fix translations for Koha 21.05.15

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoTranslation fixes for 21.05.15
Andrew Fuerste-Henry [Sun, 29 May 2022 16:16:59 +0000 (16:16 +0000)]
Translation fixes for 21.05.15

2 years agoTranslation updates for Koha 21.05.15
Koha translators [Sun, 29 May 2022 16:02:08 +0000 (13:02 -0300)]
Translation updates for Koha 21.05.15

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29374: Don't crash if search engine returns a deleted record
Jonathan Druart [Fri, 29 Oct 2021 10:27:25 +0000 (12:27 +0200)]
Bug 29374: Don't crash if search engine returns a deleted record

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 20991feb62daedf5827b29e986002a34b0d41cce)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30212: Make Select2 available for ILL backends
Tomas Cohen Arazi [Wed, 2 Mar 2022 11:19:55 +0000 (08:19 -0300)]
Bug 30212: Make Select2 available for ILL backends

This patch makes select2 available for ILL backend developers to use on
their templates.

To test:
1. Have a configured backed and an ILL request
2. Open the inspector and load any action on the backend (intranet)
=> FAIL: no select2 asset is transfered from Koha to the browser
3. Apply this patch
4. Reload
=> SUCCESS: There's select2
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c864cc73e58daa37bbfc71a5629ece7625579fbe)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30199: Do not generate jwt if patron does not exist
Jonathan Druart [Fri, 18 Mar 2022 09:26:48 +0000 (10:26 +0100)]
Bug 30199: Do not generate jwt if patron does not exist

This is a follow-up patch for bug 29543. If an invalid cardnumber has
been used we should not generate a token.

Test Plan:
1. Set SelfCheckoutByLogin to 'cardnumber'.
2. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
3. Enter an invalid carnumber like 'thisisabadcardnumber'
4. See the appropriate message "Sorry The userid thisisabadcardnumber was not found in the database. Please try again."
5. Try again with a different cardnumber and notice the same exact error message including the 'thisisabadcardnumber' cardnumber.
6. Apply this patch
7. Restart all the things!
8. Repeat steps 2-4
9. Try again with a different cardnumber, you should now see the correct
   cardnumber!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e5aeb047a563b20769d49c2777d47039581ca7bd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30595: Prevent update_child_to_adult.t to fail randomly
Jonathan Druart [Fri, 22 Apr 2022 09:42:09 +0000 (11:42 +0200)]
Bug 30595: Prevent update_child_to_adult.t to fail randomly

t/db_dependent/selenium/update_child_to_adult.t ..         # Looks like you planned 3 tests but ran 2.

    #   Failed test 'Update child to adult'
    #   at t/db_dependent/selenium/update_child_to_adult.t line 132.
    # Looks like you planned 3 tests but ran 2.
    # Looks like you failed 1 test of 2 run.
t/db_dependent/selenium/update_child_to_adult.t .. 1/1
 #   Failed test 'Update child to patron'
 #   at t/db_dependent/selenium/update_child_to_adult.t line 153.
Cannot wait more for element '//input[@type="submit"]' to be visible at /kohadevbox/koha/t/lib/Selenium.pm line 189.

It happens when there are too many patron's categories and the submit
button is not in the viewport.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit faa35972b038b9df0459a582ced73e98adb897cc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30346: Correctly transfer values when editing rules
Lucas Gass [Mon, 11 Apr 2022 19:35:14 +0000 (19:35 +0000)]
Bug 30346: Correctly transfer values when editing rules

To test:
--Create a circulation rule with a value in "Overdue fines cap (amount), or edit an existing rule to add it
-Save the new (or edited) rule.
-Edit the same rule again to change any other field. Note that "Overdue fines cap (amount)" is now blank
-Save your edited rule - "Overdue fines cap (amount)" will save as blank.

Apply patch

--Create a circ rule with a value in Overdue fines cap (amount) and check "Cap fine at replacement price" for that same rule.
-Save the rule
-Try ediding the rule and make sure both of those values now save correctly.
-Add several more rules and try playing with both "Cap fine at replacement price" and "Overdue fines cap (amount)". Make sure everything saves right.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f69e3b364f13cb6dbcf9aa12d3d21fea8c1f3798)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30540: Fix perl critic complaint of leading zeros
Nick Clemens [Thu, 14 Apr 2022 10:51:18 +0000 (10:51 +0000)]
Bug 30540: Fix perl critic complaint of leading zeros

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8cc4961143756681ec1b9e1639bad6bb5198b7cf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30540: eval on set_time_zone
Martin Renvoize [Thu, 14 Apr 2022 08:14:47 +0000 (09:14 +0100)]
Bug 30540: eval on set_time_zone

This patch adds an eval around the call to set_time_zone so that we
don't crash on invalid local dates and instead just keep the passed
floating timezone.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6dab34fe66d41b367141f8e1b96abfe1729d045b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30540: Unit test
Martin Renvoize [Thu, 14 Apr 2022 09:19:47 +0000 (10:19 +0100)]
Bug 30540: Unit test

This patch adds tests for checking the output_pref method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/DateUtils.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 052dd948af6eaaaeeb0e83a6950543b4832aeefe)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30518: Correct DateTime maths for needs_advancing
Martin Renvoize [Wed, 13 Apr 2022 07:24:22 +0000 (08:24 +0100)]
Bug 30518: Correct DateTime maths for needs_advancing

The needs_advancing method prior to this patch used basic DateTime
arithmatic, adding a DateTime::Duration in Days to the Arrival date of
the item and then comparing that to today. This, however, can cause bugs
when the arrival + duration date coincides with a DST boundary and as
such may result in an invalid local date.  See
https://metacpan.org/pod/DateTime#Making-Things-Simple for further
details.

This patch updates the code to use the DST safe delta_days method to
count the days between arrival and now instead and then compares this
integer to the defined duration of the stage.

To test:
1. Re-run the unit tests, they should now pass.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3929335cdbea81c7c891a8a979d69861468502fd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30518: Unit test
Martin Renvoize [Wed, 13 Apr 2022 07:52:02 +0000 (08:52 +0100)]
Bug 30518: Unit test

This patch adds tests for checking the needs_advancing method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/db_dependent/StockRotationItems.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4450ad21100a02055e3f0f05918b2d4b17852107)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>