Commit Graph

56659 Commits

Author SHA1 Message Date
Jonathan Druart e153b9654d
Bug 40003: Remove warning from log when creating a new bib record
Test plan:
Hit cataloguing/addbiblio.pl?frameworkcode=FA

Without this patch you get warnings in the Koha log file:
Use of uninitialized value in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 572.
Use of uninitialized value in substitution (s///) at /kohadevbox/koha/Koha/UI/Form/Builder/Biblio.pm line 55.

with this patch applied: no warning

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0ba11f98f9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fd6552957e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:00:00 +02:00
Jonathan Druart 2e206ae962
Bug 40021: Remove warnings from Koha/Plugins/Recall_hooks.t
Test plan:
  prove t/db_dependent/Koha/Plugins/Recall_hooks.t
should return green

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit db655799ad)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 21ffc157f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 13:56:28 +02:00
Jonathan Druart dde04318db
Bug 40018: Remove warnings from Koha/Template/Plugin/Koha.t
Because we still use CGI::Session (bug 17427), we need to mock
CGI::Session to remove those 2 warnings
rollback ineffective with AutoCommit enabled

Test plan:
Run the tests after this patch, it should be green

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eaaabf66dd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 2af2c4f6f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 13:54:04 +02:00
Jonathan Druart 3acd250aae
Bug 40019: Remove warnings from Koha/Auth/Client.t
Test plan:
  prove t/db_dependent/Koha/Auth/Client.t
should return green

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c695e6ce4c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ca2ff9b46b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 13:49:55 +02:00
Jonathan Druart ace94e2008
Bug 40020: Remove warnings from Koha/AdditionalContents.t
Test plan:
  prove t/db_dependent/Koha/AdditionalContents.t
should return green

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 827ad21244)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ef3ee7d69c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 13:49:01 +02:00
Paul Derscheid aa5539f1d9
Update release notes for 24.11.07 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-24 22:37:36 +02:00
Paul Derscheid 1841c31f6a
Increment version for 24.11.07 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-24 22:13:30 +02:00
Tomas Cohen Arazi 233fb89c72
Bug 40034: Only check notforloan on itemtype if it exists
This patch makes the code in `CheckReserves` survive the non-existence
of the referenced item type in the `items` table for the passed item.

To test:
1. Apply the regression tests
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Reserves.t
=> FAIL: Tests explode like this:

```
Can't call method "notforloan" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 870.
```

3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 854783c836)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3284f58e95)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:58:38 +00:00
Tomas Cohen Arazi 6536f71bdb
Bug 40034: Regression tests
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6c26ce01d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7cc3b371fe)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:53:27 +00:00
Fridolin Somers 3ced40efe7
Bug 40042: Add default value 0 for index var in search_indexes.inc
In koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc some calls do not set 'index' var generating idx="idx_".
Set 0 has default value.

Test plan :
1) Enable system preference 'IntranetCatalogSearchPulldown'
2) Go to catalogue advanced search
3) Look HTML source and check you see:
     <select class="advsearch" name="idx" id="idx_0">
     <select class="advsearch" name="idx" id="idx_1">
     <select class="advsearch" name="idx" id="idx_2">
4) In page page toolbar, click 'Search catalog'
5) Click on 'More options' icon
6) Look HTML source of this part and check you see:
      <select class="advsearch" name="idx" id="idx_0">
Without patch you see:
      <select class="advsearch" name="idx" id="idx_">

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0d39336f71)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit eb9da8a8d6)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:49:03 +00:00
Owen Leonard ffe35288ce
Bug 40061: (follow-up) Delete last image using checkbox
This followup corrects a problem in image deletion which isn't really
the same issue (it's not CSRF related) but is another problem with
deletion. The JS for grabbing all the checkboxes by name wasn't working
when there is only one checkbox.

To test, apply the patch and delete all but one image from the patron
card creator image manager.

- Check the checkbox for the last image and click the "Delete selected"
  button.
- The image should be deleted successfully.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 727b9d2dde)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d99a9e28b6)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:33:11 +00:00
Owen Leonard 2a76813844
Bug 40061: Add CSRF protection to patron image deletion
The patron image deletion operation was not fully updated in Bug 34478.
The individual "Delete" buttons in the table of images need to be
updated to use form-submit.js

Unrelated: I removed an invalid "align" attribute from a <td>.

To test, apply the patch and go to Tools -> Patron card creator -> Image
manager.

- Upload multiple images
- Test the individual "Delete" buttons in the table of images.
  - Test that both the "OK" and "Cancel" operations work correctly.
- Test the process of checking one or more checkboxes and clicking the
  "Delete selected" button.
   - Test that both the "OK" and "Cancel" operations work correctly.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f3bfcfa66)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4862281a98)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:29:16 +00:00
Pedro Amorim 01058ed502
Bug 40057: Fix db revision
Test plan (ktd):
1) reset_all
2) Run first part of the 241200017.pl atomicupdate manually
	koha-mysql kohadev
	ALTER TABLE illrequests DROP FOREIGN KEY illrequests_bnfk;
3) Create an ILL request linked to a borrower that doesn't exist (simulate old data):
	INSERT INTO illrequests (`backend`, `borrowernumber`,`branchcode` ) VALUES ('Standard', '99999', 'CPL');
4) Run the 2nd part of the atomicupdate manually:
   ALTER TABLE illrequests ADD CONSTRAINT illrequests_bnfk FOREIGN KEY(`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE;
5) Notice you get the error:
	ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (., CONSTRAINT  FOREIGN KEY () REFERENCES  () ON DELETE SET NULL ON UPDATE CASCADE)
6) Run the added query in the patch:
	UPDATE illrequests SET borrowernumber = NULL WHERE borrowernumber NOT IN (SELECT borrowernumber FROM borrowers);
7) Repeat step 4)
8) Notice there's no errors

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 94d5c37db8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5eb5d33f2f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:21 +00:00
Katrin Fischer 773b0c8f7e
Bug 32630: DBIC schema update
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 80da7d7809)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:20 +00:00
Katrin Fischer cf321b69d4
Bug 32630: DBRev 24.11.06.001
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e228cd9985)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:19 +00:00
Pedro Amorim 7fba22bb5c
Bug 32630: Add tests
prove t/db_dependent/Koha/ILL/Requests.t

Sponsored-by: UKHSA - UK Health Security Agency
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ed349bad97)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:18 +00:00
Pedro Amorim 174459f938
Bug 32630: Update get_notice
Make it consider the possibility of a patron not existing.
This ensures that placing a request with partners does not error and works as expected even if the ILL request's borrowernumber is undef

To test:
1) Run the test file before and after applying this patch:
prove t/db_dependent/Koha/ILL/Requests.t

To test (ILL request is kept after borrower is deleted):
1) Apply all patches except this one
2) Enable ILLModule and create an ILL request.
3) Add a type, valid cardnumber and library.
4) Delete the associated borrower.
5) Confirm the ILL request is still listed and shown as expected

Continue test, confirm follow-up bug is fixed:
6) Click 'Place request with partners'
7) You get a ERR_TOO_MANY_REDIRECTS error
8) Apply this patch and restart plack. Repeat.
9) Confirm the place request with partners libraries page is shown correctly

Sponsored-by: UKHSA - UK Health Security Agency
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e95ec209c1)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:17 +00:00
Pedro Amorim f80fff3b5e
Bug 32630: Update patron attribute display
Only show this attribute if defined

Sponsored-by: UKHSA - UK Health Security Agency
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a01360a487)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:17 +00:00
Pedro Amorim 7a3cb522fc
Bug 32630: Update send notice to patron button
Only show this action button if the ILL request has a borrowernumber

Sponsored-by: UKHSA - UK Health Security Agency
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c9817ddc1e)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:16 +00:00
Pedro Amorim de24686a1b
Bug 32630: atomicupdate
Sponsored-by: UKHSA - UK Health Security Agency
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a0db55fe56)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:15 +00:00
Pedro Amorim 8f2fbb7706
Bug 32630: database changes
Sponsored-by: UKHSA - UK Health Security Agency
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a69f98a45d)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-07-09 14:18:07 +00:00
Lucas Gass be65b298c6
Bug 39307: Check to make sure there is a document.referrer
To test:
1. Navigate to circ/circulation.pl?borrowernumber=X
2. See the console error `document.referrer.split(...)[1] is undefined`
3. Go to circ home circ/circulation-home.pl and search for a patron
4. See the console error when you select a patron or are taken directly to them
5. APPLY PATCH
5. JS error should be gone in both instances

squash

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit db44d917ef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-30 11:46:07 +02:00
Fridolin Somers f44035ab81
Bug 39626: Use patron-title.inc in pendingreserves.tt
In "Holds to pull" page, patron column should use patron-title.inc like in other pages (like waiting holds).
This allows to use surname first to allow better sorting/finding.

Test plan :
1) Place an hold on some record
2) Go to  Circulation > Holds to pull
3) Check you see in column "First patron" : surname then firstname

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9292b076ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-26 16:39:10 +02:00
Fridolin Somers a277c01b43
Update release notes for 24.11.06 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-25 11:03:16 +02:00
Fridolin Somers de0e421dd9
Increment version for 24.11.06 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-25 10:33:04 +02:00
Lucas Gass d76dce3058 Bug 39331: If patron category cant be guarantee do not continue with add_guarantors
To test:
1 - Remove age limits from a Child and Adult category in Administration->Patron categories. Ensure Child category can be guarantor and Adult cannot
2 - The above step is to avoid any age checks and form resubmission which removes the guarantor fields
3 - Find/create a child patron
4 - Add a guarantee from the Adult category to the child
5 - Check the DB:
   SELECT * FROM borrower_relationships WHERE guarantee_id={borrowernumber of child};
6 - Note the id colum
7 - Edit the child patron to Adult category
8 - Repeat 5
9 - Note the relationship still exists and the id is incremented
10 - Oof!
11 - APPLY PATCH, restart_all
12 - Try again steps 3 - 8
13 - The relationship should not be re-added
14 - Try with more than 1 guarantor on the record, confirming all are deleted
15 - Try adding some guarantor to patron types that should be able to, they relationship should work.
16 - Try changing some patrons to categories that do allow guarantors, making sure the relationship does stay.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4f170fb94d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:41:56 +02:00
Nick Clemens 05d55656a6 Bug 39750: Ignore limits when updating WrongTransfer
This patch ignores limits when updating a wrong transfer to ensure we can return a book
home when checked in at the wrong branch

To test:
1 - Enable  UseBranchTransferLimits based on 'Collection code'
2 - Disable transfers for FIC from:
    CPL -> FFL
    CPL -> IPT
    FFL -> CPL
    FFL -> IPT
    IPT -> CPL
    IPT -> FFL
3 - Set library to IPT
4 - Checkin an FFL item
5 - It generates a transfer home
6 - Set library to CPL
7 - Check the item in
8 - 500 error, and in logs:
    ==> /var/log/koha/kohadev/plack-error.log <==
Exception 'Koha::Exceptions::Item::Transfer::Limit' thrown 'Transfer not allowed'
9 - Apply patch, restart all
10 - Check item in again
11 - Success! Transfer updated

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b16582b963)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:36:35 +02:00
Jonathan Druart 9d60bf411f Bug 39304: Make sure git commands return something
Jenkins is not failing when git command fails.

We edited the config and it broke the git repo:

13:32:35 koha_1       | error: unable to normalize alternate object path: /srv/jenkins/workspace/Koha_Source/.git/objects
13:32:35 koha_1       | fatal: not a tree object
13:32:35 koha_1       | [12:29:31] xt/check_makefile.t

So tests were not running correctly

Maybe it will be a problem for people running the tests without being
inside a git repo, but for now we need to ensure the community CI does
what we think it does.

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 0075ca7356)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:27:18 +02:00
Janusz Kaczmarek ac8168a754 Bug 39462: Unit tests
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 81b6c3cf27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:22:59 +02:00
Janusz Kaczmarek ec094432a4 Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing
Due to changes made by the commit 0472b56a67, when editing an
existing bibliographic record a default value is inserted while it
should not, according to ApplyFrameworkDefaults systempreference.

Test plan:
==========
1. Verify that ApplyFrameworkDefaults systempreference is set to
   ‘when cataloguing new records only’.
2. Take any existing bibliographic record, e.g. sn:1. Open it in
   standard editor and identify a non used (empty) subfield, e.g. 024 $a.
   Note the framework (Books, Booklets, Workbooks). Close the editor
   (Cancel).
3. Modify the framework in question (Books, Booklets, Workbooks) by
   setting a default value for the chosen subfield (e.g. 024 $a).
4. Open the record in the editor again. Note that the 024 $a subfield
   has now an inserted default value while it should not, according to
   the ApplyFrameworkDefaults setting. Do not save the record, chose
   Cancel.
5. Apply the patch ; restart_all.
6. Repeat p. 4 -- there should be no default value inserted in the
   existing record now.

Sponsored-by: Pontificia Università di San Tommaso d'Aquino (Angelicum)
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cfe3421891)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:22:19 +02:00
Adolfo Rodríguez 7fd11b47a1 Bug 38411: Check mandatory item fields when creating several items ordering or receiving.
This patch adds a check of mandatory item fields when adding several items

Test plan:
1 We need mandatory subfields for items in the ACQ framework and an open basket configured to create items on order or a closed basket configured to create items on receiving an order
2 In both cases, in the form to create items check that there are mandatory fields.
3 Click the Add multiple items button, write a number and then add.
4 Check that the items have been added.
5 Apply patch, restart services
6 Repeat step 3 Now it doesn't add the items and shows an alert regarding the empty mandatory fields

Signed-off-by: Laurence <laurence.rault@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1bb962bba7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:18:44 +02:00
Jonathan Druart f84d0bdc2a Bug 38981: Directly use the opac-image link
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 4eececb330)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:08:08 +02:00
Owen Leonard 5bb14ab1d3 Bug 38981: Local cover images failing to load in OPAC search results
This patch uncomments some code which was incorrectly left commented
after debugging.

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 545ff24dd0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 12:08:08 +02:00
Owen Leonard c798ba2ecc Bug 38184: (follow-up) Correct the number of tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 36f86bacb0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:14:18 +02:00
Aleisha Amohia f006a0474e Bug 38184: Show due date on OpacTrustedCheckout modal
This fixes checkout fields being made available to the public API.

Note: This depends on the fix at Bug 39313, so make sure you apply that
first.

To test:

1. Enabled OpacTrustedCheckout system preference
2. Search for an item and get the barcode
3. Go to the OPAC
4. Click the Self-checkout button at the top
5. Enter the barcode and submit
6. Notice that the due date does not show in the modal, even though the
   due date was correctly set

7. Apply the patch and restart services

8. Go to the staff interface and check in your barcode
9. Repeat steps 3-5
10. Confirm the due date does show correctly in the modal

11. Confirm tests pass t/db_dependent/Koha/Checkout.t

Sponsored-by: Reserve Bank of New Zealand
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 53c58f7cef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:12:00 +02:00
Aleisha Amohia 117fa463eb Bug 39313: Unit test for passing valid item object to CanBookBeIssued
rather than a barcode.

Will be tested within previous test plan.

Sponsored-by: Reserve Bank of New Zealand
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 00395f2520)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:12:00 +02:00
Aleisha Amohia d20b4d554d Bug 39313: Make OpacTrustedCheckout self-checkout modal accept valid barcode
This patch fixes a regression introduced by Bug 38505.

To test:

1. Enabled OpacTrustedCheckout system preference
2. Search for an item and get the barcode
3. Go to the OPAC
4. Click the Self-checkout button at the top
5. Enter the barcode and submit
6. Notice you are given an error UNKNOWN_BARCODE and the item is not checked out

7. Apply the patch and restart services

8. Repeat steps 4-6 and confirm you are able to successfully check out the item
9. Test submitting the modal with no barcode entered - confirm you are shown an appropriate error
10. Test with a fake barcode that does not exist - confirm you are shown an appropriate error

11. Run tests to confirm no regressions
prove t/db_dependent/Circulation*
prove t/db_dependent/DecreaseLoanHighHolds.t
prove t/db_dependent/rollingloans.t
prove t/db_dependent/api/v1/checkouts.t
prove t/db_dependent/Patron/Borrower_PrevCheckout.t
prove t/db_dependent/Koha/ILL/Requests.t

Sponsored-by: Reserve Bank of New Zealand
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised, including the tests.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2b770e5e77)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:10:38 +02:00
David Cook bda71423bf Bug 39295: Prevent infinite loop on line wrapping
This change checks that the string width is larger than 0 before
attempting to perform line wrapping on the line.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Follow instructions at end of this message[1]
2. Note that the infinite loop does not happen and that a blank
card is created
3. Export the batch using the test layout and template that come
with koha-testing-docker
4. Note that the patron card is correctly created

[1]
To reproduce:

0. Change Koha test user's firstnameto "Firstname" and surname to "Lastname"

1. Create a template:
Units: PostScript Points
Page height: 60pt
Page width: 60pt
Card height: 60pt
Card with: 60pt

Top page margin: 10pt
Left page margin: 10pt
Number of columns: 1
Number of rows: 1
Gap between columns: 10pt
Gap between rows: 10pt

2. Create a layout:
Units: US inches

Field 1:
Text: Library Name
Font: Times-Roman
Font size: 12 pt
Text alignment: Left
Lower left X coordinate: 100in
Lower left Y coordinate: 100in

Field 2:
Text: <firstname> <surname>
Font: Times-Roman
Font size: 10pt
Text alignment: Left
Lower left X coordinate: 5in
Lower left Y coordinate: 5in

3. Create a batch for borrowernumber 51 (if using "koha" test user in ktd)

4. Export using the above template and layout

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 e223b17d68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:06:57 +02:00
Jonathan Druart 42294d2ad0 Bug 39305: Adjust wording
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ac6c660f27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:05:10 +02:00
Jonathan Druart ad95725a03 Bug 39305: Display a warning on the about page if Plack is not running
CSRF protection is only working if Koha is running under Plack.

The about page is not showing any errors if plack is not running.

Test plan:
0. Do not apply this patch
1. Go to the about page
=> Notice the "PSGI" entry in the "Server information" tab
2. Disable plack
koha-plack --disable kohadev && restart_all
3. Go to the about page
=> Notice that the "PSGI" entry is not displayed, and nothing indicates
that plack is not running
4. Apply this patch
=> "PSGI" now shows "Koha is running in CGI mode. This is a security issue! Use koha-plack --help"

Better wording idea welcome.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0e4ffd3ae6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:05:10 +02:00
Owen Leonard 082f566917 Bug 39095: Fix problems with article request deletion
This patch fixes a number of issues with article request deletion in the
OPAC:
 - Cancel button should work when initially hidden by DataTables'
   responsive behavior.
 - Table row hiding upon deletion should work when DataTables'
   responsive behavior has created a secondary row to display the hidden
   columns.
- Tab and table caption article count should correctly update when a
  request is canceled.

To test, apply the patch and enable ArticleRequests if necessary. If
enabling ArticleRequests for the first time you may need to update your
circulation rules to allow article requests on some patrons or item
types.

- Log in to the OPAC and place several article requests.
- Go to your user summary page and open the article requests tab.
- Narrow your browser window until at least the last column is hidden by
  DataTables.
- Click the "+" button to show the hidden details, which should include
  the cancel button.
- Click the cancel button. After confirming the deletion the original
  row should be hidden along with the row shown by DataTables.
- The article request count in the article requests tab should now be
  updated to reflect the new number of requests.
- The same should be true of the article requests table heading.

Sponsored-by: Athens County Public Libraries
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 168d282e94)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:01:09 +02:00
Hammat Wele cf2a14f2ba Bug 38892: Show correct error message when we attempt to add guarantor as a child
When we attempt to add child as guarantor the error message shown is 'A guarantor cannot be a guarantee.' it doesn't make sense

To recreate:
1. Go to Patrons
2. Click 'New patron' > 'Kid'
3. Fill out surname and cardnumber
4. Under Patron guarantor, click Add guarantor
5. Search for category = Kid and choose one of the patrons
6. Choose the relationship
7. Click 'Save'
   --> Error A guarantor cannot be a guarantee.
8. Apply the patch
9. repeat previous steps
10. After clicking Save
   --> the error message shown is «Child patron cannot be a guarantor.»

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 2f9b826a55)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 10:57:59 +02:00
Katrin Fischer 28907b41c1 Bug 37934: DBIC schema update
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 07ae4d883b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 10:00:30 +02:00
Katrin Fischer 8ca9d0a916 Bug 37934: DBRev 24.12.00.022
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 52a17d3a30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 10:00:30 +02:00
Katrin Fischer cfb78f005f Bug 37934: Extend data types for customer ID, requestor ID, and API key for ERM data providers
This changes the datatype of customer ID, requestor ID, and API key
from limited varchar to text to accustom for longer values.

To test:
* Apply the patch
* Run updatedatabase (a sandbox will do this automatically)
* Activate the ERM module in the system preferences (ERMModule)
* Go to E-ressource management > Data providers > New data provider
* Make sure you can enter values longer than 265 in the fields named
  above and that they are stored correctly.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c1356f4667)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:59:32 +02:00
Baptiste Wojtkowski 43843b47df Bug 38847: Fix error when renewing an expired child patron without a guarantor
This fixes an internal server error when renewing an expired
child patron without a guarantor, when the ChildNeedsGuarantor
is set to "must have".

Test plan:
1. Create or edit a child patron:
   - Don't add a guarantor.
   - Set the "Expiry date" to a date in the past.
2. Set the ChildNeedsGuarantor system preference to "must have".
3. Refresh or view the patron's check out or details page, and
   select the "Renew" link under the attention heading -
   this generates an internal server error message.
4. Apply patch.
5. Repeat step 3, you will now get a standard error message
   "This patron could not be renewed: they need a guarantor."
6. Add a guarantor for the patron.
7. Repeat step 3, and click "Renew" - the patron is now renewed.

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 b65eb561e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:57:15 +02:00
Tadeusz „tadzik” Sośnierz e2b344eba5 Bug 40033: Call GetPlugins correctly in background_jobs.pl
Test plan:

1. Install a plugin that does not have any background_tasks, e.g. https://github.com/HKS3/HKS3GeoSearch/releases/tag/v0.12
2. Navigate to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl, observe a 500
3. Apply patch
4. Observe no 500

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 53630add0d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d5707a9ee6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:47:55 +02:00
Tadeusz „tadzik” Sośnierz 8d3e8ce9aa Bug 39772: Extend background_tasks API to allow for human-readable job names
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1da28b221a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:47:50 +02:00
Tadeusz „tadzik” Sośnierz 0bb07f9c4e Bug 39772: Display package names for plugin jobs rather than "unknown" messages
This slightly improves the current situation, where on background_jobs.pl
each plugin job would be displayed as "Unknown job type 'plugin_...'".
After this patch, we display the implementing package name
(sourced from plugins' background_tasks()), which is slightly more
human-friendly and significantly less error-looking.

Test plan:

1. In KTD, install a plugin implementing background jobs (e.g. the KitchenSink)
2. On http://localhost:8081/cgi-bin/koha/plugins/plugins-home.pl,
   enable the plugin and run a tool/report from it
3. Observe ugly job types column on http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
4. Apply the patch
5. Observe the improved job types on http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c2eb2625b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:47:50 +02:00
Martin Renvoize 2516e88faa Bug 37364: Add requested RDA handling to generate_marc_host_field
This patch adds handling for the 264 field in precedence to the 260 for
the generate_marc_host_field method and also adds subfields n and p to
the 245 handling.

Test plan
1) The routine is currently only called during bundle linking so...
1a) Creating a new bundle
   * Add a new bib record
   * Mark the bib record as a 'collection' type by setting leader
     position 7 to 'c'
   * Add a new item to this bib record
   * You should see a new 'Manage bundle' button available in the
     'Actions' column of the Holdings table.
   * Clicking 'Manage bundle' should expand the table to include a new
     row directly beneath this one.
   * Use the new 'Add to bundle' button that appears in this row to
     trigger a modal that allows entering the barcode of items you wish
     to add to the bundle
   * Ensure the 'Add MARC link' checkbox is checked to create 773 links
     and trigger the code above
2) Inspect the MARC record for the host biblio and confirm the 773 has
   been built.
3) Run unit tests to confirm they now pass

Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 300247d2c6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b48f5c432d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:43:07 +02:00