Commit Graph

58202 Commits

Author SHA1 Message Date
Fridolin Somers 8854037fbd
Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues()
When using the OPAC and you are not logged in, there are warnings
in the logs:
[WARN] Use of uninitialized value $branch_limit in concatenation (.) or string

It comes from C4::Koha::GetAuthorisedValues() :
     my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
     my $cache_key    = "AuthorisedValues-$category-$opac-$branch_limit";

C4::Context->userenv->{"branch"} can be undef

The patch fixes using C4::Context::mybranch().

Test plan:
1. Set the OpacAdvancedSearchTypes system preference to something
   other than "itemtypes", for example "loc".
2. Go to OPAC without logging in, and perform a search.
3. Check the /var/log/koha/kohadev/plack-opac-error.log and note
   the warnings in the log:
   [WARN] Use of uninitialized value $branch_limit in concatenation (.) or ...
   (Alternative, tail the logs: tail -f /var/log/koha/kohadev/*.log
4. Apply the patch.
5. Repeat step 2 and check that there are no longer any warnings.
6. Sign off.

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 d60deb348c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:31 +02:00
Jonathan Druart 270138189a
Bug 39289: Display all checkouts in the batch extend due date tools
When paginate is false, pageLength is still used.
If more than 20 checkouts should be displayed, only 20 will.

Test plan:
Have more than 20 checkouts, use the batch extend due date tool and
notice that all checkouts are displayed when this patch is applied.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested on top of bug 39081.

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1e81401295)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:31 +02:00
Jonathan Druart 3c7ddb4070
Bug 40046: Use xml and auto-select it
Absolutely no idea why the previous code was not selecting MARCXML (MARC
was passed and so the import failed)

        cy.get('select[name="format"]')
            .select("MARCXML", { force: true })
            .should("have.value", "MARCXML");

But I found a bug in the JS code: we are supposed to auto-detect .xml
file and pre-select MARCXML. So let's rely on that behaviour!

sample.mrc is actually an xml file so it makes sense to rename it

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0802e46e18)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:30 +02:00
Jonathan Druart b8709b9df0
Bug 40046: Prevent random failures when verifying select's values
Commands like .select() are queued. We need to prevent the should to
happen before the select is executed.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9ebfd8d462)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:30 +02:00
Jonathan Druart 1406d3b7a7
Bug 40046: (bug 39606 follow-up) Remove waits and screenshots
From bug 39606:
"""
Why are you taking screenshots?
The wait statements will certainly cause random failures.

cy.wait(5000);
cy.wait(2000);

Notice the following couple of lines:
  cy.get("#fileuploadstatus").contains("100%");
  cy.get("legend").contains("Look for existing records in catalog?").should('be.visible');

It makes Cypress wait 10s until "100%" appears (ie. the file is updated), then the block with the dropdown lists you are going to interact with to be visible.

You should almost never use cy.wait.
"""

Test plan:
  yarn cypress run --spec t/cypress/integration/Tools/ManageMarcImport_spec.ts
should still pass

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 f12bbbf010)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:30 +02:00
Martin Renvoize ad7a9355a3
Bug 37305: (follow-up) Only add control number subfield when defined
The previous commit introduced a bug where the control number subfield 'w'
was being added to the MARC field even when undefined, causing test failures.

This patch adds a condition to only push the control number subfield when
the value is actually defined, matching the pattern used for other subfields
in the method.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 32860c2778)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:29 +02:00
Martin Renvoize a5949e7575
Bug 37305: Remove C4::Biblio::prepare_host_field
This patch updates the only use of prepare_host_field to use the well
tested Koha::Biblio->generate_marc_host_field method instead and then
removes the aforementioned prepare_host_field method from C4::Biblio.

Test plan
1) Ensure the "enhanced workflow" for creating analytics still functions
   as expected.

Sponsored-by: Open Fifth <https://openfifth.co.uk>
Signed-off-by: Heather Hernandez <flyingendpaper@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3e627d7a77)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:29 +02:00
Martin Renvoize ac2ca31d87
Bug 37305: Subfield order matters
This patch updates the use of a hash to store and then pass subfields to
the MARC::Field new method to an array with key/value pairs using fat comma's.

This allows us to maintain the integrity check that we're passing string
as the first arguament in each pair whilst also allowing us to ensure
fields are passed in the order they are found.

Sponsored-by: Open Fifth <https://openfifth.co.uk>
Signed-off-by: Heather Hernandez <flyingendpaper@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3d9778b2cd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:28 +02:00
Owen Leonard 70d23cc9f8
Bug 20601: Untranslatable strings in circulation statistics
This patch makes some updates to the circulation statistics wizard in
order to make more information translatable.

The patch also adds some template plugins to the output of filter
options in order to be able to show descriptions instead of codes, and
corrects the markup for the 'Patron library' dropdown which wasn't
working.

To test apply the patch and go to Reports -> Statistics wizards ->
Circulation.

- Test setting some or all options in the "Filter column" and running
  the report.
  - Confirm that the "Patron library" dropdown works.
- At the top of the results there should be a list of the filter options
  you selected and their values.
- All the filter labels should be correct, and the filter values should
  should be in their full/description form rather than in code form
  (e.g. library, item type, collection code, sorting field, etc.)

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit da12f99507)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:28 +02:00
Tomas Cohen Arazi 61b3019600
Bug 40261: Tidy debian/build-git-snapshot
Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dc11fbdc5b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:28 +02:00
David Nind 9e51b71118
Bug 40281: Hide the type column on the patron circulation history page
This fixes the patron circulation history page so that the type column
is hidden.

The type column on a patron's circulation history page was hidden by
Bug 38954 - Hide checkout type using colvis.

However, the commit for Bug 37273 - Add ID column to Agreements
table in the ERM, inadvertently reversed hiding the column.

Test plan:
1. Check out an item to a patron (for example, 39999000011418 to Mary
   Burton).
2. Look at the patron's circulation history page (Patrons > Mary Burton
   > Circulation history), and note there is a 'Type' column shown
   with a value of 'standard_checkout'.
3. Note that you can't hide the column, from either selecting the
   'Columns' or 'Configure' options for the table.
4. Apply the patch, restart everything (restart_all), and clear your
   browser cache.
5. Repeat step 2. Note that there is now no 'Type' column shown and
   it is not configurable, from either selecting the 'Columns' or
   'Configure' options for the table.

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 3622664b91)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:27 +02:00
Owen Leonard 3e0f04851f
Bug 39441: Some staff interface templates have div.container instead of div.container-fluid
This patch updates a few templates so that div.container is replaced
with div.container-fluid. div.container gives us a fixed maximum width
that isn't consistent the rest of Koha.

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

- Perform a catalog search which will return multiple results.
- In the search results, check multiple results and click "Add to cart."
- Click the cart icon in the top menu to trigger the cart popup.
- The contents of the cart popup should fill the whole width of the
  window.
- The other instances of this are less noticeable because of how the
  pages work. These changes are more about consistency:
  - The OPAC place hold page
  - The club enrollment process (both in the OPAC and the staff
    interface)
  - As long as these interactions work correctly all is good.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c074c694e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:27 +02:00
Lucas Gass aed4eb5974
Bug 38939: Add reservenote column to members/holdshistory.pl
To test:
1. APPLY PATCH, restart_all
2. Make some holds for patrons in both the staff client and the OPAC. ( For OPAC turn on  OpacHoldNotes )
3. Make sure you add some notes to each of these holds.
4. Go to the patron account and click on the 'Holds history' tab.
5. Make sure the hold note is there and looks correct.
6. Ensure you can hide the coluimn properly via Table settings.

Signed-off-by: Andrew Auld <andrew.auld@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 81859ce662)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:27 +02:00
Martin Renvoize b041f322de
Bug 33729: (QA follow-up) Tidy
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f8a1e44f5c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:26 +02:00
Laura_Escamilla 0ea71ceb56
Bug 33729: Added datacolumn for date accessioned
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6169b9cdf1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:26 +02:00
Laura_Escamilla c22af7a1b7
Bug 33729: Added dateaccessioned to column_settings.yml
Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4b18fba007)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:25 +02:00
Laura_Escamilla 76403893dd
Bug 33729: Added date accessioned to items search table
Test plan:
1. Apply patch
2. Go to item search
    1. Notice that there is now a date accessioned column
    2. Export the table into a CSV and notice that there is also a date accessioned column there
3. Sign off and have an amazing day :D

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5875adce83)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:25 +02:00
Emily Lamancusa 6b02fb0adc
Bug 31632: (QA follow-up) Align behavior with order from suggestion
If an order is added from a suggestion in the first place, the
suggestion automatically changes status to ORDERED, and a notice is
sent out to the patron. If a suggestion is linked to the order after
the fact, it should move to ORDERED and notify the patron as well.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8436f799c1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:25 +02:00
Emily Lamancusa f9949a612e
Bug 31632: (QA follow-up) Adjust TT filters and remove extra form-submit.js
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ef271e8bd5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:24 +02:00
Aleisha Amohia 9071ce3936
Bug 31632: (follow-up) CSRF protection for linking order to suggestion
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 73de7c716e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:24 +02:00
Tomas Cohen Arazi 9a47b1f392
Bug 31632: (follow-up) Simplify link text
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8643b6c0fd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:24 +02:00
Aleisha Amohia 70477134ac
Bug 31632: Link a suggestion to an existing order
This enhancement allows library staff to link an order (in an unclosed basket, or a standing order) to an accepted suggestion.

To test:

1) In the staff interface, go to Suggestions and create at least two suggestions.
2) Mark at least two suggestions as Accepted.
3) Go to Acquisitions, create a vendor if you don't have one already.
4) Have or create two baskets - one should be standing, and one not standing (normal).
5) In the normal basket (not standing), add an order from any source but NOT from a suggestion.
6) When you save the order, there should be a new link in the Modify column of the Orders table - "Search for suggestion to link". Click this.
7) Choose one of your suggestions to link to the order.
8) You should be redirected back to the basket. Confirm your order has been correctly linked to the suggestion. Confirm there is no link to "Search for suggestion to link" for this order now that a suggestion has already been linked.
9) Add another order to this basket from any source but NOT from a suggestion.
10) Close the basket. Confirm there is no link to "Search for suggestion to link" because the basket is closed, but you could reopen the basket to link the order if you wanted to.
11) Go to Baskets in the left navigation so you can find your standing basket.
12) Add an order to your standing basket from any source but NOT from a suggestion.
13) Go to the vendor and Receive shipments. Receive your standing order and finish receiving.
14) Go to the standing basket. There should be a new unreceived standing order for the record you just received, with a link to "Search for suggestion to link". Click this.
15) Choose a suggestion to link to the order.
16) You should be redirected back to the basket. Confirm your orders for this record have been correctly linked to the suggestion.

Sponsored-by: Pymble Ladies' College
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7546669920)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:23 +02:00
Owen Leonard fe3f83e492
Bug 40249: "Copy settings" should be "Copy permissions"
This patch changes the "Copy sesttings" button on the patron permissions
page to return it to its previous text "Copy permissions." This is
consistent with related controls on the page.

To test, apply the patch and locate a patron in the staff interface.
From their checkout or detail page choose More -> Set permissions from
the toolbar.

In the toolbar of permissions-related controls you should see a button
labeled "Copy permissions."

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Flater <flaterdavid@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f6b630601)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:23 +02:00
Emily Lamancusa 25c36c5884
Bug 40030: Escape values when displaying action logs comparison
When viewing the action logs for a system preference change, there is an
option to view a comparison between different log lines for the same
system preference. However, if a system preference value contains HTML
markup (e.g. in IntranetUserJS), the diff text is only escaped on
sections where a change is marked, so unchanged lines containing HTML
markup result in the HTML being rendered.

Escape the string values for unchanged sections as well, to ensure that
HTML markup in the diff text will not be rendered.

To test:
1. Edit IntranetUserJS and add some code that contains HTML markup.
   For example:
$("body").append('<a id="helloworld" class="btn btn-default">Say hi</a>');
2. Save the preference
3. Make another change to IntranetUserJS that does not affect the line
   you just added, and save again to ensure there are at least 2 action
   log lines for comparison
4. Go to Tools > Log viewer
5. Select System Preferences module and Submit
6. Find the log entries for the above two revisions to IntranetUserJS
7. Check the Compare checkboxes on those entries, and click View
   comparison
--> Note that the HTML button is rendered in the comparison
8. Apply patch
9. Clear browser cache and refresh the page
10. Repeat step 7
--> The button is not rendered and the code is displayed as written
11. Make a change to the line you added in step 1 (for example, replace
    "Say hi" with "Say hello")
12. Refresh the page
13. Check the checkboxes for the newest 2 log entries and click View
    comparison to view the diff for that last change
--> Confirm the change is shown correctly - the button is not rendered
    and nothing has been double-escaped

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 78dbb72ce9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:22 +02:00
Emmi Takkinen a57bd07127
Bug 34776: Add unit tests for sub restore_form_values
Test that input values don't change when send to the
sub restore_form_values.

To test prove t/Form_MessagingPreferences.t

Sponsored-by: Koha-Suomi Oy
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 2c4a89801e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:22 +02:00
Emmi Takkinen 7fc5b0b0f6
Bug 34776: Remove unneeded if statement
We don't need to check if $op is add_form after
error, since this value always changes.

Sponsored-by: Koha-Suomi Oy
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 c4052b981f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:22 +02:00
Marcel de Rooy 3b031ce510
Bug 34776: Unit tests
Just a small beginning..

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 6cc683b518)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:21 +02:00
Emmi Takkinen 8d496f1bed
Bug 34776: Restore patron messaging preferences if error occurs during new account creation
If error occurs while creating a new patron messaging
preferences are either lost or reseted as default
fro patron category. This patch adds new method
restore_form_values to restore already added messaging
preferences.

To test:
1. Enable syspref EnhancedMessagingPreferences.
2. Create a new patron but cause an error to prevent it from
saving (e.g. add wrong age).
3. Add messaging preferences for patron (if there are default
preferences, add also new ones or remove defaults).
4. Attempt to save.
=> Note that messaging preferences were lost and you need to
readd them.
5. Apply this patch.
6. Repeat steps from 2 to 4.
=> Note that messaging preferences which you added are kept
even if error occurs.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
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 8ed31509ae)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-10 22:47:21 +02:00
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