koha.git
5 weeks agoBug 34621: implement Patron import option to 'Renew existing patrons' 'from the curre...
Kyle M Hall [Fri, 25 Aug 2023 17:37:46 +0000 (17:37 +0000)]
Bug 34621: implement Patron import option to 'Renew existing patrons' 'from the current membership expiry date'

Test Plan:
1) Test importing a patron with the "from the current membership expiry date" option,
   note it does not work
2) Apply this patch
3) Restart all the things!
4) Re-test, note the expiration was renewed from the patron's current
   expiration date!

Signed-off-by: David Nind <david@davidnind.com>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b89d744e868cd93632d6b84f5f39116a475d342e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3a99bc8bb1cc95c7d1abcff3ffa7bccd72f68b1d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36473: (follow-up) Additionally warn the stringified exception
Nick Clemens [Thu, 18 Apr 2024 11:17:33 +0000 (11:17 +0000)]
Bug 36473: (follow-up) Additionally warn the stringified exception

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 903a8685c661ddde61335a08e126506120345abc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc7842c649088ed94aeea13d59b683b25c720de9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36473: (follow-up) Add biblionumber to warning
Nick Clemens [Thu, 18 Apr 2024 10:35:52 +0000 (10:35 +0000)]
Bug 36473: (follow-up) Add biblionumber to warning

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1b99de33f9e553f80507ef7da5e711b98e979e39)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bab05efd815d48ef0266454ec283bf7a8e19db45)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36473: (follow-up) Correct biblio to bibliographic
Nick Clemens [Thu, 18 Apr 2024 10:33:40 +0000 (10:33 +0000)]
Bug 36473: (follow-up) Correct biblio to bibliographic

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0191500149433313aa73a6c43255a19d659acad0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75372edaa0dfc5acae5432d5af7a14ea7e8b4966)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36473: Handle Invalid Metadata Exceptions in totalissues.pl
Nick Clemens [Mon, 1 Apr 2024 14:32:08 +0000 (14:32 +0000)]
Bug 36473: Handle Invalid Metadata Exceptions in totalissues.pl

This patch wraps the call for record in an eval, and catches any invalid metadata
exceptions, letting the warning show, but allowing the script to continue
To test:
1 - In default KTD record 369 has problems, otherwise you need to break a record
2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v
3 - It dies at record 369 (or the one you broke)
4 - Apply patch
5 - Run again
6 - It succeeds, but skips the bad record

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f3d2f34d7a6aeead30b40a30b239f15c6c94a7f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d397da65c02ee40243aacdc3382e68b84e040921)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36473: Unit tests
Laura Escamilla [Tue, 2 Apr 2024 13:43:00 +0000 (13:43 +0000)]
Bug 36473: Unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9e9cc822cbd7836827a9596f71c50d5ad37f6802)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d80334a1087bc4e0dc50174a3d3d30217dfe8831)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 23102: No mock in selenium
Nick Clemens [Fri, 12 Apr 2024 09:46:20 +0000 (09:46 +0000)]
Bug 23102: No mock in selenium

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9aa811c33481dddded624829dfd24643f31fc04d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86e78b5511686b33068f92317f3a9e3b690594da)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 23102: 404 errors on page causes SCI user to be logged out
Nick Clemens [Wed, 12 Jun 2019 11:43:48 +0000 (11:43 +0000)]
Bug 23102: 404 errors on page causes SCI user to be logged out

To test:
 1 - Have something on the SCO page that won't load
     Add to SCOUserJS:
        </script>
        <img src="http://localhost:8080/silk/famfamfam.png"/>
        <script>
 2 - Enable the SCO and SCI system preferences:
     WebBasedSelfCheck: Enable
     SelfCheckInModuke: Enable
     AutoSelfCheckAllowed: Allow
     AutoSelfCheckID / AutoSelfCheckPass to a valid user with permissions
 3 - Add the self_checkin_module and self_checkout_module permissions to the AutoSelfCheck user
 4 - Access the selfcheckout module https://yoursite.org/cgi-bin/koha/sco/sco-main.pl
 5 - Sign in using a patron
 6 - Enter an unkown barcode, I used "DONTMATTER"
 7 - If not logged out, click to 'Return to account summary'
 8 - You are asked to sign in again
 9 - Repeat with the SCI module
10 - Apply patch
11 - Repeat, but this time you can return to account

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5bab87f76b05bbf8627cf6786975e9e30a5f2f6c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 240f526d06a2070a492799bb9045d4965fcced4b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 23102: Selenium test
Nick Clemens [Fri, 14 Feb 2020 15:15:10 +0000 (15:15 +0000)]
Bug 23102: Selenium test

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fee56e8d85e4cd897293d9d8b0b48b66071fbde0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d21a2da67cac9e8be1ff39109692fd79b168795)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35969: (follow-up) Improve wording
Marcel de Rooy [Wed, 7 Feb 2024 13:53:20 +0000 (13:53 +0000)]
Bug 35969: (follow-up) Improve wording

As suggested by David Nind. Thanks!

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b4ce5051c1ac080ac68d44b464141507e5eca602)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c46d122fc10026cdcd61049cae036e08acfea886)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35969: Add error code in opac-sendbasket.pl
Marcel de Rooy [Thu, 1 Feb 2024 07:55:55 +0000 (07:55 +0000)]
Bug 35969: Add error code in opac-sendbasket.pl

No need to carp about empty basket or no reply address.
Just add a simple explanation on the form.

Note that it makes no sense to show the form if the patron
has no email address. We need it as reply-to.

Test plan:
Try opac-sendbasket.pl?bib_list=null
Remove email address from your account, try again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 35293612a8d0efa932bf376b7855b17cc29d6d5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3266b9d5bc80d4aabf47488fff4221d9af516a5e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36517: Fix output from install_plugins.pl
Magnus Enger [Fri, 5 Apr 2024 13:41:08 +0000 (13:41 +0000)]
Bug 36517: Fix output from install_plugins.pl

When misc/devel/install_plugins.pl does not find any plugins, it prints
the list of pluginsdir, but with a literal \n separating the dirs, and
no newline at the end.

To test:
- Edit koha-conf.xml and add a second entry for <pluginsdir>, so there
  are two entries. The second one could just be a copy of the original.
- Run "perl misc/devel/install_plugins.pl"
- Note the output looks something like this:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha(master)$

- Apply the patch and run the script again. Output should be:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins
/var/lib/koha/kohadev/plugins
root@kohadevbox:koha(master)$

- Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4848def5e2a336e01bf0dd0ff61a75a30b35f137)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f2a05fadd06f40ad385ed8f7792ac7b68c16e7d7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36493: Make cashups test more robust
Tomas Cohen Arazi [Tue, 2 Apr 2024 15:39:02 +0000 (12:39 -0300)]
Bug 36493: Make cashups test more robust

This patch makes the test independent from existing cash registers in
the system.

To test:
1. Enable UseCashRegisters on a fresh KTD
2. Add a cash register
3. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/cashups.t
=> FAIL: Tests fail!
4. Apply this patch
5. Repeat 3
=> SUCCESS: Tests pass!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4436a7d41a74bf002fdd80ec97f0be38d40eee22)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 19b543a51b59c7a13e5a901c2c31413eee2f2692)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36438: Check object for calling metadata
Marcel de Rooy [Wed, 27 Mar 2024 12:19:34 +0000 (12:19 +0000)]
Bug 36438: Check object for calling metadata

Resolve: Can't call method "metadata" on an undefined value at catalogue/MARCdetail.pl line 93

The proceeding lines check for $record and respond appropriately.

Test plan:
Call catalogue/MARCdetail.pl with an unexisting biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a37ebc77b7f3513b2775ebb8819a710e5a2eb416)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d45bf88a97ad22f529203c5dbd426ab13d812d4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36531: Serve text/javascript compressed, like application/javascript is
Phil Ringnalda [Fri, 5 Apr 2024 01:59:34 +0000 (18:59 -0700)]
Bug 36531: Serve text/javascript compressed, like application/javascript is

Koha serves static .js files as application/javascript (if /etc/mime.types
says to) and serves them compressed, but output_with_http_headers uses the
currently-correct text/javascript mimetype, and Koha doesn't compress that.

Test plan:
1. Set the preference EnableAdvancedCatalogingEditor to Enable.
2. Open the browser Web Developer Tools to the Network tab
3. Load Cataloging - Advanced editor
4. Click on the line for the framework?frameworkcode=&callback=define load
5. Note the content-type text/javascript, no Content-Encoding line, and
   the size of 1.9MB
6. Apply the patches from bug 36463 if they haven't been pushed, then this
   patch, and reset_all
7. Repeat steps 1-4, and note a Content-Encoding: gzip header and a
   Transferred size around 160KB

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c52af2cef0d79f20d74ebf170d4d5514b139ea65)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e0c3032b6f397f2b83073a6d274cdcfd370415e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36463: (follow-up) Adjust other occurence (intranet)
Nick Clemens [Fri, 29 Mar 2024 16:12:01 +0000 (16:12 +0000)]
Bug 36463: (follow-up) Adjust other occurence (intranet)

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 69ad327379fe0bc46926fb51276f81849a4a6f49)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 30b0b8a3200b1adbedd093b07ca2ce1129aa14ed)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36463: Compress application/json
Nick Clemens [Fri, 29 Mar 2024 12:54:30 +0000 (12:54 +0000)]
Bug 36463: Compress application/json

This patch simply adds application/json to the mod_deflate configuration

To test:
1 - Open the netowrk tab in firefox
2 - Load http://localhost:8081/api/v1/libraries
3 - Not the transferred size, and note no 'Content-Encoding: gzip" header
4 - Apply patch, reset_all (or edit /etc/koha/apache-shared.conf)
5 - Reload
6 - Note smaller size, note gzip header

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bccf7764c0e3eea22713edb7d76f90c8d8bf8c2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d8afbbf6615d56ac13a45e3ce658623d159c5a68)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36353: Update relationship value so that it is blank and consistent with other...
Laura Escamilla [Mon, 18 Mar 2024 19:42:01 +0000 (19:42 +0000)]
Bug 36353: Update relationship value so that it is blank and consistent with other forms

To Test:

1. Choose a User Eligible for a Guarantor:
   1. Modify the user profile to include a new guarantor.
   2. Upon selecting a guarantor, ensure that the empty option in the 'Relationship' dropdown appears as a blank box.

2. Select a User Eligible for a Guarantee:
   1. Navigate to "Add Guarantee" in the top menu.
   2. Verify that the guarantor field is automatically populated with the selected user.
   3. Confirm that the 'Relationship' dropdown displays the empty option as 'Empty record.'

3. Apply Patch and Refresh the Page for Step 2:
   1. After applying the patch, refresh the page for step 2.
   2. Ensure that the empty option value for 'Relationship' is now displayed as blank.

4. Sign Off and Have a Great Day! 😊🎉#

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9de44f00f7744b1ad09ffc0d619344872f81305b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75c3ff228e3f5145caec125fcf5a114396e3aaca)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36142: recallsview template param for opac-recall.tt
Pedro Amorim [Wed, 21 Feb 2024 13:03:13 +0000 (13:03 +0000)]
Bug 36142: recallsview template param for opac-recall.tt

Test plan:
1) Enable UseRecalls
2) Visit OPAC confirm recall page:
<opac_url>/cgi-bin/koha/opac-recall.pl?biblionumber=76
3) Notice left-side menu 'Recalls history' is not active
4) Apply patch. Repeat.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 44d2303ef7397e352c889ce2405b4d01e9f11fbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3f731be49000f71ef020c21f02663d12153c62d2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36452: correct display of patron message
Philip Orr [Thu, 28 Mar 2024 10:34:32 +0000 (10:34 +0000)]
Bug 36452: correct display of patron message

To test:
1. Before applying the patch:
2. In the staff interface, navigate to a patron
3. Add a new staff message that contains multiple lines (e.g. using
   enter for the next line)
4. Save the message and check the display.
   It will be a single line.
5. Apply the patch and navigate back to the
   patron
6. The message should now be displayed as multiple lines.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5e8059a6f83493149ecefc03b9a47c42288a26ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 54bb9ffe16aba5fb91aa743f7e2f5b8d176a78dc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36462: remove extra Home breadcrumb item
Andreas Roussos [Fri, 29 Mar 2024 06:59:41 +0000 (07:59 +0100)]
Bug 36462: remove extra Home breadcrumb item

In the Staff interface, when viewing (or editing) the authority MARC
subfield structure for a particular field, the Home button breadcrumb
on the top left of the screen appears twice.

This patch fixes that.

Test plan:
1) Try to view (or edit) the authority MARC subfield structure for
   a particular field. Notice the 'Home' breadcrumb button/icon is
   appearing twice.
2) Apply this patch.
3) Refresh the page, the 'Home' breadcrumb icon should now appear
   only once.

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f7df7819cd4f9135c1eb4e389eee1ef2a144e2b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f7d4ca168e5dd2bad6f4c994ca1c07b59332c86)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36516: Fix useless warning from translation script
Jonathan Druart [Thu, 4 Apr 2024 09:13:04 +0000 (11:13 +0200)]
Bug 36516: Fix useless warning from translation script

I lost too much time trying to know what the translation script outputs
  sh: 1: Syntax error: end of file unexpected

To recreate:
touch 'koha-tmpl/intranet-tmpl/prog/en/modules/<' (yes, don't ask!)
koha-translate -i de-DE --dev kohadev
or
koha-translate -u de-DE --dev kohadev

And you get the shell error without any ideas what's happening!

With this patch applied you will not get any errors because the quote
will actually copy the file (what is expected).

But without the quote the cp command will fail and the explanation will be
displayed
sh: 1: Syntax error: end of file unexpected
Cannot copy /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/< to /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/de-DE/modules/< at /kohadevbox/koha/misc/translator/tmpl_process3.pl line 385.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0026ee3e971b6556f2fdd97f6173d12337bb7c0f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2001b853f4028c807bf986cdd42c687961f9c67a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36395: Remove useless fetch in admin/marc_subfields_structure.pl
Jonathan Druart [Thu, 21 Mar 2024 14:52:52 +0000 (15:52 +0100)]
Bug 36395: Remove useless fetch in admin/marc_subfields_structure.pl

Since (a long time ago!)
  commit 62aa3f4292d83bc9304e296de5f0830e28510492
  Bug 17216: Use Koha::AVC from mss.pl

This $sth2 is never fetched, we are retrieving the AV cat using
Koha::AV::Categories

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4158783eb284cf5f89266d3251f6d647200c0f01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a2ea0291e7ca79e52e359da28ff6a9c9ab5b1445)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35868: Warning sign for using a patron category that is limited to another librar...
Fridolin Somers [Thu, 21 Mar 2024 14:08:38 +0000 (15:08 +0100)]
Bug 35868: Warning sign for using a patron category that is limited to another library has moved to other side of page

Bug 31422 implemented a warning sign, when a patron has a patron category that you are not allowed to set due to library limitations on the code.
It should appear right next to the field, but might appear on the other side of the page now being easily missed.

This patch simply removes the float:right CSS rule.

To test:
* User's login branch and home library is: Centerville
* Patron category "B - Board" is limited to Franklin
* Create a new patron: Board doesn't show
* Edit an existing patron with another patron category: Board doesn't show
* Edit a patron with Board category from Centerville
=> Check the warning icon with the tooltip is close to the category select

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7356a5cbd48cdb3a7971608f59131152d296a447)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3ba6bb9cdfef55d7e0d416acb4ad953c805756cc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 27198: Fix syntax in marc21-retrieval-info-auth-dom.xml
David Cook [Fri, 11 Dec 2020 04:42:39 +0000 (04:42 +0000)]
Bug 27198: Fix syntax in marc21-retrieval-info-auth-dom.xml

This patch fixes the syntax in marc21-retrieval-info-auth-dom.xml,
so that one can use the Zebra special retrieval elements documented
at https://software.indexdata.com/zebra/doc/special-retrieval.html

These are very useful when troubleshooting issues with authority
records in Zebra.

Test plan (using KTD):
1. yaz-client unix:/var/run/koha/kohadev/authoritysocket
2. Enter these commands:
   . base authorities
   . format xml
   . elements zebra::snippet
   . find e
   . show 1
3. Result = diagnostic message:
     Diagnostic message(s) from database:
        [25] Specified element set name not valid for specified database
             -- v2 addinfo 'zebra::snippet'
4. Apply the patch
5. Copy updated file: sudo cp debian/templates/marc21-retrieval-info-auth-dom.xml
   /etc/koha/marc21-retrieval-info-auth-dom.xml
6. Stop and restart zebra (no need to rebuild the Zebra index):
   . sudo koha-zebra --stop kohadev
   . sudo pkill zebrasrv
   . sudo koha-zebra --start kohadev
7. Repeat commands in step 2.
8. Result from show 1 = XML output:
    Sent presentRequest (1+1).
    Records: 1
    Record type: XML
    <record xmlns="http://www.indexdata.com/zebra/">
      <snippet name="Any" type="w">Gontarski, S. <s>E</s></snippet>
    </record>nextResultSetPosition = 2
   Elapsed: 0.013929

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 10d5f6ef379768663cd6b26a81315ce44b65520d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f129c009a40f9af4f4d9d984058e99829bc21a0d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35599: Fix Pronouns and HidePersonalPatronDetailOnCirculation
Fridolin Somers [Mon, 25 Mar 2024 14:53:10 +0000 (15:53 +0100)]
Bug 35599: Fix Pronouns and HidePersonalPatronDetailOnCirculation

Bug 10950 adds a pronouns text field to the patron record.
Currently it is hidden by system preference 'HidePersonalPatronDetailOnCirculation'.

This patch moves pronouns outside this system preference influence.

Test plan:
1) Add pronouns to a patron
2) Set system preference 'HidePersonalPatronDetailOnCirculation' to "Don't hide"
3) Check you see pronouns in circulation page
   /cgi-bin/koha/circ/circulation.pl?borrowernumber=X
4) Set system preference 'HidePersonalPatronDetailOnCirculation' to "Hide"
5) Refresh circulation page
=> Without patch pronouns are hidden
=> With patch pronouns are displayed

Signed-off-by: Hebah <hebah@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 07738adbf08a66fdb91728dedc1362a8a75a3067)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a728c6582828ca458edf647c017e26fe020cb827)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 23296: Set patron branchcode when preparing non-digest version
Lucas Gass [Thu, 25 Jan 2024 21:54:21 +0000 (21:54 +0000)]
Bug 23296: Set patron branchcode when preparing non-digest version

To test:
1. APPLY PATCH
2. Set up circ rules to allow for auto renewals.
3. Set AutoRenewalNotices to 'according to message prefs'
4. Make a branch specific version of the the AUTO_RENEWAL notice.
5. Find a patron belonging to that branch and set the message prefs to allow for a AUTO_RENEWAL. But no digest option!
6. Check some things out and make sure they are eligble for auto renewal.
7. Run the cron.
8. Make sure the patron gets the branch specific notice.
9. Delete the branch specific notice.
10. DO 6-7 again.
11. Make sure they now get the all library notice.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied one line.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ade75ea56158e6cf87894d0aeba1711e73dbfcda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8607c04099b2296046236de15a246d7999157f1b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35573: Correctly display warning when placing a hold
Julian Maurice [Wed, 7 Sep 2022 09:24:49 +0000 (11:24 +0200)]
Bug 35573: Correctly display warning when placing a hold

Test plan:

1) Add a basic circulation rule like : 0 hold allowed on patron category
   'A' and set AllowHoldPolicyOverride to 'Allow'
2) Make a hold on a patron belongs to this category
3) Normally you should see a warning on item (override needed) but it's
   not the case
4) Apply this patch
5) Refresh and repeat step 2

This patch comes from an alternative patch on the original bug (I'm including
the original test plan for your information) :

(Bug 30687 - alternative patch): Always allow to force hold pickup location

If AllowHoldPolicyOverride is enabled and only some pickup locations are
available, you still have the possibility to force one of the others
pickup locations.
But when there are zero pickup locations available, that is not
possible.

This patch change that by always displaying the list of pickup locations
when AllowHoldPolicyOverride is enabled.

Test plan:
1. Apply patch
2. Disable AllowHoldPolicyOverride
3. Create a biblio B with an item I at library A.
4. Configure this library A to not be a pickup location
5. Add a "Default holds policy by item type" for item I type where "Hold
   pickup library match" is "item's home library"
6. Try to place a hold on biblio B
   You should not be able to place a hold because there is no valid
   pickup locations
7. Enable AllowHoldPolicyOverride
8. Try to place a hold on biblio B
   You should now see all valid pickup locations in a dropdown list
   (with an exclamation mark in front of each option) with none selected
   by default
9. Verify you can place a title-level hold and an item-level hold

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 805ea1a00e5e05aae71c508947976b0cfff5b81a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 204b5c76ce3c8ee29b6bd6882c0852fa31fe71d4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35573: Revert "Bug 30687: Allow pickup location to be forced when override is...
Thibaud Guillot [Mon, 5 Feb 2024 11:59:06 +0000 (12:59 +0100)]
Bug 35573: Revert "Bug 30687: Allow pickup location to be forced when override is allowed"

This reverts commit ab93008da7eb61b697e4586c679b88c2eebaacd0.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 33da81f9feb145e357647d456ae3bad0644f6963)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aa149ff575e43c2662d21268d7119906a3e2a938)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36269: Elasticsearch: publisher-location (pl) should use260a/264a
Thomas Klausner [Thu, 7 Mar 2024 16:56:13 +0000 (17:56 +0100)]
Bug 36269: Elasticsearch: publisher-location (pl) should use260a/264a

Currently the index `pl` points to 008/15-17. It should
(additionally/instead?) point to 260a and/or 264a.

Test plan (for koha-testing-docker with ElasticSearch via `ktd --es7 up`)

Verify the old/broken behaviour:

* Go to Staff/Advanced Search
* Select "Publisher Location" and enter "cau", start search
* You will get some hits (~16), eg "Perl best practices / Damian Conway", which has 008 of "051222s2005 caua b 001 0 eng d" with "cau" on 15-17
* Edit this record (cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=5)
* Inspect 260$a, which should containt "Sebastopol, CA :"
* Go back to Advanced Search and search for  "Publisher Location" = "Sebastopol"
* No hits!

Apply the patch!

* exit ktd and stop it (ktd --es7 down; ktd --es7 stop)
* start it again
* Go to Staff / Administration / Search Engine Config (Elasticsearch)
* Click on the Tab "Bibliographic records" and search/filter for "pl"
* you should see 3 entries for "pl", with Mapping values of "008_/15-17", "260a" and "264a"
* Go to Search,
* Select "Publisher Location" and enter "cau", start search
* same hits as befor
* Search again, but for "Sebastopol"
* Now you'll get 9 hits!!

Bonus: Test 264a

* Got to Admin / MARC bibl framework, select BKS -> MARC structure
* search for tag "264", edit subfields
* in tabs a, b, c: Check the "Editor" Checkbox (Visibility)
* Save changes
* find a book, eg again "Perl best practices" and edit it
* find field 264 and enter "Test" into  264a, Save
* Depending on your setup, you might have to manually re-index the book:
  * enter ktd: ktd --shell
  * reindex the one book (via --bn) or all (might also need a -d)
    /usr/share/koha/bin/search_tools/rebuild_elasticsearch.pl -v -b -d
* Go again to Advanced Search, Publisher Location = "Test"
* You should find the book

If your NOT running ktd, you might be able to just edit the ElasticSearch Mappings to add / change the mapping for "pl" to point to "260a".

One rather harsh way to do this (which I needed to do, because the ES Mappings UI did not work for me) is via this SQL:
update search_marc_map set marc_field='260a' where marc_field='008_/15-17';

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit df9bc0b86a83d60b7b71924c46087bed7aa4226b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 342c65a680fffe6fb6a5b9b4d8539a5947686168)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35129: Return 400 if _per_page=0 passed
Tomas Cohen Arazi [Mon, 18 Mar 2024 15:49:20 +0000 (12:49 -0300)]
Bug 35129: Return 400 if _per_page=0 passed

This patch adds a safe guard for when consumers pass _per_page=0 to
endpoints. This condition is checked for on a centralized place and
avoid reaching the controller in such scenarios that would provoke a
division by zero exception.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/pagination.t
=> FAIL: We expect a 400, but get a 500 instead
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! No more explosions for this!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 308bb0830cfe69116e442bad4cd206dd402244be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b1e9ef93f2181cc63537be6d09027491885dc303)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35129: Regression tests
Tomas Cohen Arazi [Mon, 18 Mar 2024 15:48:55 +0000 (12:48 -0300)]
Bug 35129: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9a4e3bd49f1a978fbe5d3dc88e36dc5de0fb81f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9e8657aba7d7f742e2cc2bdf98a55252c021890e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36341: (follow-up) Fix missing Date_from_syspref
Martin Renvoize [Mon, 29 Apr 2024 08:38:02 +0000 (09:38 +0100)]
Bug 36341: (follow-up) Fix missing Date_from_syspref

It appears this bug introduces the first actual use of this function in
the OPAC and thus exposes that bug 31261 didn't fully port the
Date_from_syspref from the intranet.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 04d3cf07a858a5efc129b2f78e62d8dd8148b742)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ab7a3ff196459e419230794d1a50cfa8f1e4efcd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36341: (QA follow-up) Use future inclusive on staff side too
Nick Clemens [Mon, 1 Apr 2024 17:33:52 +0000 (17:33 +0000)]
Bug 36341: (QA follow-up) Use future inclusive on staff side too

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ace0bec6baa027c5be862f062d393d13deb8c162)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 70219dd7b4ca9394d72390b88add6c3137caf980)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36341: Add futureinclusive to future holds
Martin Renvoize [Mon, 18 Mar 2024 11:35:13 +0000 (11:35 +0000)]
Bug 36341: Add futureinclusive to future holds

This patch adds the flatpickr-futureinclusive data to the input field
for "Hold starts on date" in the OPAC.

We also add 'flatpickr-future' data to the input field for expiration
date as it also doesn't make sense to allow this to be a past data
either.

Test plan
1) Attempt to place a hold on an item from the OPAC
2) Expand the 'Show more options' dropdown
3) Note that without the patch 'Hold not needed after' allows setting to
   a date in the past.
4) Enable `AllowHoldDateInFuture` and `OPACAllowHoldDateInFuture` system
   preferences
5) The 'Hold starts on date' option should now appear if you refresh
   your hold placing page in the OPAC.
6) Note that the above input also allows setting a past date
7) Apply patch
8) Neith input should allow past dates now.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c16ec21f4b77971b19e5c4b5140521c4133f0608)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e3bfca4f02b72e00909272fbfb5fc24abbab49a7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36432: Remove circular dependency from Koha::Object
Julian Maurice [Tue, 26 Mar 2024 15:19:41 +0000 (16:19 +0100)]
Bug 36432: Remove circular dependency from Koha::Object

Koha::Object depends on Koha::DateUtils, which depends on C4::Context,
which depends on Koha::Config::SysPref, which depends on... Koha::Object

Apart from the circular dependency, the dependency on C4::Context alone
is problematic as it loads a bunch of modules that are not needed at all
in Koha::Object (YAML::XS and ZOOM for instance).
As Koha::Object is used as a base for a lot of modules, we should take
care to only load the minimum required.

This patch moves some date parsing code to specific modules:
- Koha::DateTime::Format::RFC3339
- Koha::DateTime::Format::SQL

and it uses them in Koha::Object and Koha::DateUtils where it is
possible.

Test plan:
1. Do not apply the patch yet and run the following command:
   `perl -cw Koha/Object.pm`
   It should print several warnings about redefined subroutines, meaning
   there is a circular dependency.
2. Apply the patch
3. Run `perl -cw Koha/Object.pm`. It should only say:
   "Koha/Object.pm syntax OK"
4. Run the following command:
    prove \
        t/DateUtils.t \
        t/Koha/DateTime/Format/RFC3339.t \
        t/db_dependent/Koha/Object.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8d5299639e3f983e95fcf2a9d81febc1406bafdd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0c862533d74505c8f4fa8760d809942973ea57c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36376: (QA follow-up) Tidy
Nick Clemens [Mon, 1 Apr 2024 12:53:01 +0000 (12:53 +0000)]
Bug 36376: (QA follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e6a4a555b73f653e7245bad88973d17ceea5dc6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 768701bf1d07cb02f14c75091aa83573bab4959c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36376: Display library limitations alert in patron's messages
Fridolin Somers [Wed, 20 Mar 2024 17:29:02 +0000 (18:29 +0100)]
Bug 36376: Display library limitations alert in patron's messages

Bug 31422 added a warning message when library limitations issue in patron edition page.
We should add this patron's messages in circ and details pages.
Like age limitations.

Test plan:
1) User's login branch and home library is: Centerville
2) Patron category "B - Board" is limited to Franklin
3) Edit a patron with Board category from Centerville
4) A message appears "The patron's current category (Board) is limited to other libraries."

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 841dc00ec89dd35cef09890c2f0101f014cc7f92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ebd8a50e6e48b2e31730fb961dba15f8a0491a7e)

5 weeks agoBug 36461: Advanced editor should disable RequireJS timeout with waitSeconds: 0
Phil Ringnalda [Thu, 28 Mar 2024 22:02:38 +0000 (15:02 -0700)]
Bug 36461: Advanced editor should disable RequireJS timeout with waitSeconds: 0

We aren't actually doing any error handling with the RequireJS waitSeconds
config, just leaving the advanced editor hanging on loading if it times out,
so instead we should disable it.

Test plan:

1. Set the preference EnableAdvancedCatalogingEditor to Enable
2. Load the Cataloging module home page in Firefox and open Firefox's
   Web Developer Tools, and in the Network tab change from "No Throttling"
   to "Regular 2G"
3. In the Cataloging page, click Advanced editor, and watch it attempt to
   load for 30 seconds, followed by a setTimout error in the devtools console,
   and then wait as long as you can stand for anything but the "Loading,
   please wait..." to happen in the web page. Nothing ever will.
4. Apply the patch, restart, set EnableAdvancedCatalogingEditor back to
   Enable, turn throttling on, load the Advanced editor again, and note that
   even though it will take a minute or more to load through the throttling,
   the editor does actually load.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 95394217f081a38c3fe66f21d673aa056c83414b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c305b468218bee1ece2e396762d2360ed628d71c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36421: Make sure pre-controller errors are correctly logged
Tomas Cohen Arazi [Wed, 27 Mar 2024 12:29:31 +0000 (12:29 +0000)]
Bug 36421: Make sure pre-controller errors are correctly logged

If something explodes in Koha::REST::V1::Auth chances are that no logging will happen.

This patch makes sure they are!

To test:
1. Make sure you do NOT have 36420 on your tree
2. Make sure you are looking at the logs:
   $ ktd --shell
  k$ koha-plack --restart kohadev; tail -f /var/log/koha/kohadev/*.log
3. Use Postman or similar for hitting some known endpoint. Use
   the user's cardnumber instead of the userid. On a default KTD launch, the
   generated user's cardnumber is '42'.
   GET /patrons
=> FAIL: You get a 500 error (expected, fixed on 36420) but no useful logging found.
4. Apply this patch
5. Ctrl+c on the logs and re-run the command
6. Repeat 3
=> SUCCESS: You get a 500, but you also get the exception information logged!
7. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[OK] prove t/db_dependent/api/v1/items.t t/db_dependent/api/v1/unhandled_exceptions.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e518e0be2c97782997037383223e57ce2e196df4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0705360fc8dd81f1c09e92859a200bb28c10c643)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36227: Remove item group option if there are no items
Lucas Gass [Wed, 6 Mar 2024 00:32:03 +0000 (00:32 +0000)]
Bug 36227: Remove item group option if there are no items

To test:
1. Test from OPAC. Any item group without items in it should not display as an option in the "Request specific item group:" dropdown

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3ed4e096b017a539a3b9afdb913f9d61fb43a0f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 81089c1f249d9b6febe1c884e1a8652b7fa864ce)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36227: Add warning when item group has no holdable items
Lucas Gass [Wed, 6 Mar 2024 00:02:31 +0000 (00:02 +0000)]
Bug 36227: Add warning when item group has no holdable items

To test:
1. Enable EnableItemGroups and EnableItemGroupHolds
2. Find a bib and add an item group but do not attach any items to the item group.
3. Place a hold from the staff interface.
4. Under  Hold next available item from an item group you see the option for your item group, select it and place the hold.
5. It's a hold that can not be filled
6. APPLY PATCH
7. How on the hold page under  Hold next available item from an item group there is a 3rd column called 'Holdable items'.
8. Your item group, without any items, should have a disabled radio button and a warning "No holdable items in this item group."
9. Add items to your item group.
10. Now on the hold page in the new 'Holdable items' you should see links for each item, make sure those links work.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 29873200dfdb0ca0956095674dab440e1ff36d0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e3318be45811fa8914c4dcc15e4b9cfdc92dc950)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36347: Avoid return claims table being loaded twice
Julian Maurice [Mon, 18 Mar 2024 15:07:02 +0000 (16:07 +0100)]
Bug 36347: Avoid return claims table being loaded twice

The issue is caused by these lines in circulation.js:

$("#finesholdsissues a[data-toggle='tab']").on("shown.bs.tab", function(e){
    $(this).click();
});

When the user clicks on a hidden tab, 'shown.bs.tab' is triggered and
then another click event is triggered. And because the table was loaded
on tab click, it was loaded twice.
Visually it could have caused the rows to be duplicated (it was random,
probably due to timing, network latency, ...)

I don't know why we need to trigger a click in this case, but removing
this will probably break something else, so the fix here is to load the
table on 'shown.bs.tab' event instead of 'click'

This patch also contains a small fix in refreshReturnClaimsTable which
was reloading the table right after the table initialization.

Test plan:
1. Check out an item, and in the checkouts table, click "Claim returned"
2. Open the network tab of your browser's developer tools
3. Click on the "Claims" tab, verify that only one call is made to
   svc/return_claims
4. Verify that the claims table is displayed correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5783d01af00a5bf21527c81a05252d99a2a14e9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4183ec10c0ecab8f9c6d0bf1f2360cef3be30ff7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36392: (bug 34219 follow-up) Fix getAll for vendors - ERM
Jonathan Druart [Fri, 22 Mar 2024 07:41:33 +0000 (08:41 +0100)]
Bug 36392: (bug 34219 follow-up) Fix getAll for vendors - ERM

In commit f1078daf8f496e1b4234acf766578c511ca8aad1
   Bug 34219: Allow getAll to receive additional URL parameters

We needed to call getAll instead of get to fetch all the vendors

Test plan:
Have more than 20 vendors and create/edit an agreement.
Notice that the vendor list contains all the vendors

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 17b134fcb982768541b66f327ba301e06a727337)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f353bd8d969800c0320b13510fce27d0583d9fab)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 34663: Errors in UNIMARC default framework
Caroline Cyr La Rose [Wed, 21 Feb 2024 20:02:17 +0000 (15:02 -0500)]
Bug 34663: Errors in UNIMARC default framework

This patch corrects the default UNIMARC bibliographic framework to
place all the 4XX subfields in tab 4.

To test:
1. Go to Administration > MARC Bibliographic framework test
   --> There should be errors indicating subfields from 4XX fields
       are in tabs 3 and 4
2. Apply patch and reset_all
3. Redo step 1
   --> It should now say that all subfields for each tag are in the
       same tab (or ignored)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 49a7950f38729c54196fbb839a170ce1f958ae6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 676d285a20274d82400fb6a988acf2051c4ff1f9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 36371: Check if patron attribute is defined in circ-menu.inc
Brendan Lawlor [Fri, 22 Mar 2024 17:25:20 +0000 (17:25 +0000)]
Bug 36371: Check if patron attribute is defined in circ-menu.inc

This patch changes the conditional that determines if a patron attribute is displayed in the patron brief info. Instead of checking the value of the attribute we should check if the attribute is defined.

To test:
1. Create a patron attribute, eg. party_mode, check 'display in patron's brief info' and tie to the YES_NO authorised value.
2. Find a patron and set your attribute to Yes
3. Confirm you see the attribute and its value both in the "Additional attributes and identifiers" section of the patron detail page and in the patron brief info area
4. Set your attribute to No
5. Confirm you see the attribute and its value in "Additional attributes and identifiers" but it no longer shows in the brief info
6. Apply patch and restart_all
7. Notice that your attribute now displays in the brief info, such as Party mode: No
8. Set the attribute to the first empty option
9. Check the patron record brief info to confirm that the attribute does not display when the value is empty.

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 93d3b0b0f75e1d7377ea31c72118ea1376f67b96)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7be415b656b5cbc29fda66ed6336b9d853ffebb8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 30554: Embelished MARC21 XSLT example
Martin Renvoize [Fri, 26 Jan 2024 12:44:21 +0000 (12:44 +0000)]
Bug 30554: Embelished MARC21 XSLT example

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2ad4c93cdcfb5605bee4165b7d6037f8587c7d7c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd6acc43a0c3dc2dc6ad5de4d300a4fbf92cb1d2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 30554: Use XSLT (if enabled) in authority search cataloguing plugin
jeremy breuillard [Fri, 15 Apr 2022 14:51:14 +0000 (16:51 +0200)]
Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin

Test plan:
1. Set AuthorityXSLTResultsDisplay to a valid XSL file (see bug 30554
   attachments, there is an example XSL file)
2. Go to the bibliographic record editor (edit an existing one or create
   a new one)
3. Find a field linked to authorities and open the plugin
4. Start a search and verify that the results are displayed using the
   XSLT output (if using the example file it should be a link saying
   "Authority #<authid>")

Sponsored-by: Écoles nationales supérieure d'architecture (ENSA)
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@bsz-bw.de>
(cherry picked from commit 01e2a6d983c272120ec0579536e23eed2b046a62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b63d96612bc391dde655cda8dd7c533501a65f18)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35621: Map ÿ to y for searching (Non-ICU)
Nick Clemens [Wed, 20 Dec 2023 19:06:57 +0000 (19:06 +0000)]
Bug 35621: Map ÿ to y for searching (Non-ICU)

To test:
1 - Find or add a record with title: Chevilly-Larue, L'Haÿ-les-Roses, Fresnes, Rungis [par] Sté éditions et de publicité L.F.B.
2 - Search for 'L'Hay-les-Roses'
3 - No results
4 - Apply patch, copy the file:
    sudo cp /kohadevbox/koha/etc/zebradb/etc/word-phrase-utf.chr /etc/koha/zebradb/etc/word-phrase-utf.chr
5 - Restart all, Reindex
    restart_all
    sudo koha-rebuild-zebra -v -f kohadev
6 - Search again
7 - Success!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1412f6c65b011ef79f955f75c812e3f7f1a9fce0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 35c3ff27b73acb13695cffb50080512781c31415)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35034: Add parameter that links titles to their records
Laura Escamilla [Tue, 5 Dec 2023 14:57:58 +0000 (14:57 +0000)]
Bug 35034: Add parameter that links titles to their records

To recreate:
1.  Select two items from the catalog and begin a merge.
2. Notice that the title of the items, their biblionumber and a
   hyperlink to their MARC record is available.
3. Apply the patch and refresh the page. The biblionumber for each title
   is now hyperlinked and leads to the item’s bib records.
4. Sign off and have a great day :)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fcbb5fceb8d759eecfbc13b88397c205f3a66eb3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d7bed4435bfad0fcabb5fac4ef377f383ad61eb5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35531: Add context for translating gender option "Other"
Katrin Fischer [Sun, 10 Dec 2023 15:45:28 +0000 (15:45 +0000)]
Bug 35531: Add context for translating gender option "Other"

To test:
* Apply patch
* Verify the option "Other" for gender is correctly displayed when:
  * Editing a patron record in the staff interface
  * Viewing the 'Details' tab of a patron in staff interface
  * Triggering a "duplicate" patron warning and looking at the details
    of the existing patron record
  * Self registering a patron in the OPAC
  * Viewing 'Personal details' tab in the OPAC for a registered patron
* If you are using ktd, run: gulp po:update --lang de-DE
* Verify string "gender" appears with the occurences of "Other"and
  "Other:" in
  misc/translator/Koha-messages.pot

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@bsz-bw.de>
(cherry picked from commit 5f6c0f0c3e896f72c086bfacec1501ee3d72fbe0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c80f0882bdb097cf74a8e6d20274949506d79e3c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35943: Fix group/subgroup filtering of saved reports
Julian Maurice [Tue, 30 Jan 2024 14:13:47 +0000 (15:13 +0100)]
Bug 35943: Fix group/subgroup filtering of saved reports

Use code instead of name for filtering and escape regexp special
characters.

This patch also disables datatables' smart filtering as it is not
recommended to use with regexp filtering

https://datatables.net/reference/api/search()

Test plan:
1. Create a report in a group named "Foo + Bar" and in a subgroup named
   "Baz + Quux"
2. Create other reports in group "Foo + Bar" but in other subgroups, as
   well as in other groups. This is useful to see the effect of
   filtering
3. Go to the saved reports page and verify that navigating between tabs
   have the desired result. Same for the subgroup select

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit de91b2e5d9dbff8c43a5090828397583bd397dc1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit de13938d0af05445d32a8989d2eb7efe939b4658)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
5 weeks agoBug 35768: Show 'Used in' records link for results in cataloguing authority plugin...
Aleisha Amohia [Fri, 5 Mar 2021 01:05:09 +0000 (14:05 +1300)]
Bug 35768: Show 'Used in' records link for results in cataloguing authority plugin search

To test:

1. Edit a biblio record
2. Go to the 100 tab and click the plugin launcher icon for an author
   tag i.e. next to 100$a
3. Search for an authority and observe the results
4. Notice that the number of times this authority has been "Used" in a
   record is now a link, and clicking it does a search showing those
   records.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 553126e5a3fc59c988185a26562ab02fc2c84619)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 60e2c5d5f6a5fb7f8ae1182abff4cd1b70c1b878)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36033: DBRev 23.05.11.001
Lucas Gass [Thu, 23 May 2024 14:47:18 +0000 (14:47 +0000)]
Bug 36033: DBRev 23.05.11.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36033: Add more indexes to table pseudonymized_transactions
Fridolin Somers [Thu, 8 Feb 2024 09:25:12 +0000 (10:25 +0100)]
Bug 36033: Add more indexes to table pseudonymized_transactions

Table pseudonymized_transactions contains :
  KEY `pseudonymized_transactions_ibfk_1` (`categorycode`),
  KEY `pseudonymized_transactions_borrowers_ibfk_2` (`branchcode`),
  KEY `pseudonymized_transactions_borrowers_ibfk_3` (`transaction_branchcode`)

To improve SQL queries performance, it needs more indexes, specially on itemnumber.

Looking at table statistics :
  KEY `timeidx` (`datetime`),
  KEY `branch_idx` (`branch`),
  KEY `type_idx` (`type`),
  KEY `itemnumber_idx` (`itemnumber`),

So index is need on pseudonymized_transactions columns :
itemnumber => For join with table items
transaction_type => For filter on type issue, return ...
datetime => For filter on date, this will help cleanup script

Test plan :
1) Run updatedatabase.pl
2) Check indexes are created in table pseudonymized_transactions
3) Run SQL query :
   describe select * from pseudonymized_transactions join items using(itemnumber)
   where transaction_type='issue' and datetime < date_sub(curdate(), INTERVAL 30 DAY)
=> You see the 3 new indexes used in 'possible_keys'.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0573d01eaa2da7e0b53fd24054e5a3d4e0c2b056)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6ba45bc290685a517e8bc1967910b6744162499f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36321: Problem when dateexpiry in BorrowerUnwantedField
Fridolin Somers [Thu, 14 Mar 2024 15:37:21 +0000 (16:37 +0100)]
Bug 36321: Problem when dateexpiry in BorrowerUnwantedField

hen dateexpiry is in BorrowerUnwantedField it is hidden in patron edition form.
The problem is when editing an existing patron the value is re-computed with category settings, as if it where empty.

This comes from all fields in BorrowerUnwantedField beeing removed from %newdata in memberentry.pl.
Whe must skip dateexpiry.

Test plan :
1) Be sure dateexpiry is not in BorrowerUnwantedField
2) Define a patron category with enrollment period 12 month
3) Create a new patron in this category
4) Its expiration date is in now + 12 month
5) Edit the patron category to set enrollment period 6 month
6) Add dateexpiry in BorrowerUnwantedField
7) Edit the patron and save
=> Without patch the expiration date is changed to now + 6 month
=> With patch the exporation date is unchanged

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Perl-tidied.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 571521ba13eccdd9f309d4d9a2c49c353be86fda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c65b3a38138516e5aabdbe09653ec2828be9d9c4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36708: Fix column index for processing No automatic renewal after
Lucas Gass [Mon, 29 Apr 2024 15:18:26 +0000 (15:18 +0000)]
Bug 36708: Fix column index for processing No automatic renewal after

To test:
1- Find or create a circulation rule with a 'Holds allowed (total)' limit of 3 (or another number) and no value in 'No automatic renewal after (hard limit)'
2- Select to edit the rule, and note that 'No automatic renewal after (hard limit)' box in the editing line is now populated with a date
3- Note also that 'Holds allowed (total)' is empty in your editing line
4- If you save your edits without clearing the new 'No automatic renewal after (hard limit)' date, it will save as part of the rule. Also, 'Holds allowed (total)' will save as Unlimited unless you re-add your numerical value.
5- APPLY PATCH
6- Try again, the values should save corrected and not erroneously fill the No automatic renewal after (hard limit) column.

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e3a04f73a22b46af1a68f221dcaa6db77017d76d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36612: (QA follow-up) Add 'source' to public_read_list
Martin Renvoize [Tue, 7 May 2024 12:07:53 +0000 (13:07 +0100)]
Bug 36612: (QA follow-up) Add 'source' to public_read_list

This patch adds the required 'source' field to the public_read_list for
tickets.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a464e20091e0662bed82bfe308af69c8710614aa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 64ebafd69b154cdd03642c654e9e6c0a23e093cf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36612: Add public_read_list to Koha::Ticket
Martin Renvoize [Tue, 16 Apr 2024 17:22:41 +0000 (18:22 +0100)]
Bug 36612: Add public_read_list to Koha::Ticket

Without the public_read_list to define which fields should be accessible
from the public endpoints we will always return a 500 from the API on
otherwise successfull additions of tickets via the OPAC.

Test plan
1) Enable OPACCatalogConcerns
2) Login to the OPAC and "Report a concern"
3) Note the error message in the UI "There was an error when submitting
   your concern, please contact a librarian."
4) Confirm that the concern is actually created regardless
5) Apply the patch here and restart plack
6) Submit another 'Report a concern' and now note the success message
   "Your concern was successfully submitted."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 834fc10650779c71b6608ab01ef0e54bd9dd4746)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d6cf0250a907def14c55f9582ee170b5fa47ee51)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36612: Unit test for public ticket add
Martin Renvoize [Tue, 16 Apr 2024 17:49:19 +0000 (18:49 +0100)]
Bug 36612: Unit test for public ticket add

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit af0422ccabb21521c8aff14a10a874f100ee1f0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a4ca7a68d38c5a58c2eb6b3971fb700dacd08cea)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36832: (bug 36791 follow-up) Allow authid=0
Emily Lamancusa [Fri, 10 May 2024 18:01:59 +0000 (14:01 -0400)]
Bug 36832: (bug 36791 follow-up) Allow authid=0

To test:
1. Go to the Authorities module and do a Z39.50 search that will return
   results (e.g. a general subject heading)
2. Import an authority record from the results
--> Confirm that the record is imported into the editor
3. Authorities > New, replace it via Z39.50, confirm it's imported
4. Authorities > New, fill the required fields, confirm it saves
5. Edit an existing authority, replace it via Z39.50, confirm it saves
6. Edit an existing authority, replace authid=nn in the URL with a
   number that doesn't exist like 1000000, confirm you get a 404 page

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1aba01adb4ff61c6af77af6b42f13d29d55df4f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aa7bea04c43080e33843b0454140c674d5fef6a2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36791: (QA follow-up) Simplify conditional
Emily Lamancusa [Thu, 9 May 2024 15:26:52 +0000 (11:26 -0400)]
Bug 36791: (QA follow-up) Simplify conditional

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37bda5d1300aa8262917be6f36172348244b7c73)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f666716b3b6860915c7e2dd7afb6cc7b6cd96834)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid
Janusz Kaczmarek [Mon, 6 May 2024 11:44:26 +0000 (11:44 +0000)]
Bug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid

When trying to open the authority editor with authid=<invalid_authid>
(e.g. a deleted authid) Koha explodes with a message:
Can't call method "authtypecode" on an undefined value at
/kohadevbox/koha/authorities/authorities.pl line 556

This this because authtypecode method is called on the result of
->find without verifying that it was succesful.

Test plan:
==========
1. Try to edit an auth rec. giving as a authid (in URL) a non-existing
   authid, e.g. in ktd, with standard ktd test data:
   http://your_ktd:8081/cgi-bin/koha/authorities/authorities.pl?authid=100000
   Koha should explode with the message:
   Can't call method "authtypecode" on an undefined value at
   /kohadevbox/koha/authorities/authorities.pl line 556
2. Apply the patch; restart_all.
3. Repeat p. 1.  You should get the 404 error page.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 18843cabdb1697fda2eb2d9c3c7f96b58f277813)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b9ba92c1537435ee9906f72770680c985083645a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 34972: (QA follow-up) Remove second transfer from Circulation.t
Marcel de Rooy [Fri, 3 May 2024 09:07:17 +0000 (09:07 +0000)]
Bug 34972: (QA follow-up) Remove second transfer from Circulation.t

Removing the manual transfer and rightaway doing the Reserve
transfer. One test description was misleading too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7f22156b8fea3766f893d28fc17ebe8561d5e7cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dce78a0ecd7530fd5f372c3b5d8e92998a983529)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 34972: (QA follow-up) Remove some ModReserveCancelAll imports
Marcel de Rooy [Fri, 3 May 2024 08:07:24 +0000 (08:07 +0000)]
Bug 34972: (QA follow-up) Remove some ModReserveCancelAll imports

Not used? Dont import.
Which actually only leaves circ/waitingreserves.pl as the only
'real' caller.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 87c1759dd789cb2a91bff8e6609847811c05f984)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4d473a1788c4c9b4c5f5228385a3f8e9608bb67f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 34972: Remove GetOtherReserves
Emily Lamancusa [Tue, 19 Mar 2024 18:14:27 +0000 (14:14 -0400)]
Bug 34972: Remove GetOtherReserves

GetOtherReserves attempts to set the waiting/transit status for the next
hold on the list when applicable, but in practice it either leaves the
hold state unchanged, or sets the itemnumber without setting the found
status (erroneously converting bib-level holds to item-level holds).

The latter situation only occurs when the user has been prompted to
confirm, cancel, or revert the hold, and is able to ignore the prompt.
In those situations, the hold's state should not change.

GetOtherReserves does not need to change the hold state, and it does not
do so correctly. Besides that, it does not do much other than call
CheckReserves, and is only used in 3 places.

This patch removes GetOtherReserves, and refactors returns.pl and
C4::Reserves::ModReserveCancelAll to call CheckReserves directly instead.

To test:
1. Place 2 bib-level holds for 2 different patrons (Patron A and Patron
    B) on the same record, both for pickup at the logged-in library
2. Check in an item from that record to fill Patron A's hold
3. Set the hold's expiration date to yesterday by accessing the database
    in the command line:
    - In a ktd shell prompt, open the db client with koha-mysql kohadev
    - UPDATE reserves
        SET expirationdate = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
        WHERE borrowernumber = <Patron A's borrowernumber>
4. Go to Circulation > Holds Awaiting Pickup, and find the hold in the
    "holds waiting past their expiration date" tab
5. Click the "Cancel hold" button in the Actions column next to the hold
   (do not check in the book)
6. Return to the bib record and look at Patron B's hold
--> Note that Patron B's hold is now an item-level hold and does not
    have a waiting status

7. Cancel Patron B's hold
8. Place 2 new holds on the record: one for Patron A at the logged-in
    library, and one for Patron B at a different library
9. Check in an item to fill Patron A's hold
10. Repeat steps 3-5 to expire and cancel Patron A's hold
11. Return to the Holds tab of the bib record and look at Patron B's hold
--> Note that Patron B's hold is now an item-level hold, and there is no
    "Revert transit status" button

12. Place 2 bib-level holds for 2 different patrons (Patron A and Patron
    B) on the same record, both for pickup at the logged-in library
13. Check in an item from that record to fill Patron A's hold
14. Check in the same item again. A modal will pop up, saying that the
    hold is already waiting
15. In the modal, choose a cancellation reason and click "Cancel hold"
--> A new modal will pop up to fill Patron B's hold
16. Click "Ignore" on the modal for Patron B's hold
17. Return to the bib record and look at Patron B's hold
--> Note that Patron B's hold is now an item-level hold and does not
    have a waiting status

18. Apply patch
19. Repeat steps 1-6
--> Note that Patron B's hold is still a bib-level/"next available" hold
20. Repeat steps 7-11
--> Note that Patron B's hold is still a bib-level/"next available" hold
21. Repeat steps 12-17
--> Note that Patron B's hold is still a bib-level/"next available" hold

Make sure correct behavior is unchanged:

22. Cancel Patron B's hold
23. Place 2 new holds on the record: one for Patron A at the logged-in
    library, and one for Patron B at a different library
24. Check in an item from that record to fill Patron A's hold
25. Check in the same item again. A modal will pop up, saying that the
    hold is already waiting
26. In the modal, choose a cancellation reason and click "Cancel hold"
--> A new modal will pop up to fill Patron B's hold
27. Click "Print slip, transfer, and confirm" on the modal for Patron B's hold
--> Confirm that the information on the slip is correct
--> Confirm that the hold is correctly put in transit

22. Set HoldsAutoFill and HoldsAutoFillPrintSlip to "Do"

23. Place a bib-level hold for the logged-in library
24. Check in an item from that bib
--> Confirm the information on the slip is correct
--> Confirm the hold is correctly assigned and set to waiting
25. Place a bib-level hold for a different library
26. Check in an item from that bib
--> Confirm the information on the slip is correct
--> Confirm the hold is correctly put in transit
27. Change the logged-in branch to match the hold pickup location
28. Check the item in
--> Confirm the information on the slip is correct
--> Confirm the hold is correctly assigned and set to waiting

29. Repeat steps 22-26
--> Confirm a correct hold slip pops up for Patron B's hold
--> Confirm that Patron B's hold is correctly put in transit
30. Cancel Patron B's hold
31. Place 2 bib-level holds for 2 different patrons (Patron A and Patron
    B) on the same record, both for pickup at the logged-in library
33. Repeat steps 24-26
--> Confirm a correct hold slip pops up for Patron B's hold
--> Confirm Patron B's hold is correctly set to Waiting

34. Prove t/db_dependent/Circulation.t
35. Prove t/db_dependent/Koha/Holds.t
--> Tests pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dc00e55a322c2c5279e4c42d516125d4e98cff4e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 18884add71c7e80ba163dd0c37c3b74782c79dbe)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 34972: Add tests for ModReservesCancelAll
Emily Lamancusa [Wed, 3 Apr 2024 20:24:38 +0000 (16:24 -0400)]
Bug 34972: Add tests for ModReservesCancelAll

To test:
1. Apply this patch only
2. prove t/db_dependent/Koha/Holds.t
--> Tests pass
3. Apply the other patch
4. prove t/db_dependent/Koha/Holds.test
--> Tests still pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d71f5272021b54849e5854d3a7b8ecb1f30d9414)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4661a1660f2a72393fc75ba83bb7b223e42b078)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36508: Refresh patron object when updating category
Nick Clemens [Wed, 3 Apr 2024 20:35:46 +0000 (20:35 +0000)]
Bug 36508: Refresh patron object when updating category

To test:
1 - Find a ptron, I sued #45 in KTD, note their category
2 - Update them from one category to another using finesunder:
    perl misc/cronjobs/update_patrons_category.pl -f ST -t S --finesunder=5.00 --where "me.borrowernumber=45" -v -c
3 - Check their modification log (I told you to enabled BorrowersLog,
    right?)
4 - See many fields reported changed
5 - Apply patch
6 - Repeat, but change the to and from options
    perl misc/cronjobs/update_patrons_category.pl -f S -t ST --finesunder=5.00 --where "me.borrowernumber=45" -v -c
7 - Note only one column changed in the logs
8 - Ask for unit tests

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cae2efd69d8ad63822914377733f9819889a0ec1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2ff0a6578311f029def133446c99a7c7576b8ae0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36508: Unit tests
Nick Clemens [Thu, 25 Apr 2024 16:20:53 +0000 (16:20 +0000)]
Bug 36508: Unit tests

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8f359aa72c46eaa493e817d4d099b6548846edf0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9659b8cddf28ce3f45d0316fa86bcf8aecc1c16e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36563: Turn into array only if required
Pedro Amorim [Thu, 11 Apr 2024 10:40:16 +0000 (10:40 +0000)]
Bug 36563: Turn into array only if required

Test plan, apply first patch:
1- Visit item search:
   http://localhost:8081/cgi-bin/koha/catalogue/itemsearch.pl
2- Set "Home library" -> "is not" -> "Centerville". Notice you get items
   from Centerville.
3- Apply second patch, repeat step 2, notice you now don't get items
   from Centervile.
4- Test other use cases, like 'is' and 'is not' for multiple choices

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eae74ed6d9935ee7247ccd85f9a1d502755ca338)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0513ffa58e512d149a44a9d4bd4750d182816e48)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36563: Dirty fix
Jonathan Druart [Wed, 10 Apr 2024 10:04:18 +0000 (12:04 +0200)]
Bug 36563: Dirty fix

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 492d7be2ccba07f47771184fd5cc903383abb63b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d8ca12b404da1833ed7c8ae51ab69af6086705a6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36313: Fix Undefined subroutine &C4::Circulation::CheckReserves error
Emmi Takkinen [Thu, 11 Apr 2024 10:12:58 +0000 (13:12 +0300)]
Bug 36313: Fix Undefined subroutine &C4::Circulation::CheckReserves error

On (at least) git installations of Koha checkouts and checkins fail on
error 500. Logs have following error:

Undefined subroutine &C4::Circulation::CheckReserves called...

Error happens also when one tries to open patrons checkouts from detail page.
Koha doesn't die but table just keeps loading. Solution is to add C4::Reserves
before CheckReserves when it's called from Circulation.pm.

To test:
1. Apply this patch.
2. Try to check out and check in item.
=> Confirm both operations are succesfull.
3. Attempt to open patrons checkouts from patron detail and checkout page.
=> Table should load

Also prove t/db_dependent/Circulation.t.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: BabaJaga <babajagawgoglach@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 80beaf875b3645034f5dda37bfadf51a038859cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d26306ed328c1be1c59f33515caa699071a4aacc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 33832: Allow updating username without changing password on member-password.pl
Brendan Lawlor [Fri, 12 Apr 2024 15:29:37 +0000 (15:29 +0000)]
Bug 33832: Allow updating username without changing password on member-password.pl

This patch updates the change password page on the staff interface to
allow for changing the patron's username without changing the password.
If the new password is an empty string we can skip setting the patron's
password and sending the new password to the template.

Test plan:
1. From a patron record tool bar click 'Change password'
2. Notice that if you try to change the user's name without also
   changing the password the page just reloads and nothing happens
3. Apply patch and restart_all
4. From the patron record click 'Change password' again
5. Set the user's new username and  password eg. '1234Abc' and click
   'Save'
6. Confirm that you can log in to the OPAC with the user
7. Return to the patron record and click 'Change password' again
8. This time change just the 'New username field' and click 'Save'
6. Notice that the username is updated
7. Confirm you can log into the OPAC with the new username and the
   original password '1234Abcd'
8. Make sure that the change password form still validates passwords
   for length and matching errors etc

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e26fc0a3d5a83a7b22f0c3907a98d470b0e2443d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 34e17b5abad1bac29bc13155cedbe11b7d7fc1ba)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36053: Correct input name for item replacement fields
Nick Clemens [Thu, 8 Feb 2024 20:27:14 +0000 (20:27 +0000)]
Bug 36053: Correct input name for item replacement fields

To test:
1 - Follow test plan and use sample record from bug 35912 ( or similar)
2 - Confirm that when the order is saved the replacement price is $0.00
3 - Apply patch, restart_all
4 - Delete previous orders, and stage and add to basket again
5 - Confirm that upon adding orders to basket the replacement price is saved correctly

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 94da493d0eaaec80e42258ec421eb7c5ca1a0dd2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f53018dce0fa3db1afacb5914e8ee2e57794296d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34886: Comment failing tests
Pedro Amorim [Fri, 9 Feb 2024 09:55:35 +0000 (08:55 -0100)]
Bug 34886: Comment failing tests

These tests highlight the fact that the 'place hold' button visibility in the
search results page **does not** match the 'place hold' button visibility in
the detail page, given the same conditions.
Since that this is a known behavior, these tests should be commented out as they
are failing by design.

prove t/db_dependent/selenium/opac_holds.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f8665c8d55b4526f6f21f3b7b9c80c8e7ca4e624)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit badf7521baee89bbee8e7d23bf2e1ba65c49907a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34886: (QA follow-up) chmod, remove POD
Marcel de Rooy [Fri, 22 Mar 2024 10:23:15 +0000 (10:23 +0000)]
Bug 34886: (QA follow-up) chmod, remove POD

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ae44fd188951d1710b26554f4aa9a492b03a2aa2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f810dc9323b304882b88947f81464522b8ca96d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34886: Add selenium tests
Pedro Amorim [Thu, 1 Feb 2024 15:42:12 +0000 (14:42 -0100)]
Bug 34886: Add selenium tests

Tests added to cover different use cases and combinations of circulation rules values for authenticated and unauthenticated users
At the moment, 2 tests are failing, documented on the [DO NOT PUSH] commit.
These 2 failing tests fail for the search results page but pass on the detail page counterpart. Ideally they should match, for consistency sake.
But this may be the use case "details page should be more correct, results page is always an approximation" mentioned by Nick.

More test combinations may be added in the future.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3758a8c05e05b14360560a3e351439e2c4c0364c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1af004161d6b13ee33becc18b5a79db13a805bfe)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34886: Adjust other opac detail scripts
Nick Clemens [Thu, 28 Sep 2023 13:14:54 +0000 (13:14 +0000)]
Bug 34886: Adjust other opac detail scripts

Same chanegs as before, but for MARC and ISBD details pages

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d134dbf4f11f8ed091c80eeae70d696f741c7376)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 800b012debc38f9e7256b2cd4a49df09cd0701cd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34886: Adjust holdability checks on opac details page
Nick Clemens [Thu, 28 Sep 2023 12:27:21 +0000 (12:27 +0000)]
Bug 34886: Adjust holdability checks on opac details page

This patch tries to simplify some of the logic here to match that on the search results. When we don't have a patron, we fallback to determining if an item can be held buy determining whether there are any items that don't have holds disallowed at the all libraries level. We also remove items with non-holdable statuses like withdrawn etc (and check some system preferences)

If we don't have a patron, then we are done, however, if we do, then we need to check each item against the policies related to that patron.

This patch also removes two checks at the end:
CountItemsIssued($biblionumber)
$biblio->has_items_waiting_or_intransit

These seem to be from bug 4319 - however, those rules are checked by IsAvailableForItemLevelRequest and are only relevant when we have a patron. These checks essentially assumed 'onshelfholds' policy of 'If any unavailable' For consistency sake I think we should follow the same logic as the results page.

To test:
1 - Find a record with two items, of different types, set a 'Default checkout, hold and return policy' of 'No holds allowed'
2 - Search opac, not logged in, and verify neither the results page or details page shows the place hold button
3 - Delete that rule, make both items withdrawn
4 - Search opac, not logged in, and verify neither the results page or details page shows the place hold button
5 - Mark one item as not withdrawn
6 - Search opac, not logged in, and verify both the results page or details page shows the place hold button
7 - Log in to opac
8 - Search opac, logged in, and verify both the results page or details page shows the place hold button
9 - Place an 'On shelf holds policy' rule for that patron category of 'If any unavailable'
10 - Search opac, logged in, and verify the results and details page shows the place hold button
11 - Set the other item to not withdrawn
12 - Search opac, logged in, and verify the results page shows the place hold button, but details does not
13 - Try various other scenarios - details page should be more correct, results page is always an approximation

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d4f520761cead905357892f54fa33a8cb24b827)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6c1d615394d54b0f275a45c23ee0d6a40d34a236)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36036: Fix misnamed location field
Matt Blenkinsop [Thu, 8 Feb 2024 11:11:24 +0000 (11:11 +0000)]
Bug 36036: Fix misnamed location field

This patch fixes a hash reference in the template to allow the location field to display properly

Test plan:
1) In system preferences, click Search and then select the Acquisitions option from the left hand menu
2) Paste the following into MarcFieldsToOrder
price: 975$p
quantity: 975$q
budget_code: 975$h
3) Paste the following into MarcItemFieldsToOrder
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l
Now save the sysprefs
4) Navigate to acquisitions and go into a basket
5) Click Add to basket and select “From a new file”
6) Download the file attached to this bug
7) Import the file and when the job is complete click “Add staged files to basket”
8) Click the checkbox next to the record to display the items
9) Inspect the value for the "loc" field - the value of "AV" from the file has not been selected
10) Apply patch and refresh the page
11) On inspection the value should now be properly selected

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c1cd6a980a7c6f862cb678aa81533b1fadc60afb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ea15bde9b21c603187f8e90867029ee74bdc4d31)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36035: Wrong text colour in addorderiso2709.pl
Owen Leonard [Thu, 8 Feb 2024 13:57:30 +0000 (13:57 +0000)]
Bug 36035: Wrong text colour in addorderiso2709.pl

This patch updates the "Order staged MARC records" page so that the
class which is added upon selection is more unique to avoid a collision
with some default DataTables styles. These classes are used in
JavaScript selectors, not for visual style.

The patch also adds some custom CSS variables to global.scss to override
the defaults for the DataTables "selected" style, in case this issue
crops up again.

To test, apply the patch and rebuild the staff interface CSS. Follow the
test plan from the bug report:

1) In system preferences, click Search and then select the Acquisitions
   option from the left hand menu
2) Paste the following into MarcFieldsToOrder

price: 975$p
quantity: 975$q
budget_code: 975$h

3) Paste the following into MarcItemFieldsToOrder

homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l

4) Save the sysprefs
5) Navigate to acquisitions and go into a basket
6) Click "Add to basket" and select "From a new file"
7) Download the file attached to this bug
8) Import the file and when the job is complete click "Add staged files
   to basket"
9) Click the checkbox next to the record to display the items.
   - The expanded form should look correct.
10) Add one or more items to the order and confirm that submitting the
    form works correctly.

To test the new default "selected" DataTables style, view a page with a
DataTable, e.g. Administration -> Libraries.

- Right-click on one of the table rows and choose "Inspect"
- Click the table row element, e.g. '<tr class="odd">'
- Double-click the class name and replace it with "selected."
- The row you inspected should now have a pale green background and text
  colors should remain the same.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 27a651388dacc6faedef2c7463cfb580f0a79bbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d56f9f201704fb6dff92439b518ec6df345da050)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36331: (follow-up) Ignore non_priority holds when checking renewability
Nick Clemens [Fri, 22 Mar 2024 13:54:03 +0000 (13:54 +0000)]
Bug 36331: (follow-up) Ignore non_priority holds when checking renewability

When changing the fetch of holds, the check for non-priority was lost - added a loop to pull those out
so the totals and checks are correct

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tidied (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b7ad3364cbf8778507f7d0dbd2a0199cbe7c0cdd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f4add4c039f30a69bedb75088d9eb5081db29f2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36331: Don't check reserves that an item cannot fill when checking if it can...
Nick Clemens [Fri, 15 Mar 2024 13:45:58 +0000 (13:45 +0000)]
Bug 36331: Don't check reserves that an item cannot fill when checking if it can be renewed

Before this patch we get all holds on a record and see if we can fill them with available items.
This means we check to fill holds that the item in questoion may not be able to fill, especially
in the case where no holds are allowed on the item type, this is wrong

To test:
1 - Find or create a biblio with two items of different item types
2 - Make sure one item type allows holds, and the other has:
    "Default holds policy by item type"
    Set to "No holds allowed"
3 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Don't allow"
4 - Check out the unholdable item to a patron
5 - Set a hold for a different patron on the next available item
6 - Confirm the checked out item can be renewed (don't renew, just view the checkouts page)
7 - Checkout the other item to a third patron
8 - Confirm the first item can still be renewed
9 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Allow"
10 - Confirm the item cannot be renewed now
11 - Apply patch, restart all
12 - Confirm the item can be renewed
13 - Set the item type to a type that allows holds
14 - Confirm the item can no longer be renewed
15 - Restore the item type
16 - Set system preference "AllowRenewalIfOtherItemsAvailable" to "Don't allow"
17 - Confirm the item can be renewed
18 - Check in the item from the third patron
19 - Confirm the item can still be renewed
20 - prove -v t/db_dependent/Circulation.t - test still pass

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9cc622be1fb267efe5202f24450f9c5acee77fd2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ee235cd8d4398ef7239db41737845eabca7363db)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35388: Add comment to 'Transfers to send'
Marcel de Rooy [Thu, 23 Nov 2023 09:00:59 +0000 (09:00 +0000)]
Bug 35388: Add comment to 'Transfers to send'

Test plan:
Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c6fa96eecae4a0f0de95977d8cf032cb9ee941bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1e3d845b5193a66cb04133adab2ce3e74a7d353c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36329: (follow-up) Fix error message comparisson in testes
Tomas Cohen Arazi [Tue, 19 Mar 2024 15:11:54 +0000 (12:11 -0300)]
Bug 36329: (follow-up) Fix error message comparisson in testes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5f7a9db93672c14efdba861373c2d330b8aee6c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f805c221cf9fe138735f25568704d16cae2a97c7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36329: Make POST /transfer_limits/batch honor BranchTransferLimitsType
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:56:22 +0000 (09:56 -0300)]
Bug 36329: Make POST /transfer_limits/batch honor BranchTransferLimitsType

This patch adds tests for the different cases of `BranchTransferLimitsType`.
It also adds tests for the situation of the consumer sending both limit
criterias on the request.

The controller gets adjusted for this new behavior and the spec gets
documentation added about this.

Bonus: tests are added the right guidelines code, and
BranchTransferLimitsType gets mocked to avoid failures due to existing
data.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ qa
=> SUCCESS: All green, and tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Fixed a typo in one of the return messages

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e846641eddb98d63f2fb9b78b7fe5fce00cd8569)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f39baa0b9814a7a90c1819291284fcbe4027b2c5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36329: Miscelaneous spec fixes
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:55:34 +0000 (09:55 -0300)]
Bug 36329: Miscelaneous spec fixes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9760f066dd3488fe166015959aa8b526bb98daa6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bdeabccf3d1e9dd2edd05c4a5f82cb801382e4a6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36329: Add missing return codes
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:18:32 +0000 (09:18 -0300)]
Bug 36329: Add missing return codes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 506087bc1541c94b46a4f8b405b8b1c131d526b9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d45ed60db448789a7e165049ec2c1367b4967a00)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36356: Fix rollback from FrameworkPlugin.t
Jonathan Druart [Tue, 19 Mar 2024 08:16:52 +0000 (09:16 +0100)]
Bug 36356: Fix rollback from FrameworkPlugin.t

rollback ineffective with AutoCommit enabled at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1651.

I have not investigated more than that. Reaching this was already the
end of a long road... (see comment 0)

Test plan:
0. Do not apply this patch
1. select count(*) from branches
Note the value
2. Run
  prove t/db_dependent/FrameworkPlugin.t
=> There is a warning
3. Repeat 1.
=> There are too many libraries!
4. Apply the patch, retry 1, 2, 3
=> No warning, no library added by the tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1d2165f84106cc27b804ac4c347817d25d1403aa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 789648aa4cf25d2a94f40ec370c8a4132a9fed13)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35921: Improve perfs of acqui-home.pl when there are many budgets
Julian Maurice [Thu, 25 Jan 2024 15:49:32 +0000 (16:49 +0100)]
Bug 35921: Improve perfs of acqui-home.pl when there are many budgets

When there are a lot of budgets with the same owner, most of the time of
acqui-home.pl is spent loading the same patron over and over.

This patch makes sure each borrower is loaded only once.

Test plan:
0. Do not apply the patch yet
1. Create a thousand budgets with the following command (make sure the
   budget_owner_id is an existing borrowernumber):
       perl -MKoha::Database -e '
           my $schema = Koha::Database->schema;
           my $period = $schema->resultset("Aqbudgetperiod")->create({
               budget_period_startdate => "2000-01-01",
               budget_period_enddate => "2999-12-31"
           });
           $schema->resultset("Aqbudget")->create({
               budget_owner_id => 1,
               budget_period_id => $period->id
           }) for (1..1000)
       '
2. Measure the time it takes to load acqui/acqui-home.pl (do it several
   times and keep the average time)
3. Apply the patch
4. Repeat step 2

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 24b33936a526187e17719294e236f186aec46d50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b37e510eb8c2b280a69dfb60c427c60d1d53b041)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 weeks agoUpdate release notes for 23.05.11 release v23.05.11
Lucas Gass [Tue, 7 May 2024 16:51:19 +0000 (16:51 +0000)]
Update release notes for 23.05.11 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
8 weeks agoIncrement version for 23.05.11 release
Lucas Gass [Tue, 7 May 2024 16:33:07 +0000 (16:33 +0000)]
Increment version for 23.05.11 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 36149: Add userenv middleware to app.psgi
Julian Maurice [Tue, 9 Apr 2024 12:45:39 +0000 (14:45 +0200)]
Bug 36149: Add userenv middleware to app.psgi

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5cca1bdcd67a1a8fc8b0bb2aa6c666cccdb49fbb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 57b1c90e19e913e86e66fb1aa295950cba91985f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 36149: (follow-up) POD and tidy
Nick Clemens [Fri, 29 Mar 2024 18:09:30 +0000 (18:09 +0000)]
Bug 36149: (follow-up) POD and tidy

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 31943a5781aaaa9803ca87247eb7a663fb999fc5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0534259c2cbdbb9d6e0ad56535d0c000eea3a629)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 36149: Unset userenv from middleware
Jonathan Druart [Fri, 8 Mar 2024 15:06:11 +0000 (16:06 +0100)]
Bug 36149: Unset userenv from middleware

The userenv (logged in user's info) are stored in
$C4::Context->context->{activeuser}, which persists in plack worker's
memory.
It's really bad in theory as we are not cleaning it before or after the
HTTP request, but only when set_userenv is called (what we are doing
commonly in C4::Auth::get_template_and_user).
If C4::Context->userenv is called before set_userenv we should get undef,
not the userenv from the previous request!
In practice this should not be a problem, but well... who really knows?

This patch suggests to have a middleware to deal with removing the
userenv at the beginning of each request (maybe it should be after, right? - FIXME).

To test:
1 - Edit /etc/koha/sites/kohadev/koha-conf.xml to set <plack_workers>1</plack_workers>
2 - Edit about.pl  and add a line after: CGI->new:
    warn Data::Dumper::Dumper( C4::Cointext->userenv() );
3 - tail -f /var/log/koha/kohadev/*.log
4 - View about.pl in staff interface, should get a "somethign's wrong" warning
5 - Reload, you get current user info
6 - Open an incognito tab, sign in as a different user and click some stuff
7 - Reload about.pl in other window
8 - You get the opac user info
9 - Apply patch
10 - Edit /etc/koha/sites/kohadev/plack.psgi and add the middleware after "RealIP":
     enable "+Koha::Middleware::UserEnv";
11 - Restart all
12 - Reload about.pl - you get a "Something's wrong" warning
13 - Click things in opac on incognito window
14 - Reload about.pl  - only "Something's wrong" - you no longer see any user info

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 576e7e09fdca703f76c0d10ae55eebf12ee1fdf4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3dd1cdd74ff004d1d218366a377fc91d8ae4e21d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 19613: Use the 'note' profile
Jonathan Druart [Wed, 20 Mar 2024 07:35:29 +0000 (08:35 +0100)]
Bug 19613: Use the 'note' profile

WNC amended patch: tidied

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3cb586b72165bcbd029948f46407359be9d5e9a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 55931114b62557dfbbe01e7bcf0cd150b5733262)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 19613: Scrub borrowers fields: borrowernotes opacnote
Jonathan Druart [Fri, 15 Mar 2024 10:37:43 +0000 (11:37 +0100)]
Bug 19613: Scrub borrowers fields: borrowernotes opacnote

To prevent XSS

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 83db8696ca7a83aba224a0ab645f03447a96887b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 383984a0164adabc79e91ad11e2e930f5e070ed9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences
Nick Clemens [Mon, 1 Apr 2024 16:03:37 +0000 (16:03 +0000)]
Bug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences

Also tidy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 42d388c80fcdd98c2594ad7b111b8e40c991388a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e413db6083e57ec127d59a2e3be100fd06ee8e94)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 36328: Add a separate 'note' profile
Jonathan Druart [Wed, 20 Mar 2024 07:34:09 +0000 (08:34 +0100)]
Bug 36328: Add a separate 'note' profile

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7a626d8d870039330889d6e48c3ae5ba848d85e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fb1c48da9a06ff30f8aa5bafb1bf1d95cfd58ea2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 36328: Add test
Jonathan Druart [Fri, 15 Mar 2024 10:40:57 +0000 (11:40 +0100)]
Bug 36328: Add test

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b315c0f2630ccd738fc811e13d1e95b11d3c8df1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 11ea420b54ee8ec791b3f6d688a7366acccb42fa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>