Commit Graph

58174 Commits

Author SHA1 Message Date
Marcel de Rooy 7ed54da4f2
Bug 39871: (QA follow-up) Do not hardcode nullable check
Lets check DBIx's columns_info.

Test plan:
Try to blank an integer column and a string column. Verify results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c0a1731715)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:21 +02:00
Emily Lamancusa 2e206204c6
Bug 39871: Don't pass undef for non-nullable fields from batch mod tool
To test:
1. Set not-for-loan, withdrawn, and damaged statuses on some items
2. Try to edit only those items with the Batch item modification tool
3. Check the checkboxes to clear the withdrawn, not-for-loan, and
   damaged statuses
4. Click Save
5. View the background job report
   --> Note that it says the items could not be modified
6. Look at the items
   --> The statuses have not been cleared
7. Apply patch and restart_all
8. Repeat steps 2-5
   --> The background job report says the modifications were successful
9. View the items
   --> The statuses have been cleared

Signed-off-by: David Flater <flaterdavid@gmail.com>
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 341c93ee58)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:20 +02:00
Tomas Cohen Arazi 377602a36d
Bug 40244: Fix typo in branchoverdues.tt
This patch fixes a trivial typo. The text appears in two more places
with the right form on the same template.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 77fdb32e8f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:20 +02:00
Caroline Cyr La Rose 0432843e41
Bug 40250: Terminology changes 'preference' to 'system preference'
This patch corrects the terminology used in the patron category
settings page, changing 'preference' to 'system preference'.
https://wiki.koha-community.org/wiki/Terminology#P

To test:
1. Apply patch
2. Go to Administration > Patron categories
3. Click 'New category'
4. Check that the hints under 'Checkout charge limit', 'Guarantees
   checkout charge limit', and 'Guarantors with guarantees checkout
   charge limit' use 'system preference' and not 'preference'

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 7d7697cd74)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:19 +02:00
Caroline Cyr La Rose 6a22f94d9a
Bug 40250: Wrong link to NoIssuesChargeGuarantorWithGuarantees in patron category page
This patch corrects the link to the NoIssuesChargeGuarantorsWithGuarantees
system preference in the patron category creation/modification page.

To test:
1. Apply patch
2. Go to Administration > Patron categories
3. Click 'New category'
4. Check that the hint under 'Guarantors with guarantees checkout charge
   limit' links to the correct system preference
5. Click on the link and make sure it links to the correct system preference

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ed5e0d9160)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:19 +02:00
Owen Leonard e377e09840
Bug 39954: Fix cataloging search results incorrect menu markup
This patch corrects the dropdown menu markup in the "Records found in
the reservoir" section of the cataloging search results page. It was not
upgraded to Bootstrap 5 markup.

To test, apply the patch and go to Cataloging.

- Click "New from Z39.50/SRU"
- Perform a search which will return multiple results.
- Close the popup window and perform the same search in the "Cataloging
  search" header form.
- Scroll down to the "Records found in the reservoir" section.
- Click the "Actions" menu on one of the results. The menu should look
  correct.

Sponsored-by: Athens County Public Libraries
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 5f2dfbc226)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:19 +02:00
Owen Leonard d7bf63a327
Bug 39534: Hide reports subgroup filter if there are no subgroups
This patch updates the JavaScript which runs on the list of saved SQL
reports, adding a check for report subgroups to the display of the
report subgroups dropdown. The patch also hides the subgroups dropdown
if there is no saved tab, in which case the tabsInit function doesn't
run.

To test you should have multiple reports organized in multiple groups
and subgroups. See the test plan on Bug 39534.

- Go to Reports -> Saved SQL reports.
- If the page loads with the "All" tab active, there should be no
  subgroups dropdown.
- If the page loads under a different tab, the subgroups dropdown should
  only show if that group has subgroups.
- Switch between the various report group tabs to confirm that the
  subgroups dropdown is shown or hidden correctly based on the existence
  of subgroups.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1e57f5c8d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:18 +02:00
Mason James 14662a012e
Bug 40039: Add production enhancements to build-git-snapshot tool
this patch adds some useful features to allow the build-git-snapshot tool to build production packages

the patch adds the following options:

     --urgency, -u
        the urgency string for the resulting package. Default is '$urgency'.

    --incr, -i
        set debian revision (default = '-1')

    --(no)autochangelog
        whether or not to update the debian/changelog file.
        Default is to update it.

note: this patch does not change any of the existing behaviour of the tool

test plan to come...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3e7c839714)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:18 +02:00
Tomas Cohen Arazi 989f159f48
Bug 40254: Regression tests
This patch makes the tests related to `can_place_holds` cover more use
cases, and highlight an underlying issue in the controller.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f2c5ce20ee)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:18 +02:00
Tomas Cohen Arazi 746024e2eb
Bug 40254: Fix error in overrides check allowing too much
This patch fixes a subtle (yet naive) error making the controller not
care about blocking conditions if they were more than one and the first
one was overridden.

To test:
1. Apply the regression tests
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail! Some tests expect a 409 (denied for a conflict) but
return a 201!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit afd00523a3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:17 +02:00
Martin Renvoize 1ab7ccde18
Bug 40079: (follow-up) Improve test coverage and fix undef handling
This patch modernizes the Scrubber.t unit test with comprehensive
coverage following Koha best practices:

- Uses subtest structure for logical grouping
- Tests all scrubber types (default, comment, note)
- Includes security testing for XSS prevention
- Covers edge cases and error handling
- Tests new list elements added in previous commits

Also fixes C4::Scrubber to handle undef parameters cleanly by
treating them as 'default' type instead of generating warnings.

Test plan:
1. Run prove t/Scrubber.t
2. Verify all tests pass without warnings
3. Confirm comprehensive coverage of module functionality

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 21f3340442)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:17 +02:00
Martin Renvoize ceb1f9f230
Bug 40079: (follow-up) Update unit test
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c5f64db21f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:17 +02:00
Martin Renvoize 421968355e
Bug 40079: (follow-up) Add dl, dt, dd tags to notes profile scrubber
Adds support for HTML description list elements (dl, dt, dd) to the
'note' profile in the HTML scrubber configuration. This allows
librarians to use description lists in note fields for better
structured content presentation.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9ef8f098d8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:16 +02:00
Martin Renvoize fb2899f311
Bug 40079: Add ul/ol and li to allowed tags in notes profile
This patch add the unordered list, ordered list and list item html tags
to the list of allowed tags in C4::Scrubber.

Test plan:
1) Add a course reserve and include the following in the public note
   field:
   <ul>
     <li>First item</li>
     <li>Second item</li>
   </ul>
2) View the course details page and note "First item Second item" all
   appears on the same line (the ul and li tags have been stripped)
3) View the course reserves page and note the same issue in the public
   notes field of the table display
4) Apply this patch
5) Repeat 2 and 3 and note you now have a bullet pointed list displayed
   in both places
6) The display of the note on the details page may look mis-aligned..
   that will be dealt with on it's own bug

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 ddad4e81a2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:16 +02:00
Tomas Cohen Arazi dcca39d465
Bug 39657: Add more checks and overrides to hold creation endpoint
This patch adds new behaviors to the `POST /holds` endpoint.

It uses the framework we created in the past for overriding policy
rules, and add new options:

* expired
* debt_limit
* bad_address
* card_lost
* restricted
* hold_limit

Some status codes are changed from 403 to 409. This should be revisited
accross the codebase, as I think we made a wrong choice. Happy to review
in this bug.

The feature makes use of the newly introduced
`$patron->can_place_holds()` method, which accepts to be passed through
the overrides.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ yarn api:bundle
  k$ koha-plack --restart kohadev
  k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
3. Test the endpoint with the various scenarios using your favourite
   REST tool (Postman!)
4. Sign off :-D

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f245ad1605)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:16 +02:00
Tomas Cohen Arazi cf857ffb02
Bug 39657: Spec changes
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3c1df8b26b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:15 +02:00
Tomas Cohen Arazi a58890e5fb
Bug 39657: Unit tests
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c9ee9e9810)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:15 +02:00
PhilipOrr 035766fefa
Bug 39498: Correct patron restrictions displays
This patch updates the way patron restrictions are displayed in the OPAC
and staff interface, with the intention of making the details of each
restriction more clear. In the OPAC, a new include file is created to be
reused on the holds page and the user summary page. opac-user.pl is
updated to allow a parameter to be passed to automatically open the
"Overdues" tab.

Test plan:
1. Before applying the patch, check how the display is currently. First
   set syspref PatronRestrictionTypes to "Allow"
2. Add two different new restriction types, fill out both "Code" and
   "Label"
3. Go to a patron's checkout page and add one of each of these
   restrictions, but do not fill out the comment field when adding them!
4. Observe that in the checkouts page and details page of the patron, it
   just says "Restricted since..." and does not show the restriction
   types.
5. Add another restriction, this time fill out the comment field
6. Observe that now in checkout and detail pages, the labels from the
   restriction types are listed and the comment shown.
7. Apply patch
8. Go to patron's details and checkout pages and check the restrictions
   are now displayed correctly, that is the text "with the explanation"
   is only shown for the restrictions that actually have a comment
   8b. Log in to the OPAC with that patron and check they are displayed
       correctly in their summary page and when the patron is trying to
       place a hold.
9. Go to a different patron's account and add a restriction without a
   comment
10. Check it is now displayed correctly
11. Add more restrictions and check they are displayed correctly. Also
    add an OVERDUES restriction:
    11a. Find a patron with an overdue item checked out (or create an
         overdue checkout on a patron's account)
    11b. Go to Tools -> Overdue notice/status triggers
    11c. Set up a rule for that patron's category, e.g. "First" ->
         Delay: 1, make sure to mark the check box for "Restrict" and
         "Print"
    11d. Run misc/cronjobs/overdue_notices.pl
    11e. That patron should now also have an OVERDUES restriction
12. Turn PatronRestrictionTypes off again and check the patrons if
    everything is still displayed correctly
13. Go to another different patron and add a restriction with no
    comment, check if it is displayed correctly
14. Add another restriction with a comment and check it is displayed
    correctly
15. Log in to the OPAC with the patron that had OVERDUES restriction and
    check they are displayed correctly in their summary page and when
    the patron is trying to place a hold.
16. Same thing for the other patron without the OVERDUES restriction.

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 9516fe517c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:14 +02:00
Matt Blenkinsop 9a1681e046
Bug 39951: Fix column filter offsets
Test plan:
1) Enable ERM module
2) Create an agreement and a license with a vendor
3) The table filters will be out of sync
- Agreements - only the vendor filter is incorrect, it sits above the name column instead of the vendor column
- Licenses - all dropdown filter options will be left shifted by one
4) Apply patch
5) yarn js:build
6) Hard refresh the browser
7) All the filters should now be above the correct columns

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5e5d53fea2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:14 +02:00
Tomas Cohen Arazi f37a09c2e4
Bug 40101: Make opac-reserve.pl use `$patron->can_place_holds()`
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 33032f99a8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:14 +02:00
Tomas Cohen Arazi acb0293cd9
Bug 40101: Add `Koha::Patron->can_place_holds()`
This patch adds a new method to the `Koha::Patron` class.

As described in the POD, this method makes checks on the patron's
current situation and returns a boolean telling if it should be allowed
to place holds. This doesn't check specific item/biblio holdability. It
only covers patron specific conditions that could prevent holds to be
placed.

Both in `opac-reserve.pl` and `reserve/request.pl` this checks are all
run, and all blocking situations are presented to the UI user. Feedback
in community (so far) expressed this is a desirable situation, so that
behavior can be retained with the use of the `no_short_circuit`
parameter.

If `no_short_circuit` is not passed, then the routine will return on the
first blocking condition it finds.

An `overrides` parameter is added, allowing to be passed a list of
strings that match the possible error messages.

This way, this method can be asked not to check for patron expiration,
for example, and things like that. This is of course designed with the
API overrides use case in mind.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Patron.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 61c59ac1b1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:13 +02:00
Tomas Cohen Arazi 595a9dfd00
Bug 40101: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 54f41e0e61)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:13 +02:00
Paul Derscheid a4292261f4
Bug 40022: (QA follow-up) Tidy about-team.inc, about.tt
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit da3fb17670)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:13 +02:00
Martin Renvoize 5158b5074b
Bug 40022: Sync teams in Koha, Wiki and release-tools
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d66e792215)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:12 +02:00
Martin Renvoize 46a197322b
Bug 40022: Condense display by hiding versions under ellipses
This patch improves the contributor section display in the about page
by implementing a condensed view for version lists. When a contributor
has more than 2 versions for a role, only the first 2 are shown with
an ellipsis (...) that can be hovered to reveal the remaining versions.

The implementation:
- Sorts versions in reverse chronological order (most recent first)
- Shows first 2 versions directly
- Hides additional versions under a hoverable ellipsis using Bootstrap tooltips
- Adds CSS styling for the ellipsis with dotted underline and help cursor

This makes the contributor lists more readable while preserving access
to complete version information.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f271368712)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:12 +02:00
Martin Renvoize 5044480276
Bug 40022: Add missing roles to the include
This patch adds missing role mappings to the about-team.inc template
to ensure all roles defined in teams.yaml are properly displayed.

Added role mappings include:
- manager_assistants (plural form)
- maintainer_assistants (plural form)
- maintainer_mentors (plural form)
- accessibility_advocates (plural form)
- security_manager
- meeting_facilitator
- social_media
- website

Also adds display logic for historical roles that may not be present
in current teams but appear in contributor lists from teams.yaml.

This ensures complete coverage of all team roles across historical
and current release teams.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1159aecb11)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:12 +02:00
Martin Renvoize ed1fc5efcf
Bug 40022: Add the 25.11 release team
This patch updates the teams.yaml to include the voted in 25.11
release team.

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

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 780eb529c1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:11 +02:00
Nick Clemens 87043c9f53
Bug 39912: Update RealTimeHoldsQueue when hold pickup location is updated
When a hold's pickup location is changed we should rebuild the holds queue.

To test:
1 - Enable RealTimeHoldsQueue
2 - Enable LocalHoldsPriority where pickup library matches home library
3 - Place two biblio level holds on a bib with one item for two different patrons for delivery to a different library then the home library
4 - Check the queue - firstpatron should have priority
5 - Change the pickup location for the second hold to be picked up at the home library
6 - Check the queue, unchanged
7 - Change the pickup location back
8 - Apply patch, restart all
9 - Change the pickup location to the items home library again
10 - Check the queue
11 - Second patron has now been given priority

Signed-off-by: Michelle Spinney <mspinney@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3664281d37)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:11 +02:00
Marcel de Rooy 816b4537e9
Bug 40242: Remove double operator in Quotes.pm
Test plan:
Read patch.
Run t/db_dependent/Koha/Quotes.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0ed2b7cfa8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:10 +02:00
Marcel de Rooy 37e9b0031f
Bug 39206: Modify koha-conf templates
Test plan:
Just read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5493e212f6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:10 +02:00
Marcel de Rooy 6c320d365b
Bug 39206: Add an allowlist to Koha::CookieManager
This patch adds a bit more control to what CookieManager does by
adding a hardcoded allowlist of cookie names that are cleared at
logout. Allowing at the same time to add entries to that list by
using koha-conf <remove_cookie> lines or removing entries from the
hardcoded list by using <do_not_remove_cookie> lines.

The patch fixes the expiration of cookies that should be removed
by passing max-age 0.

Also it adds a theoretical path correction for always_show_holds but
since we do not clear that cookie, it is currently unused. This seems
to be the only Koha cookie where we use a longer path.

Test plan:
Run t/CookieManager.t

Go to OPAC, login, select a few OPAC search results and send them
to cart. This would create cookie bib_list. (Check dev tools.)

Logout from OPAC and check cookie in your browser dev tools. What
you see, depends on the browser. But the cookie should be either
gone or empty and expired (FF: Session).

Now add a <do_not_remove_cookie> line for bib_list in koha-conf.
Restart all. Repeat search, add to cart. Logout. Check again in dev
tools that bib_list is not empty, not expired.

Check out an item. And click on 'Always show checkouts...' on
the patron checkout form. This should create the cookie with
value DO. Logout from intranet. Check that cookie was not affected.
Now add a <remove_cookie> line for the following cookie:
issues-table-load-immediately-circulation. Restart all.
Login and logout from staff again. Check that cookie is empty
and expired, or just gone.

Bonus for devs: Create some custom cookie, and test keeping or
removing it similar as above.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 221126f3dd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:10 +02:00
David Nind f9ab9dc5cd
Bug 39939: (follow-up) Fix terminology - syspref to system preference
Spell system preference in full, instead of syspref.

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 a50409ebfa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:09 +02:00
Owen Leonard 018cb3d351
Bug 39939: Cancel selected holds button on waitingreserves.pl is the same color as the background
This patch makes some minor changes to the "Holds awaiting pickup" page
so that the cancel buttons are clear and usable.

The patch also wraps the reference to the
TransferWhenCancelAllWaitingHolds system preference in a permission
check so that it can be linked to the preference when appropriate.

To test you should have some waiting holds in three categories:

1. Holds which have not been waiting longer than the number of days
   specified in the ReservesMaxPickUpDelay system preference.

2. Holds which have been waiting longer. I belive the only way to test
   this is to manually update the expiration date of an already waiting
   hold so that it is in the past.

3. Waiting holds which a patron has requested be cancelled. (Requires
   that the patron and hold are allowed according to the "Cancellation
   allowed" setting under Administration -> Circulation and fine rules
   -> Default waiting hold cancellation policy.
   - Log in to the OPAC as a patron who has a waiting hold. On the "Your
   summary" page, under the "Holds" tab, click the "Request to cancel"
   button for at least one of the waiting holds.

- In the staff interface, go to Circulation -> Holds awaiting pickup.
  - Under each tab, check the appearance of the "Cancel selected"
    buttons (and the "Cancel and transfer all" button under "Holds
    awaiting past..." tab).
- When testing as a user with system preference privileges, and the
  TransferWhenCancelAllWaitingHolds preference set to "Don't transfer,"
  the hint shown under the "Holds awaiting past..." tab should be linked
  to system preferences. A user without system preference privileges
  should not see a link.

Sponsored-by: Athens County Public Libraries
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 0a18a15f2c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:05 +02:00
Baptiste Wojtkowski 72f202dfad
Bug 38928: (QA follow-up)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ce15eacc5e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:44 +02:00
Pedro Amorim 9c1de15a5f
Bug 38928: Handle rft_id or id
If a semicolon exists, the key should be what's before the semicolon, and its value, whats the after.
Otherwise, default to 'doi' as it was before.

To test:
1) Enable ILLModule.
2) Visit the following URLs
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=create&backend=Standard&openurl=1&genre=article&id=10.1016/j.cognition.2024.105913
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=create&backend=Standard&openurl=1&genre=article&id=doi:10.1016/j.cognition.2024.105913
3) Notice that in both cases, only the doi value '10.1016/j.cognition.2024.105913' should be present in the input.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8b0e4d3c15)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:43 +02:00
Owen Leonard ef2c1c288c
Bug 38792: Rename "My virtual card" to "Library card" and move tab
This patch makes a number of changes to the "My virtual card" page and
associated menu item:

1. Rename it to "Library card." This fits better with the naming of
   other user pages. This change includes updates to the page title,
   breadcrumb menu, and page heading.
2. Move the menu item up to appear right after the "Summary" link.
3. Make some style changes to the display of the card, giving the card
   more comfortable padding and adding some responsive behavior to the
   card width.

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

- If necessary, go to Administration -> System preferences and enable
  the OPACVirtualCard preference.
- Log in to the OPAC.
- You should see a "Library card" menu item in the left-hand sidebar
  menu, right below the "Summary" item.
- On the "Library card" page, the page title, breadcrumb item, and page
  heading should read "Your library card."
- The "card" should look good, and should adjust well at various browser
  widths.
  - Above 769px wide, the card should not expand wider than 500px.
  - Below 769px wide, the card should have a width of 100% and should
    adjust as the viewport is narrowed.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit faabb96519)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:43 +02:00
Lucas Gass ec04bbbb62
Bug 39411: Add cardnumber and dateexpiry to OPAC virtual card
To test:
1. APPLY PATCH
2. Enable  OPACVirtualCard
3. Login to the OPAC and visit the account page.
4. Click on 'My virtual card'
5. Notice that the cardnumber and expiratrion date are now listed.

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4636d813be)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:42 +02:00
Paul Derscheid ee015017d5
Bug 40129: Always show the "Not finding what you're looking for" links in opac-results.tt
This patch simplifies the logic for displaying the "make a purchase
suggestion" and "interlibrary loan request" links on the OPAC search results page.

Previously, the visibility of the purchase suggestion link was tied to a
complex set of conditions evaluated in C4/Auth.pm, involving user login status and
permissions. This was unintuitive, as the authorization to make a
suggestion should be handled by the suggestions page itself
(opac-suggestions.pl), I think.

This patch alters the template (opac-results.tt) to check the
'suggestion' and 'IllModule' system preferences directly. If suggestions are allowed
system-wide or the master switch for the 'IllModule' is on, the links will be shown
shown to all patrons, regardless of login status.

To test:
1. Go to Administration > System Preferences > OPAC.
2. Ensure 'Suggestion' is set to 'Enable'.
3. Log out of the OPAC if previously logged in.
4. Perform a search that won't yield any results and verify
   the "Make a purchase suggestion" link appears on the results page.
5. Click the link and verify that you are prompted to log in.
6. Now set the 'AnonSuggestions' system preference to 'Allow'.
7. Make sure that the 'AnonmousPatron' borrowernumber is set to
   something other than 0 (is this right, though)?
8. Click the link and verify that you are able to make an anonymous
   suggestion.
9. Log in as a patron who is NOT allowed to make suggestions (check their
   patron category permissions).
10. Perform a search and verify the link is still visible.
11. Here we then get a 404, this should be handled more gracefully, but
    still in opac-suggestions.pl to not make opac-results dependent on
    a patron object. Ideas very welcome!
11. Go back to System Preferences and set 'suggestion' to 'Don't allow'.
12. Refresh the OPAC search results page.
13. Verify the "Make a purchase suggestion" link is now hidden for both
   anonymous and logged-in users.
14. This confirms the link's visibility is controlled solely by the
    'suggestion' system preference.
15. Now the simpler aspect of 'IllModule', first set everything related
    to suggestions back to defaults. Then set 'IllModule' to 'Enable'.
16. Make sure the link to place an "interlibrary loan request" is now
    shown for unauthenticated patrons as well.
17. Leave some comments regarding the unsolved issue in 11) or other
    problems that you might anticipate through this change.

I first thought this was trivial, but it is not :_D!

Signed off by: Esther Melander <esther@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 138ad36592)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:42 +02:00
Jonathan Druart 625d7ee939
Bug 40161: (bug 38255 follow-up) Fix item type translation JS error
Uncaught (in promise) TypeError: table.row is undefined

We need to use the DataTable object.

Test plan:
Have several languages installed
Edit an item type and click "Translate into other languages" to open
the modal
Translate into another language and note that:
Without this patch you get a JS error in the browser console and the
row is not added to the table
With this patch applied the row is added correctly with your translation

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 be1729ed68)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:42 +02:00
Tomas Cohen Arazi 3042fa93d8
Bug 40144: Get rid of `sip_cli_emulator.pl` warnings
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: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8f90ac9d4e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:41 +02:00
Tomas Cohen Arazi ec396bfdd4
Bug 23883: sip_cli_emulator.pl should display real parameter names
For creating this patch I looked at all parameters defined in the
handler mapping, removed duplicated ones and tracked down which ones
really were parameters in `GetOptions`. This included tracking down
variables that were later assigned other values and things like that.

The mapping is used to display the right parameter name if missing a
mandatory one.

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 46cc88acc3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:41 +02:00
Baptiste Wojtkowski 5ffdf17098
Bug 40109: Fix path for fix_invalid_dates.pl in hint from search_for_data_inconsistencies.pl
Bug 31143 created a script in cronjob and then moved it to maintenance. However, it is still referred as in cronjob in help strings. This patch updates the hint.

No test needed I guess. Only changing a string

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 34886a9b5b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:40 +02:00
Alexander Blanchard f222847062
Bug 39223: Fix the OPAC browse search (opac-browse.pl)
This fixes the OPAC browse search feature (OpacBrowseSearch
system preference, Elasticsearch only). Expanding and
collapsing the search results was not working.

Test plan:
1. Start up KTD using Elasticsearch; ktd --es7 up
2. Enable the OpacBrowseSearch system preference.
3. In the OPAC, click 'Browse search' (one of the
   options under the search box).
4. Search for 'a', for the search type use Author, then
   click Search.
5. Click on one of the search results - note that it doesn't
   expand to show the titles for the author.
6. Apply the patch.
7. Refresh the page and repeat steps 3 to 5. Note that the
   author section now expands andd collapses when clicked,
   and that the titles for the author are now shown.

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 448b9cd17e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:40 +02:00
Owen Leonard 4a831874e7
Bug 40107: Article requests: Some DataTables functionality is broken
Bug 38255 standardized our DataTables using kohaTable. kohaTable returns
the affected table as a jQuery object, but JavaScript on the article
requests page in the staff client expects a DataTable object. This patch
updates the template accordingly.

To test, apply the patch and enable the ArticleRequests system
preference if necessary.

- Log in to the OPAC and place several article requests.
- In the staff interface, go to Circulation -> Article requests.
- From the list of new article requests, test the menu options under
  "Actions."
- Changing the status of a request should make it disappear from the
  "New" tab and appear under the tab for the new status (or it should
  be removed, in case of cancel or complete).
- Test the same processes under the "Pending" and "Processing" tabs.
- Each time you perform one of these tasks the counters on each tab
  should be updated correctly.

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: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6b5a891cfb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:40 +02:00
Jonathan Druart 27292c9ea2
Bug 40127: Add a Cypress test
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 90c2a53b99)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:39 +02:00
Jonathan Druart ce72073ff5
Bug 40127: Remove JS error from the biblio detail page when no items
"build_items_table is not defined"

We should not try to build the items table if there are no items.

Test plan:
Go to the bibliographic detail page of a biblio without items
You should not see errors in the browser's console

Go to the bibliographic detail page of a biblio with items
You should not see errors in the browser's console
The table should be displayed and the different features should work as
before

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 561535503c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:39 +02:00
Jonathan Druart 7c33240af2
Bug 40127: Move build_items_table outside of document.ready
So it's not delayed and we catch have the error in the Cypress test.
Otherwise the error appear too late (in the after each) and the test
does not fail

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 2d1c6b8666)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:38 +02:00
Pedro Amorim 5df53a1ac9
Bug 40122: Dont attempt regex search for select dropdowns
Test plan:
1) Place a hold (next available) to biblio 76 and 437:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=437
2) Edit 'Centerville' library name to 'Centerville (CPL)'
3) Visit the 'holds to pull' page:
http://localhost:8081/cgi-bin/koha/circ/pendingreserves.pl
4) Try to filter for 'Centerville (CPL)'. Notice the filtering returns nothing.
5) Apply patches. Repeat test plan. Notice 'Centerville (CPL)' filtering now works.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 227d1211fb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:38 +02:00
Pedro Amorim 388a9f3640
Bug 40118: Prevent adding another empty value option
This is already done for all select dropdowns by default. If a
particular table provides an empty value it should be skipped or 2
empty options may show

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 082274d157)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:37 +02:00
Pedro Amorim d334d9ebaa
Bug 40118: Only concat ^ and $ if table is ajax
Test plan, k-t-d, before applying patches:
1) Place a hold (next available) to biblio 76 and 437:
   http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
   http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=437
2) Visit the 'holds to pull' page:
   http://localhost:8081/cgi-bin/koha/circ/pendingreserves.pl
3) Notice the 'Libraries' filter contains 'Centervile' twice. Notice the
   filtering never works regardless of option picked.
4) Apply patches. Repeat test plan. Notice 'Centerville' only shows
   once. Notice filtering works.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bd4f454716)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-09 11:36:37 +02:00