Commit Graph

58413 Commits

Author SHA1 Message Date
Owen Leonard dce1899cc4
Bug 40004: (follow-up) Correct name of module in prefs file
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9b0669f516)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:11 +02:00
Jonathan Druart cf5d1133a9
Bug 40004: Replace 'self checkout' with 'self-checkout'
On the UI, not in the comment of the DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2becb53709)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:11 +02:00
Marcel de Rooy 129012ff78
Bug 40132: Remove POD for get_opac_news_by_id
We are removing a wrong method name at the same time ;)

Test plan:
Read the patch. Just removing a few outdated POD lines.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 64b78fe3c4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:10 +02:00
Andrew Fuerste Henry eba3fbec1b
Bug 38404: Add explanatory text to RestrictPatronsWithFailedNotices
To test:
apply the patch and search for RestrictPatronsWithFailedNotices in sysprefs. It will now include a note that the cron looks at the preceding 7 days.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 15740d1f64)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:10 +02:00
Katrin Fischer 717eee0fcf
Bug 34783: Add KIT and CLAMS to list of contributing institutions
Also corrects the alphabetic ordering for Calyx.

To test:
* Apply patch
* Go to About Koha: you can do so from the more menu or by clicking
  on the version number in the bottom right corner
* Open the tab "Koha team"
* Scroll to the bottom of the page and verify that KIT and CLAMS show
  up in the correct spot in the list of "Contributing companies and institutions"

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bead469858)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:09 +02:00
Laura_Escamilla e16efe833d
Bug 35669: Update check-in message to show specific LOST authorised value descriptions
This displays the LOST authorized value description when checking an
item in, instead of the generic "Item was lost, now found." message.

Test plan:
1. Set an item’s Lost status to "Lost". When you check in that item,
   you should see the message: “Item was lost, now found.”
2. Set an item’s Lost status to "Missing". When you check in that
   item, you should see the message: “Item was lost, now found.”
   (default behavior before patch)
3. Apply the patch.
4. Set an item’s Lost status to "Missing" again. When you check in
   that item, the message should now be: “Item was Missing, now found.”
   (using the authorised value description)
5. Repeat step 4 with other custom LOST authorised values. The check-in
   message should correctly reflect the corresponding authorised
   value descriptions.
6. Sign off and have a wonderful day! 😊

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 222329e97e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:09 +02:00
nina martinez 8c8778f334
Bug 29069: Replace the color of Refine your search link
This is a trivial patch to correct the low color contrast of the
"Refine your search" link.
To test this patch, you can use the firefox extension: WCAG Contrast
Checker or WAVE.

Test plan:

1. Apply the patch
2. Search in the Koha OPAC
3. Check the color contrast of the "Refine your search" link.
4. If it is greater than 4.5, the test succeeds !

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5556bf867b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:08 +02:00
nina martinez c63c518e87
Bug 40097: Replace the color of elements with low constrast.
Test plan:

1. Enable the system preferences: ILLModule, OPACHoldsHistory,
   OPACHoldRequests.
2. Apply the patch and log in to a patron account.
3. Go to the "Interlibrary loan requests". Look at the "Show 'select
   number' entries" and check the color contrast, which should be
   greater than 4.5.
4. Search for a record, choose "Place hold", and check the color
   contrast. The "show more options" should have a color contrast
   greater than 4.5.
5. Now go to the Holds history, you need at least one record on hold.
   Look at the "Showing 1 to ... of ... entries" and check the color
   contrast, which should be greater than 4.5.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 47847f359d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:08 +02:00
Owen Leonard eda27df5d6
Bug 39809: (follow-up) Remove left margin from label.required
The left margin is only necessary for span.required

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 77891363ce)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:08 +02:00
Owen Leonard a026d138e7
Bug 39809: .required class was made too non-specific in Bootstrap upgrade
This patch corrects some CSS which was broken during the upgrade to
Bootstrap 5. The .required class should not add any style differences to
form fields.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Administration -> Patron categories.
- Edit an existing category.
- Confirm that the contents of input fields are not styled red and
  italic.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4988662703)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:07 +02:00
Owen Leonard 739c4fa01c
Bug 39923: Add classes to email and phone in overdue report to allow for customization
This patch adds <span>s with classes around the patron's email and phone
information in the results of the overdues report. This will allow for
greater flexibility in styling or hiding the information.

To test, apply the patch and go to Administration -> Sytem preferences
-> IntranetUserCSS.

- Add this to the preference:
  .overdue_email { color: red; }
  .overdue_phone { color: blue; }
- Go to Circulation -> Overdues and confirm that you can see the custom
  colors in the results.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b70a325dd2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:07 +02:00
Pedro Amorim 665b195715
Bug 39773: Add 'required' attribute for required fields
Test plan, apply patch:
1) Enable ILLModule
2) Create a new OPAC request, visit:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Press 'Create'. Notice the required 'type 'is now validated before the form is submitted.

Additional testing:
1) Enable ILLOpacUnauthenticatedRequest. Log out. Repeat 2)
2) Press 'Create'. Notice the required unauthenticated fields are highlighted as required.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 738ab3b256)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:06 +02:00
Tomas Cohen Arazi eedb81421a
Bug 39960: Improve messages in opac-discharge.tt
This patch makes the messages more streamlined.

To test:
1. Enable `useDischarge`
2. Have a patron with two checkouts
3. Log into the OPAC and try to request a discharge
=> FAIL: You get a message that says '2 item(s)' and has redundant
words.
4. Check one of the items in
5. Repeat 3
=> FAIL: Same, but says '1 item(s)'.
6. Check it in
7. Add a manual fee
8. Repeat 3
=> FAIL: Another redundant text about charges.
9. Apply this patch and repeat 2-8
=> SUCCESS: Things read better
10. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eadcf3452a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:06 +02:00
Owen Leonard 731119a287
Bug 40488: Fix breadcrumb link to public lists when editing a list in the staff interface
This patch revises the breadcrumbs in the staff interface lists template
so that the correct link is shown when editing or viewing a public list.

To test, apply the patch and go to Lists in the staff interface.

- Create a public list
- Go to the list of public lists
- Click to view your newly created public list
- The breadcrumb menu should show Lists -> Public lists -> Contents of
  [list name]
- The link to public lists should work correctly.
- Perform the same check when editing your public list.
- Check the viewing and editing of a private list to make sure no
  breadcrumb errors were introduced.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 38a8428a0a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:05 +02:00
Yvonne Waterman 80a1810316
Bug 31930: Ignore whitespace before and after barcodes
Decoded the barcode in add items to collection.

Test plan:
1. Go to Tools -> Rotating collections
2. Create a rotating collection
3. Chose Actions -> Manage items
4. Paste a barcode and put some spaces around it, for example "          39999000010053             "
5. Click Submit => Shown an error, no item with matching barcode found, though the barcode is printed without all the whitespace
6. Apply patch
7. Repeat steps 1 - 5, barcode should be accepted

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2c730040b1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:05 +02:00
Owen Leonard f94664313d
Bug 40114: Can't select new library when editing a desk
This patch fixes selection of a library when editing a desk in
Administration. The form should provide all libraries as options, not
just the currently selected one.

To test, apply the patch and go to Administration -> Desks.

- If necessary, create a new desk.
- Edit the desk. The form should load with the correct library prefilled
  in the <select>, but should offer all libraries as a choices.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 20085be7fb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:05 +02:00
Owen Leonard 694ff22961
Bug 40081: Textareas should resize horizontally and vertically
Bootstrap 5 sets the "resize" property on textareas to "vertical." For
our purposes this is a regression in functionality and should be
overridden.

To test, apply the patch and rebuild OPAC and staff interface CSS.

- Log into the OPAC and go to the "Your personal details" page.
  - Under "Alternate address" -> "Contact note," check that the textarea
    can be freely resized.
- In the staff client, create a new patron and test the same textarea in
  that form.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit df3e44b88b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:03 +02:00
nina martinez 428d787526
Bug 39998: Add presentation role to the layout tables.
This patch improves the accessibility of the OPAC. It's a trivial patch
to help assistive technologies understand the different tables.

Test plan:

Enable the system preferences: OPACShelfBrowser, OPACPrivacy,
ShowComponentRecords.

1- On the Koha OPAC, Research a record.
2- Inspect the result page HTML and notice that there is a
   role='presentation' in the table tag.
3- Choose a record with a Component section and inspect the HTML, there
   should be a role='presentation' in the table tag.
4- Open the Browse shelf. Inspect the HTML and notice that there is a
   role='presentation' in the table tag of the browse shelf.
5- Log in to a patron account, go to the Your Summary page, and choose
   Privacy in the menu.
6- Inspect the HTML of the page and notice that there is a
   role='presentation' in the table tag of the 'Immediate deletion'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bc9dfb4b8e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:03 +02:00
Baptiste Wojtkowski 55a98bf3ea
Bug 39180: (QA follow-up) Tidy
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 007d66e314)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:02 +02:00
Nick Clemens 995e4c0177
Bug 39180: Unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 117acffacc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:02 +02:00
Nick Clemens b9e2aac30a
Bug 39180: Add a warning on patron missing guaranor
To test:
1 - Create a patron in a category that can be a guarantee and do not assign any guarantor
2 - Create a patron in a 'Child' account type and do not assign a guarantor
3 - Enable system preference 'ChildNeedsGuarantor'
4 - View 'Check out' and 'Details' tabs for both patrons, note there is no warning
5 - Apply patch
6 - Repeat 4, note warning on all pages
7 - Add a patron gaurantor on the child - repeat 4 - warning is gone
8 - Add non-patron guarantor information to other patron - repeat 4 - warning is gone

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2025ed7fdc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:02 +02:00
Nick Clemens 5efebf194a
Bug 39180: Catch exception when updating patron lastseen date
This patch adds a catch during circulatoin actions and passes a message back to the caller

For checkouts and renewals we don't have a method for passing messages so we simply catch the exception
and warn - this seems reasonable, as we have now added a warning on the patron display that they are missing
a guarantor

To test:
 1 - Create a Child type  patron with no guarantor
 2 - Create a patron in a non-child category that can_be_guarantee with no guarantor
 3 - Check out an item to each patron above
 4 - Enable system preference 'ChildNeedsGuarantor' and TrackLastPatronActivityTriggers - select all
 5 - In mysql
    UPDATE borrowers SET datelastseen = '2025-01-01';
 6 - Restart all to clear cache (so update last seen will update)
 7 - Attempt to checkout a book to either patron - 500 error
 8 - Attempt to returnt he books the patrons have checked out - 500 error
 9 - Attempt to renew their items - 500 error
10 - Apply patches, restart all
11 - Repeat checkout, renewal, checkin
12 - On checkout and renewal there should be a warning on the patron page, but actions succeed with no additional problems
13 - On return you get a warning letting you know the action succeeded but there is still a problem to resolve

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bd32425271)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:01 +02:00
Jonathan Druart f3ca238092
Bug 40198: Fix translatability issue for Active and Inactive
Signed-off-by: Michaela <michaela.sieber@kit.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 83bd47f3c9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:01 +02:00
Jonathan Druart 3396a46c28
Bug 40198: Restore data provider search
Uncaught TypeError: col.data is undefined

This patch removes the ability to
* search by status
* search or sort by "last run"

But fix the JS error that will restore the other features

Test plan:
- Activate the ERMModule via the system preference
- Add at least one data provider
- In the list of data providers, type anything in the general search field on top
=> Confirm that you can use the different features of the table without
JS errors

Signed-off-by: Michaela <michaela.sieber@kit.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bd52dab411)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:00 +02:00
Jonathan Druart ddf1b9dfe3
Bug 40490: Remove warnings from GD::Barcode::QRcode - U24
01:18:38 koha_1       | #   Failed test 'no warnings'
01:18:38 koha_1       | #   at /usr/share/perl/5.38/Test/Builder.pm line 193.
01:18:38 koha_1       | # There were 6 warning(s)
01:18:38 koha_1       | #     Previous test 4 '401 Unauthorized'
01:18:38 koha_1       | #     Use of uninitialized value $aMask[1079] in bitwise xor (^) at /usr/share/perl5/GD/Barcode/QRcode.pm line 217.
01:18:38 koha_1       | #  at /usr/share/perl5/GD/Barcode/QRcode.pm line 217.

jammy (22.04LTS) (perl): 1.15-7
noble (24.04LTS) (perl): 2.00-1

I guess it's fixed by
85e7911e65

But it is not released yet: version 2 is from September 2023 and commit from March 2024.

Test plan:
Install version 2 of GD::Barcode:
  `cpanm GD::Barcode@2.0.0`
Run the tests
Without this patch the "no warnings" test fails
With this patch applied the tests pass

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fd6ceb6b24)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:48:00 +02:00
Chloe Zermatten 0258e55bd2
Bug 39489: 'Refine your search' aria-expanded attribute
On smaller screens (phones, tablets), the 'Refine your search' expandable section in the Koha OPAC is not clearly announced by screen readers.
The reason for this is that the expandable section toggle button is instead identified and announced as a link.
This results in screen reader users incorrectly expecting to be redirected to another page, and not being informed that there is a expandable section.

For elements with a class of menu-collapse-toggle, add an aria-expanded attribute which defaults to false, and is toggled to true upon that specific section being expanded.
If the screen width is 992px or higher, then remove the aria-expanded attribute on load as it is irrelevant, and potentially misleading.

To test:

1) Apply the patch.

on a small screen:

2) Run a library catalogue search in the Koha OPAC.
3) Right click on the page to inspect it.
4) Inspect the 'Refine your search' element.
5) Notice that it now has a aria-expanded attribute which is set to false.
6) Open the expandable 'Refine your search' section.
7) Notice that the aria-expanded attribute on the 'Refinine your search' element is now set to true.
8) Navigate to Home > Most popular titles
9) Repeat steps 3-7
10) Navigate to Home > Details for > Full subscription history
11) Repeat steps 3-7

then, on a bigger screen (992px and above)

12) Run a library catalogue search in the Koha OPAC.
13) Right click on the page to inspect it.
14) Inspect the 'Refine your search' element.
15) Notice that there is no 'aria-expanded' attribute, as in this case the section isn't expandable.
16) Resize your viewport below 992px, and notice that 'aria-expanded' reappears and is set to false.
17) Resize your viewport while remaining below the 992px limit, and notice that 'aria-expanded' remains set to false.
18) Open 'Refine your search', notice that 'aria-expanded' is set to true.
19) Resize your viewport while remaining below the 992px limit, and notice that 'aria-expanded' remains set to true.

Note: now updated to handle screen resizes
Sponsored-by: British Museum
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c4ee078e50)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:59 +02:00
Imani Thomas bdefe52d46
Bug 40459: Preferred name is lost when editing partial record
To test:
* on the patron page click edit at the top, entered a preferred name, and hit save
  * we should see the preferred name being displayed instead of the first name for the user
* go back to the main edit page and change the preferred name to a blank space
  * We should revert back to the first name being used
* if we open the edit page back up we should see the first name in the preferred name field
* Edit the preferred name again and click on details
* open up any of the sections other then contact information
* hit the save button on the section without changing anything
  * you should still see the preferred name you set being used.
* open up an individual section other then contact method, change a value, then save
  * you should still see the preferred name you set being used.
* open up the contact information section and save without changing anything
  * the preferred name should be intact
* open up the contact information and change the preferred name, and save.
  * you should see the new preferred name reflected.
* Open up the contact information section, change the preferred name field to a blank and save.
  * you should see the first name being used now.
* Open up the contact information section, and put any number of spaces in the preferred name with nothing else and then save.
  * you should still see the first name being used.

Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4356c14d29)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:59 +02:00
Michael Hafen 4afb657fe8
Bug 40298: define select2 parent in patron search modal
The patron search modal in the patron card creator -> new batch ->
patron search has two select2 modals, sort1 and sort2.  If these are not
anchored to the modal they will be anchored to the body element and
appear behind the modal.

To test, apply the patch and go to Tools -> Patron card creator -> New
-> Card batch.

- Click "Add patron(s)"
- Test the "Sort 1" and "Sort 2" dropdowns. They should work correctly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 20313df192)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:59 +02:00
Janusz Kaczmarek c0f8222ed3
Bug 38514: Filter out autocomplete list of authorities with ConsiderHeadingUse
After adding ConsiderHeadingUse system preference we can limit search
results of authority finder plugin to authorities useable in specyfic
type of fields (based on 008/14-16 data in authorities record).

The autocomplete feature in auth_finder.pl should obey the ConsiderHeadingUse
setting.

Test plan:
==========
0. Have a standard KTD enviromnent.
1. Apply Bug 38494.
2. Set ConsiderHeadingUse system preference to "Don't", ShowHeadingUse to
   'Show'.
3. Go to the Cataloging editor and open the authority finder plugin for
   the 650 field.
4. Type "Application" in "Search main heading ($a only)" field.
5. Notice two autocomplete values: "Application program interfaces
   (Computer software)" and "Application software".
6. Click search button.
7. There are two result: "Application program interfaces (Computer
   software)" (the one with 'v' Subject in Heading Use column) and
   Application software Development (with 'x' Subject in Heading Use
   column).
8. Close the authority finder window, cancel the editor. Set
   ConsiderHeadingUse system preference to "Do".
9. Go to the Cataloging editor and open the authority finder plugin for
   the 650 field.
10. Type "Application" in "Search main heading ($a only)" field.
11. Notice two autocomplete values: "Application program interfaces
   (Computer software)" and "Application software".
12. Click search button.
13. There is only one result: "Application program interfaces (Computer
   software)" (the one with 'v' Subject in Heading Use column).
   So we get only one result but there were two autocomplete hints.
14. Apply the patch ; restart all ; clear the browser js cache (or go to
    a private browser window).
15. Repeat p. 9-10.
16. Notice that there is only one autocomplete hint: "Application
   program interfaces (Computer software)".
17. Click search button.
18. There is only one result: "Application program interfaces (Computer
   software)" (the one with 'v' Subject in Heading Use column).

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f801230f01)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:58 +02:00
Owen Leonard 482b91881c
Bug 38661: (follow-up) Eliminate duplicate ids
The id attribute should be unique on the page, so I'm changing it to a
name attribute and updating the corresonding selector.

Also, we can eliminate find() here:

$(this).closest('form').find('input...

...because $(this) IS the form, so we can optimize a tiny bit by
removing the find().

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eef4683e9a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:58 +02:00
Bernard Scaife 65caca0ba8
Bug 38661: Add warning when deleting import batch
When a batch is cleaned from the staged marc records screen, the user
may be unaware of records that are imported within the batch which they
may want to revert in future. Cleaning the batch unlinks these and
makes reversion / cleanup difficult. This patch gives an extra warning
when cleaning a batch where there are still linked records attached.

Test plan:

1. Stage a marc record from a mrc file
2. Import the batch
3. Return to the managed staged records screen.
4. Click "clean"
5. Note message is "Clear all reservoir records staged in this batch?
   This cannot be undone."
6. Apply patch and restart all.
7. Repeat steps 1-4 with a new batch
8. Note message has changed to "This batch contains imported records.
   Are you sure you wish to clear all the reservoir records?  This
   cannot be undone."

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fd425e815c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:57 +02:00
sashaanastasi a00b2503b4
Bug 40343: Include running batchRebuildItemsTables.pl in post-MARC-mapping-update instructions
This patch updates the information message on the Koha to MARC mapping
page to mention that batchRebuildItemsTables.pl should also be run
if changes are made to mappings that affect the items table.

Test plan:
1. Go to Koha administration > Catalog > Koha to MARC mapping.
2. Note that the information box only mentions running
   misc/batchRebuildBiblioTables.pl after mapping changes.
3. Apply the patch.
4. Refresh the page.
5. Note that it now also mentions running batchRebuildItemsTables.pl

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ddcd824071)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:57 +02:00
Owen Leonard 6185a5d6ee
Bug 39897: Make EDI accounts a configurable DataTable
This patch adds DataTable features and table settings to the EDI
accounts administration page.

The patch also includes some minor simplification of template logic in
the table.

To test, apply the patch and restart_all.

- Go to Administration -> EDI accounts.
- If necessary, add at least a few random EDI accounts.
- Test the DataTable listing the accounts you added. Confirm that all
  DataTable features work correctly: Sorting, filtering, column display,
  etc.
- Click the "Configure" button to jump to the table settings page in
  Administration.
  - Alter the default configuration by hiding columns, changing default
    sort order, etc. It's probably wise to uncheck the "Save
    configuration state on page change" checkbox so that you can easily
    see if your configuration changes work.
- Return to Administration -> EDI accounts and confirm that the new
  configuration is being applied.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 10d3a0940a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:56 +02:00
Pedro Amorim 3aa6bda853
Bug 39091: Add tests
Test plan:
prove t/db_dependent/api/v1/cash_registers.t

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1a32644618)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:56 +02:00
Pedro Amorim c28386ac74
Bug 39091: Add cash registers list REST API endpoint
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6649b406c1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:56 +02:00
Matt Blenkinsop 77864ff6d4
Bug 40417: Remove 'validation' method
We shouldn't use the ->validation method anymore as it isn't stable. We need to pass the params into the method accounting for any param changes made

Test plan:
1) Apply the regression test patch and run the test
2) Test should fail
3) Apply this patch
4) Run test again
5) Test should pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f30b6f668c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:55 +02:00
Matt Blenkinsop 78968f9436
Bug 40417: Regression test
prove t/db_dependent/Koha/REST/Plugin/Objects.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f45dd34d6e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:55 +02:00
Tomas Cohen Arazi 274bf141ab
Bug 40424: Make query-in-body rely on `$c->req->json`
This patch removes the reliance on `$c->validation->output` for the
query-in-body feature. This will allow bug 40417 to move forward.

It also fixes some wrong design decisions we made 5-6 years ago. This
was discussed with the Mojolicious::Plugin::OpenAPI maintainer and the
agreement was `$c->validation->output` was not stable nor intended to be
accessed like we do.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t \
           t/db_dependent/Koha/REST/Plugin/*
=> SUCCESS: Tests pass!
2. Apply this patchset
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 17b851bff0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:54 +02:00
Tomas Cohen Arazi d81809b4ba
Bug 40424: Simplify existing code - preparation
I wanted to isolate the changes for the query-in-body handling and it
made sense to refactor this dupicated code at the same time. So I add
this patch for tidying the area in preparation for the other part.

Duplicated code gets simplified.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t \
           t/db_dependent/Koha/REST/Plugin/
=> SUCCESS: Tests pass!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 710bf4bb1b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:54 +02:00
Tomas Cohen Arazi c7251cf7f5
Bug 40424: Add missing tests for search in body
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5c82766985)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:54 +02:00
Tomas Cohen Arazi 5eb0968866
Bug 40423: Add helper to stash x-koha-request-id header value
This patch aligns handling of the header with how other headers are
managed.

* A helper is added which reads the header and stashes the value
* The helper is called in the same place similar helpers are called
  (authenticate_api_request)
* The `objects.search_rs` helper is adjusted to use the stashed value
  instead of picking it from the reserved params.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t \
           t/db_dependent/Koha/REST/Plugin/*
=> SUCCESS: Tests pass! No behavior change!
3. Sign off :-D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5e94e44ee2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:53 +02:00
Tomas Cohen Arazi 87b3ef3c31
Bug 40423: Unit tests
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 84c8f53769)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:53 +02:00
Aman Pilgrim 4038fcb6e0
Bug 37604: Add an ID to the batch record deletion "Skip biblio...." checkbox
This patch adds an ID to the "Skip bibliographic records with open
acquisition orders" checkbox on the batch record deletion page (Cataloging >
Batch editing > Batch record deletion".

This is required so that when selecting or unselecting the checkbox, the focus
remains on the checkbox.

Test plan:
1. Navigate to Home > Cataloging > Batch record deletion
2. Click 'Skip bibliographic records with open acquisition orders' to toggle
   the Record type checkbox (selected by default).
3. Inspect the page (right click the page, select Inspect, and look at the
   values in the checheckbox input field):
  . before the patch there is no id for the field
  . after the patch there is an id="skip_open_orders" for the checkbox field

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 b3666a7233)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:52 +02:00
Martin Renvoize b4a580b9e0
Bug 40387: Comment some of the superflous diag
The test output was a little verbose in places, however the diag's can
be helpful when debugging failures. I've opted to comment rather than
completely remove them.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a1bfc15cbf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:52 +02:00
Martin Renvoize 3aae77e667
Bug 40387: Add tests for create_edi_order logger calls
Tests for the logger calls introduced in the create_edi_order
in the last commit.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4c69085376)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:52 +02:00
Martin Renvoize e1e604f1c1
Bug 40387: Add Test::NoWarnings and replace carp with Koha::Logger
This patch adds Test::NoWarnings to our EDI unit tests. In doing so, it
reminded me that we still had some old carp style error handling in the
process_quote section and that we shoudl replace those with calls to
Koha::Logger instead.

Changes made:
1. Added Test::NoWarnings import to catch any warnings
2. Replace 'carp "Message"' appropriately with
   '$logger->warn("Message")'

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac3eced5d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:51 +02:00
Martin Renvoize 5c450b74a0
Bug 40387: Add test for undefined tax rate handling in EDI processing
This adds a test to verify that EDI invoice processing correctly handles
invoices without TAX segments (undefined tax rates).

The test covers:
1. Processing invoices without TAX segments
2. Verifying no warnings about uninitialized values in multiplication
3. Confirming tax rates are set to 0 when no tax information is present
4. Ensuring invoice processing completes successfully

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dda29248ba)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:51 +02:00
Martin Renvoize ece12b3373
Bug 40387: Fix undefined tax rate warnings in EDI invoice processing
When processing EDI invoices without TAX segments, warnings were
generated due to undefined tax rates in multiplication operations.

The tax_rate() method in Koha::Edifact::Line correctly returns undef
when no TAX segments are present in the EDI message. However, the
invoice processing code in Koha::EDI didn't handle this case properly.

This patch fixes the issue by:
- Adding checks for undefined tax rates before using them in calculations
- Defaulting to 0 tax rate when no tax information is present
- Ensuring tax_value calculations use 0 instead of undefined values

This eliminates "Use of uninitialized value in multiplication" warnings
while maintaining correct processing of invoices without tax information.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 68aa216317)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:50 +02:00
Martin Renvoize 3f5a42a7d0
Bug 40386: Remove warnings from EDI when running tests
This patch fixes several warnings that occur when running Edifact tests:

1. Changed `my $self = ()` to `my $self = {}` in Koha::Edifact constructor
   to properly initialize as hashref instead of empty list
2. Added null/empty checks in Koha::Edifact::Segment::_parse_seg() to prevent
   warnings when processing undefined or empty segments
3. Added null/empty checks in Koha::Edifact::Segment::_get_elements() to
   handle undefined segments gracefully
4. Added Test::NoWarnings to t/Edifact.t to catch any remaining warnings

These changes eliminate "Use of uninitialized value" warnings and ensure
clean test runs without affecting EDI functionality.

Test plan:
1. Run prove t/Edifact.t and verify no warnings are displayed
2. Test EDI message processing to ensure no regression

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac266cad8b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:50 +02:00
Jonathan Druart e5eba4f13f
Bug 40371: Remove warnings from Budgets.t output
t/db_dependent/Budgets.t .. 153/156 Use of uninitialized value in multiplication (*) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 543.
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 554.
t/db_dependent/Budgets.t .. 154/156 Use of uninitialized value in multiplication (*) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 543.
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 554.
t/db_dependent/Budgets.t .. 155/156 Use of uninitialized value in addition (+) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 510.

This change seems correct, but I am not 100% sure it won't introduce a
regression. What about 0 vs undef?

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 15a8f0444d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:50 +02:00