Compare commits

...

1421 Commits

Author SHA1 Message Date
Fridolin Somers f4cbe87673
Fix release notes for 24.11.19 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-09-01 12:18:46 +02:00
Baptiste Wojtkowski 16087a26e4
Update release notes for 24.11.19 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-08-25 15:46:51 +00:00
Baptiste Wojtkowski 632bdcf715
Increment version for 24.11.18 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-08-25 15:40:50 +00:00
Fridolin Somers 9991c9981e
Bug 42800: (RMaint follow-up) Fix VueJS tidy
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-18 11:39:50 +02:00
Martin Renvoize 9ddae25e63
Bug 42800: (QA follow-up) Fix backslash breaking the shelf list script block
erm.tt built the logged_in_user_lists JS array by manually
interpolating each shelf's id/name into a JS string literal, escaped
with the TT html filter:

    id: "[% shelf.shelfnumber | html %]",
    name: "[% shelf.shelfname | html %]",

The html filter escapes <, >, &, and " -- enough to stop the
<script>-tag and </script>-breakout scenario from the original bug --
but it does not escape backslashes. A list name ending in a backslash
(e.g. "foo\") escapes the closing quote of the JS string literal,
unbalancing it and throwing a JS syntax error that breaks the whole
inline <script> block on every ERM page (including the unrelated
`const logged_in_user = ...` a few lines below), reproducing the
"broken UI" half of the original bug via a different character.

Build the id/name pairs as an actual array of hashes and JSON-encode
them with To.json(), after escaping each value with the html
vmethod. JSON encoding (via the JSON module) correctly escapes
backslashes and quotes for use inside a JS string, while keeping the
values HTML-escaped so they stay inert if ever written into the DOM
via innerHTML (as the DataTables render callback in
EHoldingsLocalTitlesFormImport.vue does).

Test plan:
1. Enable the ERMModule system preference.
2. Create a list named: backslash test \
3. Go to /cgi-bin/koha/erm/eholdings/local/titles/import (or any
   other ERM page).
   => Without this patch: the page's inline script throws a syntax
      error ("Invalid or unexpected token") and
      "logged_in_user_lists is not defined", breaking the Vue
      component.
   => With this patch: the page loads without errors and the list is
      shown correctly in the table.
4. Also verify the original bug's script-tag scenario still works:
   create a list named <script>alert("booh!");</script> and confirm
   it displays as inert text, not executing, on the same pages.

(cherry picked from commit afa208e950efae6c3a6e27c74af6d9184602b737)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-14 15:07:22 +02:00
Jonathan Druart 24f267c2b4
Bug 42800: Fix XSS in shelf list in the ERM module
const logged_in_user_lists = [% To.json(logged_in_user.virtualshelves.unblessed) | $raw %];

If you have a script tag in a list name the UI will be broken, and there
is potentially a XSS vulnerability

Test plan:
Create a new list with name="<script>alert("booh!");</script>"
Go to /cgi-bin/koha/erm/eholdings/local/titles/import
or any ERM views
=> Without this patch the UI is broken
=> With this patch applied it's not and the table is correctly populated
with the lists

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 614ca3d992f4674afc8c1cae90e6d055c7008b0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-14 15:06:06 +02:00
Amit Gupta 665b90f115
Bug 42904: Prevent XSS in patron restriction comments
Test plan

1. Search for a patron and open the patron details page.
2. Under "Patron restrictions", add a manual restriction with the following comment:
   <img src=x onerror="alert(document.domain)">
3. Save the restriction.
4. Navigate to the patron checkouts page:
   /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx
   Verify that the JavaScript payload executes.
5. Edit the patron record:
   /cgi-bin/koha/members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=xxx
   Verify that the JavaScript payload executes.
6. For OPAC - Go to OPAC Verify that the JavaScript payload executes - /cgi-bin/koha/opac-user.pl
7. Apply the patch.
8. Repeat steps 4, 5 and 6.
9. Verify that:
   1. No JavaScript is executed.
   2. The page loads normally without any alert dialog. Applicable for both the staff and opac.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 2993acb641d2d9fcfeee47918ab70cf29951c720)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-14 14:59:28 +02:00
Sanjar Tulkinov Anvar o'g'li 6c2b2d54a8
Bug 42736: Prevent SQL injection in reports/cat_issues_top.pl
The "Most-circulated items" report built its SQL by concatenating the
Criteria and Filter request parameters directly into the query, with no
bind placeholders and no whitelist on the Criteria identifier. An
authenticated staff user with the reports permission could inject
arbitrary SQL and read any data reachable by the Koha database user.

This validates the Criteria parameter against a fixed allow-list of the
report's own column options (matching reports/cat_issues_top.tt) so it
is safe to use as a SQL identifier, and binds every Filter value with a
placeholder in both the column-header query and the main calculation
query. The Limit parameter is validated as a plain integer.

This mirrors the fix already applied to the sibling
reports/bor_issues_top.pl (bug 42369).

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Go to Reports > Most-circulated items (reports/cat_issues_top.pl)
3. Run the report with various Criteria and Filter values, confirm the
   output is correct and no errors appear
4. Before the patch, a Filter value or the Criteria containing SQL (a
   single quote followed by a subquery) broke out of the query. After
   the patch, confirm such input is treated as a literal value: you get
   normal output or an empty result, with no SQL error, no delay, and no
   data leak

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
(cherry picked from commit b6cdb398237ddfc3d3da97a0246c5a3a69fdaf9b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-14 14:44:08 +02:00
Fridolin Somers f2ac50ab4c
RMaint: Perl tidy reports/cat_issues_top.pl 2026-08-14 14:44:02 +02:00
Baptiste Wojtkowski 855c42b3d2
Bug 8127: Fix filters use in 'Most-circulated items report'
Filters are broken for many reasons. Previous patch contains some
(little) tidying.
There are 3 parts in this patch:
1 - The column name is incorrectly named in the dropdown for "branch",
  it is added in this patch
2 - There is a definition for 'Day' and 'Month', but not for 'Week', it
is also added in this patch
3 - Dbh variables are passed in the string definition AND in the call. I
removed them from the string definition since it violates the coding
guidelines.

Test plan:

1. On an fresh ktd db, run the script provided here (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8127#c3)  to fill the database with checkins/checkouts:

Visit http://your_koha:8081/cgi-bin/koha/reports/cat_issues_top.pl
2. Run a baseline test with following params:
Checkout date from 01/01/2020
Checkout date to: tomorrow
Library: Any library
Fill nothing else

Notice it is works

3. Test with some limits (Library, Week, and any other), notice you encounter errors on Library and Week, and that any other is empty, without error.

4. Apply patch
5. Rerun 2-3 and notice you now have results. Check with each possible limit, limiting to 5. Test once with 10 as a limit.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2b78fd1de0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-14 14:25:20 +02:00
Baptiste Wojtkowski e289ba930f
Bug 8127: Remove useless commented warns
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0f40b53044)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-14 14:23:56 +02:00
Fridolin Somers d251f7b12c
Rmaint: Fix missing sec bugs in release notes of 24.11.18 2026-08-13 10:08:39 +02:00
Marcel de Rooy dae4747e0d
Bug 43085: Fix typo in data/marc21_field_006.xml
It reads position 12-18 and "six positions". Since the length is
18, the final position is 17.

Test plan:
Test 006 plugin in basic editor.
Switch type of material to CF (computer files).
Check length of 006 in editor when saving the 006 form.

Note: this patch is cherry-picked from Bug 40284

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Lawrence O'Regan-Lloyd
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit a34e362d6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-08-12 14:21:57 +02:00
Baptiste Wojtkowski f5d9d12430
Update release notes for 24.11.18 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-08-06 14:50:03 +00:00
Baptiste Wojtkowski ecb6686b9d
Increment version for 24.11.18 release 2026-08-06 14:50:02 +00:00
Martin Renvoize 68b00b3bc1
Bug 42726: Add 26.11 release team
Add the 26.11 release team as voted at the development meeting.

Pedro Amorim as Release Manager, with Tomás Cohen Arazi and Martin
Renvoize as RM Assistants. Lisette Scheer as QA Manager with a
19-person QA team. David Cook as Security Release Manager.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-08-06 14:50:01 +00:00
David Cook d835fb1662
Bug 42847: [24.11] Fix unit test 2026-08-06 14:49:59 +00:00
Baptiste Wojtkowski 34190cd1d2
Revert "Bug 42726: Add 26.11 release team"
This reverts commit ee71d95015.
2026-08-06 08:48:15 +00:00
Kyle M Hall 5472968ec6
Bug 42847: [24.11] Prevent previously authenticated user (squashed)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-07-30 12:39:27 +00:00
Martin Renvoize ffad3df351
Bug 30233: (follow-up) Fix POD formatting codes in _apply_substitution
The angle-bracket delimiter notation in the POD prose (e.g.
PATTERN<DELIM>) caused the POD parser to treat the trailing letter of
each word as an unknown formatting code (N<>, T<>). Replace with
C<s/PATTERN/REPLACEMENT/FLAGS> and a parenthetical note that any
non-space delimiter is accepted.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 12:18:02 +00:00
Martin Renvoize 86a4896fd1
Bug 30233: (follow-up) Add tests for _apply_substitution and combined modifiers
- t/C4/ClassSplitRoutine/RegEx.t (new): exercises _apply_substitution via
  the public split_callnumber interface — basic substitution, alternate
  delimiters, \n/$n backrefs, /gi combined flag, /e rejection, and malformed
  or uncompilable rules (including the new logger warn path).
- t/Koha/Regex/Replacement.t: extend the subst() helper to handle the ig/gi
  combined modifier and add a subtest that confirms case-insensitive global
  replacement and backref case preservation.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 12:18:01 +00:00
Martin Renvoize 4bab6bf37f
Bug 30233: (follow-up) Log a warning when _apply_substitution discards a bad pattern
When eval { qr/$pattern/ } fails (e.g. the admin-configured s/// contains
an invalid regex), _apply_substitution previously returned silently with no
indication of why the rule was skipped. Add a Koha::Logger warn so the
failure appears in the log and is diagnosable without a debugger.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 12:18:00 +00:00
David Cook b6620915af
Bug 30233: (follow-up) fix some errors reported by QA tools
Note: While the methodology in Koha::Regex::Replacement may seem
bespoke, it's similar to how Python's re.sub(pattern, repl, string)
regex substitution works.

Unit tests:
prove -v t/Koha/Regex/Replacement.t \
    t/SimpleMARC.t \
    t/db_dependent/MarcModificationTemplates.t \
    t/Labels_split_Regex.t

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 12:17:58 +00:00
Sanjar Tulkinov Anvar o'g'li 868b54beb7
Bug 30233: Stop running call number split regexes as code
C4::ClassSplitRoutine::RegEx::split_callnumber ran the admin-configured rule
through eval "\$cn_item =~ $regex", executing arbitrary Perl. Parse the
rule as s<DELIM>PATTERN<DELIM>REPLACEMENT<DELIM>FLAGS, reject the /e flag,
compile the pattern with qr// and expand the replacement as data via
Koha::Regex::Replacement::expand_template, so the rule is applied without
eval.

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 12:17:56 +00:00
Sanjar Tulkinov Anvar o'g'li 9f6b0da7ac
Bug 30233: Stop running MARC modification replacements as code
Koha::SimpleMARC::_modify_values and Koha::Items::apply_regex wrapped the
user replacement in a string and ran it through s///ee, so an interpolation
block such as \@{[ system(...) ]} executed arbitrary Perl. Expand the
replacement as data via Koha::Regex::Replacement::expand_template under a
single /e instead, which keeps capture-group replacements working but never
runs the input as code.

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 12:17:00 +00:00
Sanjar Tulkinov Anvar o'g'li 4f021a1f1f
Bug 30233: Add Koha::Regex::Replacement to expand replacements as data
Add a small single-pass helper, Koha::Regex::Replacement::expand_template,
that expands a user-supplied regex replacement string as data: numbered
backreferences ($1..$n, ${n}, the legacy \1..\9 form), named captures
($+{name}, ${name}) and the \n \r \t escapes. Every other character is
copied through literally, so \@{...}/${...} interpolation blocks end up as
text rather than being run. This is used to replace the s///ee double-eval.

The routine is fully qualified at the call sites rather than exported, and
case folding is left out to keep it small.

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 12:15:00 +00:00
Martin Renvoize 606f33b3d6
Bug 42746: (QA follow-up) Sanitize agefield and substitution field at the sink too
The original fix only whitelisted agefield, condition_field, and
substitution_field at the point they're saved in
tools/automatic_item_modification_by_age.pl, leaving the actual
consumer of the stored syspref, C4::Items::ToggleNewStatus, trusting
agefield and substitution field unchecked. agefield is spliced
directly into raw SQL (TO_DAYS($agefield)) and so can't be
parameterized like an ordinary value; substitution field reaches a
dynamic method call ($item->$field($value)). Any future or
alternate writer of the automatic_item_modification_by_age_configuration
syspref would have reopened both holes without touching the form at
all.

This adds the same allow-list validation directly in ToggleNewStatus
(falling back to the safe default agefield, or skipping the
substitution/condition, exactly as before for missing values), shares
the age-field allow-list between the two files via a new
GetAutomaticItemModificationAgeFields() in C4::Items so it can't drift
between them, and logs rejected values via Koha::Logger instead of
silently discarding them so tampering leaves an audit trail.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-07-30 10:29:28 +00:00
Jonathan Druart 3624bf8caa
Bug 42746: Sanitize condition and substitution fields
Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>

Amended-by: Jonathan Druart:
Replace , with ;

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 3b53d6711d)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 10:27:41 +00:00
Jonathan Druart f7194d2173
Bug 42746: Sanitize age_field
Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
(cherry picked from commit 5cf846f9f8)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 10:27:40 +00:00
Martin Renvoize cbc7086677
Bug 42747: (QA follow-up) Parameterize query, dedupe, and log rejections
The original fix only whitelisted image_name at the point it's saved
in edit-layout.pl, leaving the actual injection sink in create-pdf.pl
unparameterized. This adds defense-in-depth by fixing the query itself,
avoids a redundant duplicate call to get_all_image_names() (already
fetched earlier in the script as $image_names), and logs rejected
image_name values instead of silently discarding them so tampering
attempts leave an audit trail.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 5b825da072)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 10:27:39 +00:00
Jonathan Druart 26418d381e
Bug 42747: Prevent SQL injection via image_name in edit-layout
Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit dc4403aae0)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 10:27:38 +00:00
Jonathan Druart 1a552017ac
Bug 42866: Prevent SQL injection in Koha::AddtionalContents->search_for_display
Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit c5968932fc)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 10:27:37 +00:00
Pedro Amorim 224945dc60
Bug 39900: Preparation: Refactor public_query_search_params for reusability
Ensure no regressions are introduced, run:
prove t/db_dependent/Koha/AdditionalContents.t

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>
2026-07-30 10:27:33 +00:00
Jonathan Druart 46eb21993c
Bug 42749: Prevent SQL injection from GetInvoices (order_by)
Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit cb22264499)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 10:11:25 +00:00
Laura_Escamilla 605b6fc4b5
Bug 43019: Prevent access to pages belonging to another library (staff side)
To test:
1. Create two patron accounts:
    * One patron whose home library matches the library assigned to the page.
    * One patron whose home library is different from the library assigned to the page.
2. Create a new page with the following settings:
    * Display location = OPAC
    * Library = a specific library
    * Publication date = Today
    * Title and Content = minimally necessary content
3. Save the page.
4. Right-click the OPAC link and copy the link address.
5. Open the link in an incognito or private browser window without signing in.
    * Confirm that the library-specific page is not displayed.
    * Confirm that a 404 page is shown.
6. In the incognito window, sign in using the patron account whose home library matches the page library.
7. Open the copied OPAC link again.
    * Confirm that the page is displayed.
8. Sign out and sign in using the patron account whose home library does not match the page library.
9. Open the copied OPAC link again.
    * Confirm that the page is not displayed.
    * Confirm that a 404 page is shown.
10. Edit the page and change Library to All libraries.
11. Open the OPAC link in an incognito or private browser window without signing in.
    * Confirm that the page is displayed.
12. While signed in as each patron account, open the OPAC link again.
    * Confirm that the page is displayed for patrons from both libraries.
13. Create or edit a page with the following settings:
    * Display location = Staff interface
    * Library = a specific library
    * Publication date = Today
    * Title and Content = minimally necessary content
14. Sign in to the staff interface using a staff account whose library matches the page library.
15. Open the page from the staff interface.
    * Confirm that the page is displayed.
16. Sign out and sign in using a staff account whose library does not match the page library.
17. Open the staff page link directly.
    * Confirm that the page is not displayed.
    * Confirm that a 404 page is shown.
18. Edit the staff page and change Library to All libraries.
19. Open the page while signed in with staff accounts from both libraries.
    * Confirm that the page is displayed for both accounts.
20. Repeat the OPAC and staff interface checks using Display location = Staff interface and OPAC.
    * Confirm that the page is displayed in both interfaces for users from the matching library.
    * Confirm that users from a different library receive a 404 page.
    * Confirm that pages assigned to All libraries are available in both interfaces.

Signed-off-by: David Cook <dcook@prosentient.com.au>
(cherry picked from commit 2dff8abf7f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 09:31:00 +00:00
David Cook 16299d41ab
Bug 43019: Fix branch comparison
This change fixes the branch comparison between the Page
and the user. Previously, it was doing a numeric "!=" and now it
does the string comparison "ne". Also, if no environmental variable
is set for the default branch, it defaults to an empty string
for anonymous (ie non-authenticated) users.

Test plan:
0. Apply the patch
1. restart_all
2. Log into the staff interface
3. Go to Tools
4. Click on "Pages"
5. Create a Page for All Libraries for the OPAC
6. Copy the "OPAC" link in the "Page URL" table cell and open it
in a private window or a separate browser
7. Note that the page appears
8. Now change the "Page" to a specific library
9. Revisit the URL in the private window
10. Note that it now gives a 404 error
11. Log into the OPAC with a user whose library matches the libary
of the Page
12. Note that now you can view the URL again
13. Change the library of the user or the Page
14. Note that you cannot see the Page now

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 16df1a33b2)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-30 09:30:27 +00:00
Andrew Fuerste Henry a042773a78
Bug 41292: Rename whitelist to allowlist and add force_password_reset_when_set_by_staff
To test:
1 - Attempt to save a report containing "select force_password_reset_when_set_by_staff from categories"
2 - observe koha prevents this save
3 - apply patch, restart services
4 - repeat step 1
5 - observe your report now saves and runs successfully

While adding this new field to the list of allowed fields, I changed "whitelist" to "allowlist" as suggested by the terminology guide: https://wiki.koha-community.org/wiki/Terminology

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 fdc57489a1)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit be019f4f92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-22 11:24:30 +02:00
Martin Renvoize 305ccb6482
Bug 41510: (RM follow-up) Perltidy a missed file at merge time
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 7fd796d8f8)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit fd9be777fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-22 11:17:25 +02:00
Paul Derscheid c4e7d5109a
Bug 41510: Handle undefined itemtype in item->effective_bookable
- Guard against undefined itemtype before calling ->bookable on it
- Return 0 (not bookable) when no itemtype is found and item-level
  bookable is not defined

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 99410bc27c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 327cb59546)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-22 11:17:24 +02:00
Paul Derscheid d524290897
Bug 41510: Add test for effective_bookable with missing itemtype
- Add test case for the scenario where an item has no itemtype
  because both items.itype and biblioitems.itemtype are NULL
- Note: We must set biblioitems.itemtype to NULL before creating the
  item because Koha::Item->store() automatically populates itype from
  biblioitems.itemtype when itype is not set

Test plan:
- Apply this patch only
- Run: prove t/db_dependent/Koha/Item.t :: effective_bookable
- Verify test 6 FAILS with "Can't call method 'bookable' on an
  undefined value"
- Apply the follow-up patch
- Run the test again
- Verify all tests PASS

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 26ffc16c38)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 00457f7e73)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-22 11:17:23 +02:00
Hammat Wele 0228735b8b
Bug 41102: Error 500 on the About page when biblioserver Zebra configuration is missing
When either the <listen id=biblioserver> entry or the
<server id=biblioserver listenref=biblioserver> section
is not present in koha-conf.xml, the Staff interface > About page
triggers a 500 Internal Server Error.

Test plan:
1. Edit koha-conf.xml and Comment out:
   <!--<listen id="biblioserver">unix:/path/to/zebradb/bibliosocket</listen>-->
2. Restart Apache: sudo systemctl restart apache2 (or restart_all)
3. Go to Intranet > About
   ==> Internal Server Error (500)
4. Now restore the <listen> line and instead comment out the entire
   <server id=biblioserver listenref=biblioserver>...</server> block.
   (Note that the commenting around <!-- The stuff below is used to enable SRU...
    interferes with adding a closing comment after </server> -
    close the comment before that section and add a comment around </server>.)
5. Repeat step 2, 3
   ==> Internal Server Error (500)
6. Apply the patch
7. Repeat step 2, 3
   ==> There is no Error (500)
       Note: Zebra status: Error message from Zebra: 10004
8. Uncomment <server id=biblioserver  listenref=biblioserver> </server>
   and Repeat Step 1
9. Repeat step 2, 3
   ==> There is no Error (500)
       Note: Zebra status: Zebra server seems not to be available. Is it started?

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 03fc6994a5)
Signed-off-by: Chloé Zermatten <chloe.zermatten@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 1b837562b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:33:47 +02:00
Andreas Roussos 5e0d278eab
Bug 41337: Add missing Bash variable to `koha-create`
When creating a new Koha instance using the two-step workflow
(`koha-create --request-db <instance>`, followed by
`koha-create --populate-db <instance>`), some log files under
/var/log/koha/<instance>/ end up with incorrect ownership.

Specifically, intranet-error.log and opac-error.log are owned
by root:root instead of <instance>-koha:<instance>-koha.

This patch fixes that.

Test plan (tailored for KTD):

1) Before applying this patch, run the following commands
   inside your KTD Koha container:

   $ sudo koha-create --request-db test1
   $ SQLPASS=`sudo grep password: test1-db-request.txt | cut -c 16-`
   $ mysql -hdb -uroot -ppassword -e "CREATE DATABASE koha_test1;"
   $ mysql -hdb -uroot -ppassword -e "GRANT ALL PRIVILEGES ON koha_test1.* TO 'koha_test1'@'%' IDENTIFIED BY '${SQLPASS}';"
   $ mysql -hdb -uroot -ppassword -e "FLUSH PRIVILEGES;"
   $ sudo koha-create --populate-db test1

   $ ls -l /var/log/koha/test1/
     total 8
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 indexer-error.log
     -rw-r--r-- 1 test1-koha test1-koha 1278 Feb  9 15:35 indexer-output.log
     -rw-r--r-- 1 root       root          0 Feb  9 15:35 intranet-error.log
     -rw-r--r-- 1 root       root          0 Feb  9 15:35 opac-error.log
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 worker-error.log
     -rw-r--r-- 1 test1-koha test1-koha 1828 Feb  9 15:35 worker-output.log
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 zebra-error.log
     -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:35 zebra-output.log

   Notice the incorrect user/group ownership on two
   files: `intranet-error.log` and `opac-error.log`.

2) Apply this patch, remove the `test1` instance along
   with the database request text file, and copy the
   modified script to its system-wide location:

   $ sudo koha-remove test1
   $ sudo rm test1-db-request.txt
   $ sudo cp debian/scripts/koha-create /usr/sbin/koha-create

3) Repeat the commands in Step 1. This time, the output of
   the last command should resemble the following:

   total 8
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 indexer-error.log
   -rw-r--r-- 1 test1-koha test1-koha 1520 Feb  9 15:42 indexer-output.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 intranet-error.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 opac-error.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 worker-error.log
   -rw-r--r-- 1 test1-koha test1-koha 1828 Feb  9 15:42 worker-output.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 zebra-error.log
   -rw-r--r-- 1 test1-koha test1-koha    0 Feb  9 15:42 zebra-output.log

   All files should now have the correct user/group ownership.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7ee861e256)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit a45a642f35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:24:52 +02:00
Jonathan Druart 98cb9971ff
Bug 42277: Remove JS error when viewing a subscription
If no orders exist yet, there is a JS error in the console:
Uncaught TypeError: can't access property "DataTable", table is
undefined

Test plan:
0. Do no apply this patch
1. Create a new subscription and go to the detail view
2. Open the console and notice the JS error
3. Apply this patch
4. Confirm that the JS error is gone
5. Create an order from this subscription
6. Confirm that the orders table is displayed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit da121583a4)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit da718a2a57)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:16:50 +02:00
Jonathan Druart c188a80fbc
Bug 40744: Ignore --del-exp-selfreg if pref is not set
If PatronSelfRegistration we should ignore (i.e. do nothing) if
--del-exp-selfreg is passed to cleanup_database.pl

It prevents the script to warn that the pref is not set.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit d331c7aba8)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 768f2a4882)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:15:32 +02:00
David Cook bc16381ca5
Bug 42317: Update minimum version for MARC::File::XML
This patch updates cpanfile to reflect the real minimum version
needed for MARC::File::XML. This is particularly important
due to vulnerabilities in version 1.0.1

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: mason james <mtj@kohaaloha.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 00655de4d0)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 8943833fb1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:14:34 +02:00
Hammat Wele f970d0b7f3
Bug 41690: (follow-up) Add 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 a0b92c0bb6)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 9b394ddb7a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:12:38 +02:00
Hammat Wele a969fe51a2
Bug 41690: Add MARC21 245 (subtitle) to Cite option
The "Cite" option in the OPAC is missing the subtitle (245) in MARC21.

To recreate:
1. Add a record or find a record with a subtitle (in KTD, biblionumber 58 has a 245 http://localhost:8081/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=58
2. In the OPAC, go to the record
   http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=58
3. Click "Cite"
   --> The subtitle is not in any of the citations
4. Apply the patch
5. Repeat step 2 and 3
    --> The subtitle is now shown

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 412e4e4d95)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit ea6fd886a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:11:19 +02:00
Lucas Gass a524dbd403
Bug 42262: encodeURIComponent for the 006 value
To test:
1- have a MARC record with Type of Material "BKS - Books" that does not have an 006 defined (biblio 1 in the KTD default data will work)
2- edit the biblio in the basic editor
3- open the tag editor for the 006
4- observe that the values along the top of the tag editor window show a value of "" (blank) in position 17
5- click Save in the tag editor window
6- confirm that the values in the 006 tag end with a space
7- open the 006 tag editor again
8- observe that the values along the top of the tag editor window no longer show any value for position 17. Instead, they end with the zero in position 16
9- click Save in the tag editor window
10- confirm that the values in the 006 tag now end with a zero, not followed by a space
11- save your biblio
12- edit the biblio in the basic editor again, get warning "The following fixed-length control field(s) have an invalid length: 006. Please fix."
13- APPLY PATCH and restart_all
14. Try editing the 006 value again, the whitespace should be preserved and you get no error.

Signed-off-by: Justin Swink <Justin.Swink@littleelm.gov>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1a0501f5e8)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit f26f323aee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-17 14:09:03 +02:00
Lucas Gass b25d8814ae
Bug 37143: Do not allow required fields with only whitespace to be submitted
To test:
1. Make some fields for OPAC self registration required.
2. Create a new patron via self reg.
3. Fill out those required fields as an empty string like "  ".
4. Submit the form, it succeeds.
5. APPLY PATCH, restart_all
6. Try again. Required fields with only whitespace are treated as if they were empty.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 12426b5924)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 01df1563bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-08 07:39:35 +02:00
Paul Derscheid 5563202f84
Bug 41352: Add link to the manual for the Bookings to Collect page
To test:
- Go to Circulation > Bookings to collect
- Click Help
- Verify it links to the correct manual section

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 f53159bfa4)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit d6f529c38c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-08 07:39:34 +02:00
Jonathan Druart dc4144ff7b
Bug 42130: ERM - Index biblio when local title is created/updated
The indexation step has been removed by
  commit d2820f57d6
  Bug 34788: (QA follow-up)

Koha/ERM/EHoldings/Title.pm
-            C4::Biblio::ModBiblio( $record, $self->biblio_id, '' );
+            C4::Biblio::ModBiblio( $record, $self->biblio_id, '', { skip_record_index => 1 } );

From the commit message:
2) The background job now uses skip_record_index to avoid queuing indexing jobs for every new biblio and instead queues one job at the end

it's then missing when we add or edit a local title.

Test plan:
1 - Enable ERMModule
2 - Go to ERM
3 - eHoldings->Titles
4 - New title
5 - Populate the form
6 - Check the create bibliographic record box
7 - Save
=> Confirm that the biblio is now indexed
8. Edit the title, modify a value, tick the box, save
=> Confirm that the biblio is now indexed with the new value

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5dcec8b803)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 1dac2edcf6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-08 07:39:34 +02:00
Eric Phetteplace 379794d548
Bug 42723: Purchase suggestion 500 when EmailPurchaseSuggestions is set to BranchEmailAddress
Testing plan:
- Set EmailPurchaseSuggestions to BranchEmailAddress
- Go to create suggestion on the staff side /suggestion/suggestion.pl?op=add_form
- Create a suggestion with Library: Any
- 500 error: inbound_email_address is not a method of undef
- Apply patch & repeat
- Suggestion created

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 33a8dc5d6f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit f699bb4c50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-08 07:39:33 +02:00
Martin Renvoize ee71d95015
Bug 42726: Add 26.11 release team
Add the 26.11 release team as voted at the development meeting.

Pedro Amorim as Release Manager, with Tomás Cohen Arazi and Martin
Renvoize as RM Assistants. Lisette Scheer as QA Manager with a
19-person QA team. David Cook as Security Release Manager.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f0bb03d6e9)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit bbff807136)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-07-08 07:39:32 +02:00
Martin Renvoize 63bf386697
Bug 42726: Fix 25.11 QA team list to match dashboard
Update the 25.11 QA team to reflect the definitive list from the
dashboard. Remove Aleisha Amohia and Julian Maurice who did not
appear in the final count, and add John Vinke, Matt Blenkinsop,
Alex Carver and Victor Grousset who did. Reorder by descending
QA count.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5d12a83751)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-07-08 07:39:31 +02:00
Fridolin Somers 926655c0a8
Update release notes for 24.11.17 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-24 10:34:08 +02:00
Fridolin Somers bd3ef5f037
Increment version for 24.11.17 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-24 10:20:07 +02:00
Jonathan Druart 8ddc98a6fc
Bug 42735: [24.11] Fix SQL injection
This change fixes an SQL injection in the circulation stats.

Test plan:
0. Apply the patch
1. sudo koha-plack --restart kohadev
2. Go to /cgi-bin/koha/reports/issues_stats.pl
3. Try out a bunch of options
4. Try to break it
5. Note that you just get output and no errors

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit da14a2f672330d445b442cd057bd72688bfb0c37)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-18 15:50:41 +02:00
Jonathan Druart caa66ac91f
Bug 42369: [24.11] Use C4::Context::csv_delimiter for delimiter validation
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bd98e67192f955faf402b56f8933bc3997ce9e7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-18 15:50:41 +02:00
David Cook f6049a2d27
Bug 42369: [24.11] Fix SQL injection
This change fixes SQL injection in bor issues top

Test plan:
0. Apply patch
1. sudo koha-plack --restart kohadev
2. Go to /cgi-bin/koha/reports/bor_issues_top.pl
3. Try out all the different options
4. Try to break it
5. Note that you get output and no errors

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0d1efd812b9d1d6ac8fe71b7115f5368b8ba271f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-18 15:50:41 +02:00
Jonathan Druart 79b9b1cd91
Bug 42368: [24.11] Use C4::Context::csv_delimiter for delimiter validation
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit ab36cbffc837a3e7ac7dcd501fb510ea5c7059b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-18 15:50:40 +02:00
David Cook 92865a3bec
Bug 42368: [24.11] Fix SQL injection in issue avg stats
This change fixes SQL injection in issues avg stats

Test plan:
0. Apply the patch
1. sudo koha-plack --restart kohadev
2. Go to /cgi-bin/koha/reports/issues_avg_stats.pl
3. Try out all the different options
4. Try to break the report
5. Note that you always get output instead of errors

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit f0d3bf850b8ff85c9393126763b1477d1cdc5c09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-18 15:50:40 +02:00
Jonathan Druart 202dafc63b
Bug 42363: [24.11] Use C4::Context::csv_delimiter for delimiter validation
(cherry picked from commit 710c20075396beaeee056efeec28fc95d10fbb1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-18 15:50:39 +02:00
David Cook 171c7044fd
Bug 42363: [24.11] Fix SQL injection
This change cixes an SQL injection in cat stats

Test plan:
0. Apply patch
1. sudo koha-plack --restart kohadev
2. Go to /cgi-bin/koha/reports/catalogue_stats.pl
3. Try out different values
4. Try to break the report
5. Note that you just get output and not errors

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>
(cherry picked from commit a9f741b79d231d81e7cdaef2201b8c00c9efe349)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-18 15:50:39 +02:00
Jonathan Druart bfe9cfa6f4
Bug 42360: [24.11] Move separator validation to C4::Context::csv_delimiter
So we protect other calls

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-06-18 15:50:38 +02:00
David Cook a4a23224d0
Bug 42360: [24.11] Also validate sep param
Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-06-18 15:50:38 +02:00
David Cook 9888d6745f
Bug 42360: [24.11] Fix SQL injection
This change fixes an SQL injection in the acq stats.

Test plan:
0. Apply the patch
1. sudo koha-plack --restart kohadev
2. Go to /cgi-bin/koha/reports/acquisitions_stats.pl
3. Try out a bunch of options
4. Try to break it
5. Note that you just get output and no errors
NOTE: In a fresh KTD you likely don't have any actual statistics

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-06-18 15:50:37 +02:00
Fridolin Somers 178312e403
Bug 39301: (RMaint follow-up) Fix missing var Koha::Statistic::pseudonymization_types 2026-06-18 15:47:31 +02:00
David Cook ae0aacd76b
Bug 41045: Fix BZ 33363 database update
This patch fixes the BZ 33363 database update, so that it
selects uses with the "suggestions" permission rather than the "catalogue"
permission.

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 0442f4ce2c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 4c8e0f0a6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-06-17 14:45:33 +02:00
Baptiste Wojtkowski 76e3b6ec92
Bug 38414: [24.11.x] (follow-up) Fix template syntax 2026-05-29 12:41:59 +00:00
Baptiste Wojtkowski a1f7766ac9
Update release notes for 24.11.16 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-28 10:28:30 +00:00
Baptiste Wojtkowski 1483f4b24e
Increment version for 24.11.16 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-28 10:16:50 +00:00
David Cook 1c543663e5
Bug 42361: Fix SQL injection in catalogue_out.pl
This change removes an SQL injection vulnerability from catalogue_out.pl

Test plan:
0. Apply the patch
1. Go to koha-conf.xml and change the following:
<strict_sql_modes>1</strict_sql_modes>
to:
<strict_sql_modes>0</strict_sql_modes>
2. sudo koha-plack --restart kohadev
3. Go to /cgi-bin/koha/reports/catalogue_out.pl
4. Try out the various options and note no errors occur

Signed-off-by: Sanjar Tulkinov Anvar o'g'li <sanjarbiy11@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-05-28 10:12:20 +00:00
Jonathan Druart ea94cfd31b
Bug 38414: [24.11.x] Fix permission controller-side
This bug refactors the preview sql buttons to pass the permissions granted for each report to
the javascript that clones and updates the modal.

That allows us to check for the appropriate permissions when preparing the buttons for the modal
and to remove any that are not allowed.

This allows for different permissions per report for future devs
(see bugs 42406, 16631)

To test:
1. Create some reports
2. Create a user with only execute_reports permissions
3. Login as that user and go to Reports > use saved
4. In the actions column click the ^ and select 'Preview sql'
5. Notice delete button renders and works to delete
6. Apply patch and restart_all
7. Repeat step 4, now only the Run report button renders and works
8. Add permissions for create_reports
9. Repeat step for, now Edit, Duplicate, Schedule and run buttons render and work
10. Add permissions for delete_reports
11. Repeat step 4, confirm the delete button renders and works
12. Confirm the preview sql button works to preview different reports

We also fix some error in the script, several wrong things there:
* delete was not replaced with cud-delete
* missing op for the creation of new reports
* update and run requires two permssions

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Scott Barter <sbarter@aacpl.net>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-28 10:09:20 +00:00
Fridolin Somers 61056b323e
Bug 42224: (Bug 40524 follow-up) [24.11.x] Fix XSS in columns_settings.inc
Bug 40524 fixed XSS issue in koha-tmpl/intranet-tmpl/prog/js/datatables.js

But in 24.11 and lower, DataTable are also build with koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc
So same fix needs to applied.

Also in 24.11.x and lower the columns use "noExport" instead of "no-export"

Test plan:
Use the one from Bug 40524

Signed-off-by: David Cook <dcook@prosentient.com.au>
2026-05-28 09:13:49 +00:00
Baptiste Wojtkowski 0aafc9a60a
Revert "Bug 41976: LinkWrapper no longer mangles links"
This reverts commit 7e16e85e4f.
2026-05-28 08:43:52 +00:00
Martin Renvoize c58d465cfc
Bug 29923: Prevent overpayment credit when written-off accruing fine is adjusted on check-in
When a staff member writes off an accruing fine and the item is
subsequently checked in (backdated or in fine-free mode), the fine
amount is recalculated downward via adjust(). The previous code
unconditionally created an OVERPAYMENT credit whenever the adjusted
outstanding went negative, regardless of whether the existing credits
were reversible payments or non-reversible writeoffs/discounts.

This caused patrons to receive an erroneous credit equal to the
written-off amount, since writeoffs should simply be absorbed when
the underlying fine shrinks - no refund is due.

The fix calculates the total non-reversible credits (writeoffs,
discounts, cancellations) applied to the debit using the existing
filter_by_non_reversible method, and only generates an OVERPAYMENT
credit for the portion attributable to reversible cash payments that
exceed the recalculated fine amount.

Test plan:
1. Write off an accruing fine in full
2. Check the item in (backdated or fine-free)
3. Confirm no overpayment credit is generated for the patron

Signed-off-by: Benjamin Daeuber <BDaeuber@fargolibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 44483cab32)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 15:03:29 +00:00
Hammat Wele 28f5ca133f
Bug 40787: Plugins buttons misaligned when search box is enabled
The buttons in the plugins home page ("Upload plugin" and "View plugins by class") become misaligned when you have the git repository search bar.

To test:

1. Add a github/gitlab repository in koha-conf.xml
  - In ktd shell, open /etc/koha/sites/kohadev/koha-conf.xml
  - Somewhere under <config> insert the following (or your own)

<plugin_repos>
  <repo>
   <name>Solutions inLibro</name>
   <org_name>inLibro</org_name>
   <service>github</service>
  </repo>
</plugin_repos>

  - Save the file
  - restart_all

2. Go to Administration > Manage plugins
--> Buttons are misaligned

3. Apply the patch

4. Run command « yarn build »

5. Repeat step 2
--> buttons are aligned nicely

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit d2d49dfdc6)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 15:00:42 +00:00
Lucas Gass be51075081
Bug 41417: Fix client variable in cataloging.js
To test:
1. Find or create a record in Kkoha.
2. From the record detail page click "Edit" and "Manage items"
3. Begin adding a new item
4. For any of the dropdowns that contain an authorized value ( LOST, DAMAGED, WITHDRAWN, CCODE, LOC ) click on the dropdown and begin typing an AV that doesn't exist.
5. You should see the text (select to create) appear, click it.
6. Now a modal appears "Create a new authorized value"
7. Fill out the required parts and click 'Save'.
8. Kaboom, 500 error:
9. APPLY PATCH, clear browser cache.
10. Try again, this time it should work.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 4ba95d70e8)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 14:53:57 +00:00
Marcel de Rooy 3befc5ead3
Bug 41444: (QA follow-up) Rearrange comments
It would be at least helpful to add a reference to get_transfer here,
since we are replacing it here.
Used the opportunity to update the older comments

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit eaa354e277)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 14:51:52 +00:00
Nick Clemens e6baeae088
Bug 41444: Search for transfers directly
This patch removes a fetch of the item object followed but get_transfer to simply search the
transfers by itemnumber and status

To test:
1 - Add many items to your records
    https://github.com/kidclamp/handy-koha-script/blob/main/randitems.pl
    NOTE: this script makes a lot of items withdrawn or damaged, undo that for more dramatic difference
    UPDATE items SET withdrawn=0,damaged=0
    perl misc/search_tools/rebuild_elasticsearch -v
2 - Set Koha system preferences to display more results and check more items:
    maxItemsInSearchResults 60
    numSearchResults 50
3 - Do a search, several times, note the time it takes
4 - Apply patch, restart all
5 - Repeat search several times, note the time it takes
6 - Confirm it is better after the patch

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 5d62b4f614)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 14:50:59 +00:00
Kevin Carnes a41c884e05
Bug 41496: Update current URL for item search
The "Copy shareable link" button on the item search table creates a link
based on the current URL, but an item search does not update the current URL
with the search parameters.

This patch copies the code to generate the URL with search parameters and
uses it to update the current URL.

Test plan:
1. Click "Item search".
2. Perform an item search (e.g. Home library is Centerville).
3. Click the "Copy shareable link" button on the right side of the screen
   above the table.
4. Paste and visit the link.
5. Observe that you only see the search page without any results.
6. Apply patch.
7. Repeat steps 1-4.
8. Observe that you see the results with the table settings.
9. Sign off.

Sponsored-by: Lund University Library
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit bfd33ed339)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 14:48:23 +00:00
David Cook c3bd70316c
Bug 41518: Only show autorenewal text if autorenewal allowed
This change makes the "Scheduled for automatic renewal" text appear
in the staff interface and OPAC only if both the issue has auto_renew
and the borrower has autorenew_checkouts set. These are the criteria that
automatic_renewals.pl uses for processing automatic renewals.

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Checkout an item as an automatic renewal
(ie either set it as Automatic renewal using the checkout option or have
 the circ and fines rules set to use Automatic renewals)
3. View the checkout in both the staff interface and the OPAC
4. Note that they both show "Scheduled for automatic renewal" or
"This item is scheduled for auto renewal" for the OPAC
5. In the patron record change "Allow auto-renewal of items" from
"Yes" to "No"
6. Note that the text talking about the item being scheduled
for automatic renewal no longer displays

Bonus points:
1. Run 'perl ./misc/cronjobs/automatic_renewals.pl -v'
2. Note that the automatic renewal doesn't show when "Allow auto-renewal
of items" is set to "No" but it does show when it's set to "Yes"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 99e9bcf25e)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 14:43:37 +00:00
Slava Shishkin 9c5a78286a
Bug 41675: Fix Quick add patron username being overwritten
Test plan:
1. In system preferences, set PatronQuickAddFields to include userid
   (Username).
2. Go to Patrons and choose Quick add new patron.
3. Fill at least Surname, Card number, and Username
   (use a value clearly different from a surname-based username).
4. Save the patron.
5. Observe on the patron details page that Username is auto-generated
   (not the value entered in quick add).
6. Apply this patch.
7. Repeat steps 2-4 with a new patron.
8. Verify on the patron details page that Username now matches the
   value entered in quick add.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 8903df398a)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:56:39 +00:00
Roman Dolny 33a67c0311
Bug 41715: Argument "YYYY-MM-DD" isn't numeric in numeric lt (<)... warnings in issues_stats.pl
The warnings:
[WARN] Argument "YYYY-MM-DD" isn't numeric in numeric lt (<)
    at /kohadevbox/koha/reports/issues_stats.pl line 224.
appears in the plack-intranet-error.log.
It happens because a numerical comparison was used to compare the dates
instead of a string comparison.

To test:
========
1. Observe plack-intranet-error.log.
2. In staff interface go to Reports > Statistics wizards > Circulation.
3. Select date "From" and date "To" then submit.
4. Two warnings appear in plack-intranet-error.log.
5. Apply the patch; restart_all.
6. Repeat 2-3. No warnings appear in log.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 330d148704)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:54:47 +00:00
Kyle M Hall 41ca027f44
Bug 41818: Add unit tests
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 3df6e51d72)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:54:33 +00:00
Jake Deery 204400bed2
Bug 41818: Add new Koha::Patron::Message method to SIP2
This bug adds Koha::Patron::Message::message_without_newlines, which has been added to C4::SIP::ILS::Patron in lieu of Koha::Patron::Message::message. The aim of this change is to prevent SIP2 units from crashing out when they encounter a patron message with newlines (\n or \r) in it, as units generally use a newline character to denote the end of a SIP2 transaction.

To test:
a)  go to /cgi-bin/koha/sip2/institutions
    *)  create an institution, name CPL, timeout 300, the rest default
b)  go to /cgi-bin/koha/sip2/accounts
    *)  create an account, userid koha, institution CPL, terminator crlf, the rest default
c)  go to /cgi-bin/koha/members/moremember.pl?borrowernumber=51
    *)  click add message in toolbar
    *)  enter some multi-line message e.g. test[RETURN]1[RETURN]2[RETURN]3[RETURN][RETURN][RETURN]
d)  run tail -f /var/log/koha/kohadev/sip-output.log, keep this window open
e)  run ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l CPL --patron 42 -m patron_information
f)  look at the tail log, notice how the MSG 64 line has a newline before the final pipe (|) character
== APPLY PATCH ==
g)  restart_all
h)  repeat steps e-f
i)  notice how in the tail log, the MSG 64 line now has the final pipe character contiguously placed with the successive characters
== SIGN OFF ==

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit a16316a5c3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:54:06 +00:00
Kyle M Hall 9b8cc84815
Bug 41811: SIP server will inadvertently remove non-alphanumeric characters from the end of a message
If a message ends in a non-alphanumeric character, that character is stripped from the message.

For example:
6300120260210    182641          AOMPL|AA23529000035676(|

64              00120260210    182831000000000000000000000000AOCPL|AA23529000035676|AEHenry Acevedo|BLY|BHUSD|BV0|CC5|BD4345 Library Rd. Springfield, MA 44224|BF(212) 555-1212|PB19580530|PCS|PIY|AFGreetings from Koha. |

versus:
6300120260210    182641          AOMPL|AA23529000035676(|ACkoha|

64YYYY          00120260210    182835000000000000000000000000AOCPL|AA23529000035676(|AE|BLN|AFInvalid cardnumber|

The former should be returning the same "Invalid cardnumber" message the latter does.

Test Plan ( assumes you are using KTD ):
1) Install telnet: sudo apt install -y telnet
2) telnet 127.0.0.1 6001
3) Log in with: 9300CNkoha|COkoha|CPMPL|
4) Send the patron information request: 6300120260210    183346          AOMPL|AA23529000035676(|
5) Note you get a patron back
6) Apply this patch
7) Restart SIP!
8) Repeat steps 2-5
9) Noe you doe not get a patron back in the response!

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>
(cherry picked from commit 4a03a9dce2)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:53:26 +00:00
Paul Derscheid 7d8d1da5a0
Bug 41886: Filter checkouts to bookable items in check_booking
- Biblio::check_booking counts current checkouts toward the
  unavailable pool to detect booking clashes
- It counts checkouts on ALL items for the biblio, including
  non-bookable ones (e.g. items with an excluded item type)
- When only a subset of items are bookable, checkouts on
  non-bookable siblings incorrectly reduce the available pool,
  producing false clashes
- Restrict the checkout query to only count items whose
  itemnumber is in the bookable items set

To test:
1. Have a biblio with at least two items, where one item is
   bookable and the other is not (bookable = 0).
2. Check out the non-bookable item to a patron.
3. Attempt to create a booking for the bookable item.
4. Without the patch: a clash is detected even though the
   bookable item is available.
5. Apply the patch.
6. Repeat steps 2-3.
7. Verify the booking succeeds without a false clash.
8. Run: prove t/db_dependent/Koha/Biblio.t
   and confirm the new subtest
   "checkouts on non-bookable items do not cause false clashes"
   passes.

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
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>
(cherry picked from commit e4be46c2c5)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:32:54 +00:00
Roman Dolny 8eccf8bfd5
Bug 41904: "Use of uninitialized value..." warning in del_message.pl
The warning
[WARN] Use of uninitialized value in string eq at
/kohadevbox/koha/circ/del_message.pl line 54.
appears in plack-intranet-error.log

Test plan:
==========
1. Observe plack-intranet-error.log
2. Search for any patron and go to "Check out" tab.
3. Add message for patron. Added message is shown in "Message" area
   with "Edit" and "Delete" links.
4. Click "Delete" and confirm modal.
5. Warning appears in plack-intranet-error.log
6. Apply the patch; restart_all
7. Repeat 3-4. No warning appears.

Sponsored-by: Ignatianum University in Cracow

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 42908f8c68)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:31:37 +00:00
David Nind fee8659457
Bug 41958: Rename BibTeX cart and list download options in the staff interface
This patch renames BibTex to BibTeX (with a capital X) for the staff interface
cart and list download options, to match the OPAC.

Test plan:
1. Log in to the staff interface and search for a term that returns
   results.
2. Add some records from the results to the cart (select records >
   Add to cart).
3. Add some records from the results to a new public list (select
   records > Add to list > New list > name the list > make it a
   public list > Save).
4. Note the download options for the cart and the spelling: Cart >
   Download > BibTexi (with a lowercase X).
5. Note the download options for lists and the spelling: Lists >
   Public lists > select the list > Download list > BibTex (with a
   lowercase X).
6. Go to the OPAC and search for a term that returns results.
7. Add some records from the results to the cart (select records >
   Add to cart).
8. Note the download options for the cart and the spelling (with a
   capital X): Cart > Download > BibTeX.
9. Note the download options for lists and the spelling (with a
   capital X): Lists > Public lists > the name of your list >
   Download > BibTeX.
10. Apply the patch.
11. Recheck the download options in steps 4 and 5.
12. The option should now show as BibTeX (with a capital X).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 07e1f36a63)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:23:10 +00:00
David Cook 28424646c9
Bug 41970: Fix typo in pa_class in template
This change fixes a typo from pa_loo to pa_class, so that
the ID attribute of the fieldset is properly set when using PA_CLASS
to group patron attributes.

Test plan:
0. Set up two PA_CLASS values
1. Set up two patron attributes which are viewable/editable on the
OPAC and assign them one class each
2. Go to http://localhost:8080/cgi-bin/koha/opac-memberentry.pl
3. Look at the HTML and note that fieldsets for both PA classes
have the ID of "aai_"

4. Apply the patch

5. Reload the page http://localhost:8080/cgi-bin/koha/opac-memberentry.pl
6. Note that now the fieldsets have ID attributes of
"aai_<PA_CLASS code>".
7. Rejoice as now it's easier to use Javascript and CSS and have valid
HTML!

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 28a54105ab)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:21:54 +00:00
Jake Deery 7e16e85e4f
Bug 41976: LinkWrapper no longer mangles links
This patch fixes a bug where, context-dependent, LinkWrapper can keep
referencing back to links that should be out of scope.

This was causing odd behaviour whilst writing Bug 14962 - namely, links
returning as the same value in a table of multiple rows due to
LinkWrapper treating linkData.href as one and the same for each row.

TO TEST:
== APPLY PATCH ==
a)  enable ERMModule syspref, go to /cgi-bin/koha/erm/erm.pl
b)  notice all links and buttons still work as expected
c)  go to /cgi-bin/koha/sip2/sip2.pl
d)  notice all links and buttons still work as expected
e)  go to /cgi-bin/koha/acquisition/vendors
f)  notice all links and buttons still work as expected
g)  enable PreservationModule syspref, go to
/cgi-bin/koha/preservation/home.pl
h)  notice all links and buttons still work as expected
== SIGN OFF ==

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 12fdf33139)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:15:03 +00:00
David Cook b64f41a235
Bug 41986: Add more names to Contact information and clarify preferred name
This patch adds the "Middle name" to the Contact information on moremember.pl,
and it adds "Preferred name:" when it differs from the "First name:". This
provides maximum clarity to staff users.

Test plan:
0. Apply the patch
1. Go to the "Patrons" module and search for or add a new patron
2. Add a firstname, a middle name, and a surname. Also add a "Preferred name"
which matches the firstname.
3. Go to "Details" on the sidebar, and note that "First name", "Middle name",
and "Surname" appear in the "Contact information".
4. Edit the patron and change "Preferred name" to a name that does not
match the "First name"
5. Go to "Details" on the sidebar, and note that "Preferred name" now shows
as well.
6. Enjoy fully comprehending which name is which for the patron!

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 5ecf2cc9b0)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:14:20 +00:00
Paul Derscheid ded7e528d5
Bug 42014: (follow-up) Only show empty state when patron is not on any list
- The empty state message was shown when available_lists was empty
  but the patron was already on all existing lists
- Add !in_lists guard so the message only displays when the patron
  is truly not on any list

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 53a8761a42)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:11:57 +00:00
Paul Derscheid c02c8db51e
Bug 42014: Show empty state message on patron lists tab
- When no patron lists exist in the system, the patron lists
  tab on the patron detail page renders completely blank
- Other tabs follow the convention of showing a message in
  the empty state (e.g. "Patron has nothing on hold.")
- Add an empty state message with a link to create a new
  patron list, matching the established pattern

To test:
- Go to a patron detail page and click the "Patron lists" tab
- If no patron lists exist, observe the tab is blank
- Apply patch
- Repeat the above steps
- Verify the tab now shows "Patron is not on any list." with
  a link to create a new patron list
- Click the link and create a patron list
- Return to the patron detail page and verify the "Add patron
  to list" dropdown now appears instead

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 5d9a2ec188)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:11:56 +00:00
Lisette Scheer b53063f96c
Bug 42071: Add 'show' to options that load a single suggestion
Test plan:

Before applying the patch:
1. Go to acquisitions
2. Go to Purchase Suggestions
3. Create a purchase suggestion (for ease of testing, select Centerville for the library)
4. On the table, click on the suggestion number
5. Observe the suggestion does not populate, including the breadcrumbs, but the url does contain the suggestion number.
6. Apply the patch
7. restart_all
8. Rpeat steps 1-4
9. Observe the suggestion now populates and can be edited.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 6cb1868e19)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:11:01 +00:00
Jonathan Druart 85ea56a170
Bug 41989: Call getlanguage after get_template_and_user
This patch prevents the UI to randomly change the language when reaching
addbooks

The problem is that getlanguage is called BEFORE get_template_and_user,
without, and "interface" (C4::Context->interface) is not set yet.

Open C4/Languages.pm, search "sub getlanguage"
We first read the cache, then if there is no interface we reach
GetTranslatedLanguages that does return languages in a random order,
then we pick the first one
765         @languages = map { $_->{rfc4646_subtag} } @{ getTranslatedLanguages( $interface, $theme ) };
783     $language = shift @languages unless $language;

We must call getlanguage AFTER that the cache is populated.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit da64305067)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:10:15 +00:00
Martin Renvoize c620f8f134
Bug 42098: (follow-up) Enable plugin in ImportBatch.t test
The Handler::run change to skip disabled plugins broke the
RecordsFromMarcPlugin subtest in ImportBatch.t. The MarcFieldValues
plugin was installed but never enabled, so Handler::run returned
early. Add $plugin->enable() before calling RecordsFromMarcPlugin.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 645ace7353)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:07:10 +00:00
Kyle M Hall 12519e7acd
Bug 42098: EDIFACT edi_cron.pl runs disabled plugins due to bug in Koha::Plugins::Handler::run
It appears that edi_cron.pl will run disabled EDI plugins. It uses Koha::Plugins::Handler::run that does not check if the plugins is gets are disabled.

Koha::Plugins::Handler::run needs to be fixed to not run disabled plugins.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Plugins/Plugins.t

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 435cf5cba1)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:07:00 +00:00
Fridolin Somers 497a9f5c31
RMaint: amend bug_34000 DBRev to add options, explanation and type 2026-05-21 11:30:22 +02:00
Fridolin Somers d8dcedc7ea
Bug 42136: (RMaint follow-up) Fix number of tests 2026-04-27 09:24:16 +02:00
Fridolin Somers 13fe0cbf0e
Merge branch '24.11.x-security' into 24.11.x 2026-04-27 09:23:57 +02:00
Jacob O'Mara 1f5c5eab98
Update release notes for 24.11.15 release
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:36:18 +01:00
Jacob O'Mara 88c5289e0b
Increment version for 24.11.15 release
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:36:18 +01:00
Jacob O'Mara ea7a0c1f20
DBRev 24.11.14.001
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:36:18 +01:00
Jacob O'Mara f3d67d9d9c
RMaint: amend bug_34000 tests as we haven't backported bug_39014
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:27 +01:00
Martin Renvoize 4c69cbe88c
Bug 34000: Unit tests
Adds a new subtest to t/db_dependent/Koha/Patron.t covering
fixup_cardnumber and the autoMemberNumValue counter:

- Normal increment bumps the counter
- Renaming a patron's cardnumber does not free it for reuse
- Deleting a patron does not free their cardnumber for reuse
- Counter wins when ahead of db_max
- db_max wins when ahead of counter
- Legacy fallback when the syspref row is absent

Also adds autoMemberNumValue to the exceptions list in
t/db_dependent/check_sysprefs.t. The preference is managed internally
by Koha::Patron::fixup_cardnumber -- it is not user-configurable and
has no entry in the admin preference YAML files.

Test plan:
1. prove t/db_dependent/Koha/Patron.t
2. prove t/db_dependent/check_sysprefs.t
3. prove t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t
   (confirm the patron_barcode_transform hook is still called twice
   during store when autoMemberNum is enabled).

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:27 +01:00
Martin Renvoize 7e4515fef3
Bug 34000: Prevent re-issuance of auto-generated cardnumbers
When autoMemberNum is enabled, Koha picks the next cardnumber as
MAX(numeric cardnumber in borrowers) + 1. If patron A's auto-generated
cardnumber is later changed (e.g. they get a physical card) or the
patron is deleted, the original number becomes "free" and the next
self-registrant is assigned it -- inheriting anything third-party
services (OverDrive, Hoopla, unauthenticated self-check) have keyed on
the cardnumber.

This patch makes Koha::Patron::fixup_cardnumber use a monotonic counter
(the autoMemberNumValue syspref) so that once a number has been
auto-generated for any patron, it is never auto-generated again.

The syspref row is locked with SELECT ... FOR UPDATE inside the
existing txn_do, which serialises concurrent callers via InnoDB
row-level locking and addresses the race condition raised against
earlier revisions of this patch.

The formula is: next = MAX(counter, db_max) + 1. When the counter is 0
(pre-upgrade or missing syspref), this degrades gracefully to
db_max + 1 -- the legacy behaviour -- so no feature toggle is needed.
The counter is only bumped when Koha actually auto-generates a
cardnumber; plugin- or caller-supplied values do not touch it.

Test plan:
1. Enable autoMemberNum.
2. Self-register patron A via OPAC, note cardnumber N.
3. Edit patron A in the staff interface, change cardnumber to
   something non-numeric like "MANUAL-XYZ".
4. Self-register patron B.
5. Confirm B gets N+1, NOT N.
6. Delete patron A.
7. Self-register patron C.
8. Confirm C gets N+2, NOT A's original number.
9. Install a plugin implementing the patron_barcode_transform hook;
   confirm it still runs and its value is honoured (counter is not
   bumped when the plugin supplies a cardnumber).

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:27 +01:00
Martin Renvoize 32e8a3a2ba
Bug 34000: Add autoMemberNumValue system preference
Introduces a new system preference, autoMemberNumValue, which tracks
the highest auto-generated cardnumber ever issued. It is seeded from
the MAX cardnumber across both borrowers and deletedborrowers so
pre-upgrade deletions do not free numbers for re-issuance.

This preference is managed internally by Koha::Patron::fixup_cardnumber
and has no UI (no YAML entry).

Test plan:
1. Apply the atomicupdate:
   perl installer/data/mysql/updatedatabase.pl
2. Verify the preference exists:
   SELECT * FROM systempreferences WHERE variable = 'autoMemberNumValue';
3. Confirm the seed value matches:
   SELECT GREATEST(
       COALESCE((SELECT MAX(CAST(cardnumber AS SIGNED)) FROM borrowers
                 WHERE cardnumber REGEXP '^-?[0-9]+\$'), 0),
       COALESCE((SELECT MAX(CAST(cardnumber AS SIGNED)) FROM deletedborrowers
                 WHERE cardnumber REGEXP '^-?[0-9]+\$'), 0)
   );
4. Re-run the atomicupdate and confirm the already-exists warning.
5. Drop the syspref, re-apply the atomicupdate, confirm it seeds
   correctly on fresh installs via mandatory/sysprefs.sql.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Jonathan Druart 9a42d3507b
Bug 42252: Prevent XSS when deleting a list at the OPAC
Test plan:
Create a list with name=<script>alert("booh!");</script>
Delete it at the OPAC

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Jonathan Druart 63097f365a
Bug 42136: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
David Cook 40f6c95400
Bug 42136: prevent cgi, directory, and file plugins from use in user-entered templates
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Marcel de Rooy 681069596a
Bug 42254: (QA follow-up) Remove unused var, fixing a FIXME
Test plan:
Read the patch. Look for the var in the script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
David Cook 1218a44ddf
Bug 42254: (follow-up) tweaks to improve XSS fix
This change removes useless success_* calls, removes an unnecessary
'use URI::Escape qw( uri_unescape );' in the Perl, adds a missing
response function argument, uses a safe sink for the "verdict" element
to make the content setting a bit cleaner.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Jonathan Druart 7b5dcca344
Bug 42254: Prevent XSS when testing tags
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
David Cook b28134f64c
Bug 42253: (QA follow-up) prevent XSS injection in data- attribute
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Jonathan Druart 85401a6f03
Bug 42253: Prevent XSS in the advanced editor - macros
Test plan:
/cgi-bin/koha/cataloguing/editor.pl
Click "Macros", "New macro..."
Enter <script>alert("booh");</script>
OK
Click on the macro name, run macro, delete macro, mark as public:
Nothing should trigger an alert

QA:
-            $( '#macro-list li[data-name="' + name + '"][data-id="' + id + '"]' ).addClass( 'active' );
+            $( '#macro-list li[data-id="' + id + '"]' ).addClass( 'active' );
Why did we need name and id to select the macro?

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Martin Renvoize 0af06dc5f3
Bug 41368: Fix ManageMarcImport Cypress test timing issue
Replace the no-op `#job_callback` existence check with a recursive
`cy.wait('@jobPoll')` that loops through each `/api/v1/jobs/*` poll
response (arriving every ~1s) until it sees `status: finished`. This
avoids any fixed timeout — the test proceeds as soon as the API signals
completion, however long that takes on a given machine.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c513dee502)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Lucas Gass fb1fcea011
Bug 41368: Fix View batch click
To test:
1. APPLY PATCH
2. yarn build
3. cypress run --spec t/cypress/integration/Tools/ManageMarcImport_spec.ts
4. It should now pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b190813020)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-22 20:18:26 +01:00
Jonathan Druart e1c88f74ca
Bug 42090: Fix KohaTable/Holdings_spec.ts
I think there has been a mix in the different fixes, and 24.11 diverged
from main

My suggestion here is to use a different column as "Status" is a
specific one

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-04-20 13:36:03 +00:00
Jonathan Druart 4dae95ad7d
Bug 42090: Fix ERM/Dialog_spec.ts
I am not sure why we need that, but it fixes the test!

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-04-20 13:35:13 +00:00
Baptiste Wojtkowski 49bb286cb0
Revert "Bug 41655: Local OPAC covers are not displayed in OPAC lists"
This reverts commit 71123ae372.
2026-04-17 13:43:58 +00:00
Hammat Wele 71123ae372
Bug 41655: Local OPAC covers are not displayed in OPAC lists
Local cover images are no longer displayed in OPAC lists since Bug 41078.
In Koha versions prior to 25.05.05, local cover images were correctly displayed in OPAC lists.

This appears to be a regression.

To reproduce

1. Set the system preferences LocalCoverImages and OPACLocalCoverImages to Show.

2. Find a bibliographic record and open the record detail page.

3. Upload a local cover image file for the record.

4. Create a public list and add the record to the list.

5. In the OPAC, open the public list.
   --> The local cover image is missing.

6. Apply the patch.

7. Reload the OPAC list page.
   --> The local cover image is now displayed correctly.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 40ae10bed9)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-04-17 13:33:32 +00:00
Marcel de Rooy d096afc25e
Bug 41449: Reserves.t - fix description and assumption for onshelfholds
Test plan:
prove t/db_dependent/Reserves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 2d9c05c4c0)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-04-17 13:33:31 +00:00
Marcel de Rooy eb6d399be2
Bug 19690: Change comments in IsAvailableForItemLevelRequest
The term 'If any unavailable' is not very clear but it is also
very hard to find something short and better.

A next available hold is possible when at least one item is
unavailable (checked out, on order, waiting/transit hold).
A item level hold is possible when the specific item is
unavailable.

Test plan:
Read the patch. The code did not change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 6fb28b5583)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-04-17 13:33:30 +00:00
Baptiste 815fd5baf2
Bug 40960: Print notification only if selected type is impossible
Test plan (ktd):
1 - Have henry acevedo have no mail and set messaging preference "Hold filled to sms"
2 - Have edna acosta have not messaging preference
3 - Place an hold on two books for edna acosta and henry acevedo, check in both books and select the button to fill the hold
4 - Check in notices and see that both received a notice
5 - Apply tests and run tests -> they should fail
6 - Apply patch, run rest -> they should pass
7 - Unfill both holds and fill them back. Henry should keep receiving notices while Edna should not anymore.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 505e58d1d2)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-04-17 13:33:29 +00:00
Baptiste 782a5a7ca5
Bug 40960: Fix unit tests
Two unit tests have been moved/replaced to fit the desired behaviour

- "patron notified when item set to waiting" -> does not fit the desired behaviour.
  The desired behaviour for mails/sms is already tested
  The desired behaviour for prints is changed to "patron not notified if
  no messaging preference is specified"
- "patron not notified a second time (bug 11445)" -> Moved into
  _koha_notify_reserve tests

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 24b7f4eacb)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-04-17 13:33:28 +00:00
Emmi Takkinen 166605b415
Bug 41431: Use correct data-attribute to fetch existing circulation rule note
If you click Edit on a line with a note, the note field is not displayed
in the editing line and is blanked upon save (i.e., the note is lost,
even if you made no edits on the note). Value of the note is stored to
data-attribute which was changed to use Bootstraps own data-attribute.
So now the value must be fetched with keyword "bsContent" instead of
just "content".

To test:
1. Add note for a circulation rule.
2. Edit the rule.
=> Note that notes value is not displayed in editing row.
3. Apply this patch.
4. Edit rule again.
=> Note that notes value is now displayed as expected.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 57dc4c7c20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-04-17 15:05:25 +02:00
Lucas Gass f1cd81812d
Bug 41475: Make hostitemnumbers an array ref
To test:

1. Set 'EasyAnalyticalRecords' to 'Show'.
2. Find or create a parent record that has at least 2 items on it. Note the itemnumbers and the framework.
3. Edit that framework so you can add a 773$0, 773$9, and 773$t
4. Find or create a child record.
5. Make at least 2 773 entries on the child record. Add the biblionumber of the host record to the 773$0.
6. In each entry for the 773$9 add one of the itemnumbers from the host record.
7. For the 773$t and the biblio title of the host record.
8. Save.
9. Now attempt to put a hold on the child record.
10. 500 error:
11. APPLY PATCH and restart_all
12. Try placing the hold again, this time it succeeds.

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit aee23d1eb7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-04-17 14:57:48 +02:00
Owen Leonard cafe17d65e
Bug 41764: ISSN hidden input missing from Z39.50 search form navigation
This patch modifies the Acquisitions and Cataloging Z39.50 search forms
so that the pagination form includes a hidden ISSN input. This is
necessary for the form to submit the same search parameters each time
the user requests a new page of results.

To test, apply the patch and go to Acquisitions.

- Search for a vendor, and create a basket if necessary.
- Add to the basket and choose "From an external source."
- In the "ISSN" field, enter a partial ISSN number, e.g. 0361, and
  search.
- At the bottom of the search results, click the "Next page" button.
- The second page of results should load correctly. At the top of the
  table of results it should say "You searched for: ISSN: 0361"
- Perform the same test in Cataloging:
  - Cataloging -> New from Z39.50/SRU

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 6041a1ddc5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-04-17 14:46:53 +02:00
Slava Shishkin 2bc9f04b0e
Bug 41055: add missing accesskey attribute for print button
This commit adds the missing accesskey attribute to the print button in the circulation template.

Test plan:
1. Try to checkout an item that is waiting for pickup.
2. Try to print the checkout receipt using the alt+shift+p keyboard shortcut.
3. Verify that nothing happens when using the shortcut.
4. After applying this commit, try the same steps again.
5. Verify that the print button now works with the alt+shift+p keyboard shortcut.

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Slava Shishkin <slavashishkin@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 3183fd17d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-04-17 14:38:21 +02:00
Baptiste Wojtkowski 2da2005496
Bug 41420: Fix referrer in parcel.tt
Test plan:

Steps to reproduce :
1 - Go to http://localhost:8081/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1 and fill in a new item.
2 - Visit http://localhost:8081/cgi-bin/koha/acqui/parcels.pl?booksellerid=1, type an invoice name and validate. Inspect both "Cancel order" and "Cancel order and catalog record". Notice the link in "Cancel order is broken"
3 - Apply patch
4 - Repeat 3 and notice the referrer is well formed.

For a reason I ignore, it does not seem to have an impact on main, but
on the 24.11 I tested, if you click on cancel order, after confirming
the deletion and clicking on "ok", you will be asked again to confirm,
    however the deletion has been performed

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 92353e5294)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-04-17 14:29:24 +02:00
Martin Renvoize 18469bb1ee
Bug 41679: Fix overlapping modals when hold conflicts with stock rotation transfer
When checking in an item that has both a hold and a stock rotation
repatriation transfer, both modals would appear simultaneously,
overlapping each other and making it impossible to interact with
either one properly.

This occurred because:
1. The hold modal showed when 'waiting' was set
2. The transfer modal condition checked for 'reserved' but not 'waiting'
3. Both modals had the "block" class, causing simultaneous display

This patch ensures holds take precedence over stock rotation transfers
by adding a check for the 'waiting' flag to the transfer modal condition.

When a hold is found, only the hold modal displays. The stock rotation
transfer can be handled at a subsequent check-in, which is appropriate
since holds are patron-facing and time-sensitive, while stock rotation
is an internal process that can be deferred.

Test plan:
1. Enable StockRotation system preference
2. Navigate to Cataloging->Stock rotation
3. Click '+ New rota' and fill out with any values
4. Click 'Manage->stages' for the Rota
5. Add a stage for Centerville for 1 day, and Midway for 1 day
6. Return to rotas
7. Click Manage->items for the rota
8. Add an item
9. Return to rotas
10. Click 'Activate'
11. On the command line run the stock rotation job:
    perl misc/cronjobs/stockrotation.pl -x
12. There should be one item for initiation
13. Run it again, there should be one stationary item
14. Place an item specific hold for the item, for pickup at Midway
15. Check the item in at Centerville, confirm transfer
16. Check the item in at Midway, confirm hold
17. Run the stock rotation job again:
    perl misc/cronjobs/stockrotation.pl -x
18. There should be one item for repatriation
19. Check in the item again at Midway
20. Before patch: Two overlapping modals appear (hold + transfer)
21. After patch: Only the hold modal appears
22. Confirm the hold - no transfer modal should appear
23. The stock rotation transfer will be handled at the next check-in

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit bbcb45ddc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-04-17 14:16:05 +02:00
Fridolin Somers 38d17b59ad
RMaint 24.11 remove tilde backup files 2026-04-13 09:30:45 +02:00
Baptiste Wojtkowski 43dc598295
Update release notes for 24.11.14 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-03-30 12:57:02 +00:00
Baptiste Wojtkowski 762e2cd101
Increment version for 24.11.14 release 2026-03-30 12:50:38 +00:00
David Cook 0fd9463f38
Bug 41261: Valid inputs to unapi
This change adds data validation to the "unapi" API endpoint.

Test plan:
0. Apply the patch
1. Go to http://localhost:8080/cgi-bin/koha/unapi
2. Note the 400 HTTP response code
3. Go to http://localhost:8080/cgi-bin/koha/unapi?id=bad
4. Note the 400 HTTP response code
5. Go to http://localhost:8080/cgi-bin/koha/unapi?id=koha:biblionumber:1&format=bad
6. Note the XML response listing the available formats for that ID
7. Go to http://localhost:8080//cgi-bin/koha/unapi?id=koha:biblionumber:1
8. Note the XML response listing the available formats for that ID
9. Go to http://localhost:8080//cgi-bin/koha/unapi?format=mods
10. Note the 400 HTTP response code
11. Go to http://localhost:8080//cgi-bin/koha/unapi?id=koha:biblionumber:1&format=mods
12. Note the MODS format returned for biblionumber 1

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-03-27 13:50:53 +00:00
David Cook bcf64aeeb8
Bug 41594: Disable access to invoice-files.pl if AcqEnableFiles disabled
This patch makes it so that invoice-files.pl returns 404 if
AcqEnableFiles is disabled

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Go to /cgi-bin/koha/acqui/invoice-files.pl?invoiceid=999
3. Note that you see a 404 page
4. Change "AcqEnableFiles" syspref to "Do"
5. Go to /cgi-bin/koha/acqui/invoice-files.pl?invoiceid=999
6. Note that you now see a "Files for invoice" page

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2026-03-27 13:40:22 +00:00
Owen Leonard 808385ea57
Bug 41142: Update jQuery-validate plugin to 1.21.0
This patch updates the jQuery validation plugin in both the staff
interface and the OPAC to the latest version, 1.21.0.

To test, apply the patch and clear your browser cache if necessary.

Test various pages in the staff client to confirm that form validation
works as expected:

 - Patron password change form:
   - Password must conform to minPasswordLength
   - Password must not contain leading/trailing spaces
   - Passwords must match

 - Administration -> Add or edit budget:
   - Description, start date, and end date are required
   - Start date must be before end date

 - Administration -> Add or edit Z39.50/SRU server:
   - Server name, hostname, port, and database are required
   - Port, rank, and timeout must be a number

Perform the same check of the "Change password" form in the OPAC.

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: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 1b7c356243)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-03-06 15:07:31 +00:00
Pedro Amorim 646beb5801
Bug 41237: (QA follow-up): Utilize available logged in user object
Instead of re-fetching the patron object.

This also adjusts tests:
prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit a19a6cf1ef)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-03-06 15:00:24 +00:00
Pedro Amorim e0206a0d9e
Bug 41237: Add tests
Test plan, k-t-d:
1) Apply tests patch, run:
prove t/db_dependent/Koha/ILL/Requests.t
2) Notice it fails. Apply the second patch. Repeat. Notice it passes.

Test failure explanation (before fix patch):
    #   Failed test 'Cardnumber not supplied and couldnt find additional_contents for all libraries. Dont show copyrightclearance'
    #   at t/db_dependent/Koha/ILL/Requests.t line 1067.
    #          got: 'copyrightclearance'
    #     expected: 'commit'

Its searching the copyrightclearance additional_contents for the provided branchcode param (illrq->patron->branchcode) (and finding one) when it shouldn't. That parameter is only to be utilized for the newly created ILL request's library. The branchcode filter of the additional_contents must the be logged in user's cardnumber, not params->{branchcode}. If no logged in user exists and this stage is reached (ILLOpacUnauthenticatedRequest), then only 'All libraries' ILLModuleCopyrightClearance are to be fetched, as expected.

Human test plan, before applying patches:
1) Enable ILLModule
2) Logged in as koha:koha, create an OPAC request, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Pick any library not Centerville (the default library of the 'koha' user)
4) Notice the created request's library is CPL (Centerville). It ignored the library selection from the form.
5) Apply patches. Repeat. Notice the request's library is now the one that was selected on the form.

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit d6ce5833b7)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-03-06 15:00:23 +00:00
Pedro Amorim 35feeb4214
Bug 41237: Update fetch of patron's branchcode to search additional_contents by
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 5485218dfd)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-03-06 15:00:09 +00:00
Owen Leonard 97ffc9e640
Bug 41623: (follow-up) Correct JS variable name
This patch fixes the variable name meant to display the circulation desk
name when the waiting hold was checked in at a specific circ desk.

A revised test plan to test this specific case:

- Install a new langage
  gulp po:update --lang fr-CA
  ./misc/translator/translate install fr-CA
- Log in to the staff client and set your circulation desk
  - Requires that the UseCirculationDesks preference is enabled and at
    least one desk is defined in Administration -> Desks.
- Place a hold to be picked up at your logged-in library
- Check in the item on hold and confirm the hold
- Go to the record details page. In the holdings table you should see
  this under "Status" for that item:
    --> "Waiting at [library], undefined since [date]."
- Check the translation files
  cd misc/translator/po/
  git grep "Waiting at" fr-CA*
    --> There is no "Waiting at %s, %s since %s."

- Apply patch
- Update strings again
- Check translation files again
    --> The string should be there
- Translate the string (making sure to remove the fuzzy line if any)
- Install the translation again (only the translate install part)
- Check the record details page again. You should now see:
    --> "Waiting at [library], [desk] since [date]."

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit d97d8354a3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-03-06 14:28:32 +00:00
Lucas Gass 464e60ca48
Bug 39587: Add surname to contact information list on moremember.tt
To test:

1. Go to members/moremember.pl?borrowernumber=X where X is borrowernumber of a patron with a surname
2. Look under contact information and notice surname is missing.
3. APPLY PATCH and look again.
4. Surname should be included.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f94283fdc5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-03-04 11:15:05 +01:00
Owen Leonard 188161385a
Bug 40602: [24.11.x] Broken HTML showing in Alert 'subscriptions' tab
This patch adds handling of the "no-html" flag to patron-title.inc. The
OPAC alert subscriptions page passes the "no-html" flag but the include
file wasn't written to include it.

To test, apply the patch and log in to the OPAC as a user who has a
title (salutation).

- Add a serial subscription and set a notification template
- Go to the OPAC and subscribe to the email notification for this
  subscription
- Go to the patron account > Alert subscriptions tab
- Verify that the last column shows an "Unsubscribe from email alerts"
  button.
- There should be no errant HTML.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-02-26 14:54:26 +01:00
Baptiste Wojtkowski 68bbe88180
Bug 41001: (RMaint follow-up) fix tidy issue 2026-02-23 14:34:56 +00:00
Baptiste Wojtkowski bb141abcd7
Update release notes for 24.11.13 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-23 14:09:55 +00:00
Baptiste Wojtkowski 414f8699e8
Increment version for 24.11.13 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-23 14:06:06 +00:00
Jonathan Druart f521897c90
Bug 41591: Remove view=1 parameter from the invoices table
It has been removed in the controller by the previous patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 98833e04d74be26c5efa3bc1718ac8a32063223f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-23 13:32:23 +00:00
David Cook 7e33daa2c2
Bug 41591: Prevent inline rendering of invoice files
This patch forces download of invoice files rather than showing
them inline where they can potentially perform XSS

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Find or create an active vendor
3. Create a basket if one doesn't already exist
4. Receive a shipment for the vendor
5. Create an invoice
6. Go to the invoice
7. In the URL change invoice.pl to invoice-files.pl
(or turn on AcqEnableFiles and go to it that way)
8. Upload an image file (e.g. SVG) or PDF
9. Click on the filename
10. Note that instead of displaying in the browser,
the file will be downloaded

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 9ef05dfa7ec321a5bc7c84e0732d3d4ede945702)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-23 13:32:22 +00:00
Lisette Scheer ccc5cf627d
Bug 40827: Add context to plugin wrapper for report plugins
This patch updates the plugin wrapper to include the reports menu and have the breadcrumbs list reports instead of admin or tools when method="report"

To Test:
1. Install the Kitchen Sink Plugin
2. Navigate to Reports->Report plugins->Run Report.
3. Observe the admin menu shows
4. Apply the patch
5. Repeat step 2
6. Observe the report menu shows and the breadcrumbs are for the report module.
7. Check that the tools and configuration show the appropriate tool/admin context.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 09860c5816)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-20 14:05:35 +00:00
Pedro Amorim 10a00918f7
Bug 41001: (QA follow-up): Add 'Confirmation messages with inputs' specific tests
cypress run --spec t/cypress/integration/ERM/Dialog_spec.ts

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit e813eeeaff)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-20 14:04:50 +00:00
Pedro Amorim d7381e4851
Bug 41001: Add cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit ff87a2a6a5)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-20 14:04:48 +00:00
Pedro Amorim 96d2d5da9a
Bug 41001: Remove messages when dialog closes, even if not through the close button
This ensures that when the dialog is closed, even when clicked outside of it, the messages are correctly removed, same as if the 'close' button had been clicked.

Test plan:
- create a data ERM provider /cgi-bin/koha/erm/eusage/usage_data_providers/add
- dummy data should be sufficient
- then go to data providers list /cgi-bin/koha/erm/eusage/usage_data_provider
- open web development tools console (F12 firefox)
- click on "Run now"
- dismiss dialog by clicking outside the modal!
- click again on "Run now"
- check the logs for errors
- any other clicks to create a modal won't work now ("run now", "delete")

Apply patch. run yarn js:watch or yarn js:build. Repeat.

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 3908b7bc1c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-02-20 14:04:42 +00:00
Martin Renvoize 9440c4adfe
Bug 40219: Add unit test to verify welcome email is not sent on validation failure
This test ensures that when extended attribute validation fails during
patron creation via the API, no welcome email is sent. This validates
the fix where extended_attributes() validation was moved before the
welcome email is enqueued.

Test plan:
1. Apply this patch
2. Run: prove t/db_dependent/api/v1/patrons.t
3. Verify all tests pass, including the new test that confirms no welcome
   email is sent when extended attribute validation fails

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 4d2f80925d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-02-18 14:54:56 +01:00
Leo Stoyanov 4568e64087
Bug 40219: Moved Extended Attributes Validation Before Enqueuing Welcome Email
Test Plan:
1. Configure Koha with: AutoEmailNewUser = "Send" and create a mandatory extended attribute that will cause validation to fail; for example, set for the attribute to display in the OPAC, to be editable in the OPAC, and to be mandatory. That means this bug must be tested before Bug 40220, where the validation failure is resolved.
2. Setup your Postman, or any other mock API software, to obtain an OAuth token (/api/v1/oauth/token) and to register a patron (/api/v1/patrons).
3. With the OAuth token, send a POST request to /api/v1/patrons with valid patron data and invalid or missing mandatory extended attribute data.
4. Observe the API response with the 400 error and notice that the welcome email was delviered despite the fact that no patron account was created.
5. Apply the patch and repeat step 3. Notice that the API response still contains the 400 error, but no welcome email was sent.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 328b77458f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-02-18 14:54:41 +01:00
Baptiste Wojtkowski 5b7a05b4db
Update release notes for 24.11.12 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-01-26 13:35:04 +00:00
Baptiste Wojtkowski 182443952f
Increment version for 24.11.12 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-01-22 14:43:33 +00:00
David Cook 2773ab2e15
Bug 41662: Prevent CSRF on opac-patron-consent.pl
This change prevents CSRF on opac-patron-consent.pl by
adding checking of the "op".

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Set system preference PrivacyPolicyConsent to "permissive"
2. Log into the OPAC and go to this path:
/cgi-bin/koha/opac-patron-consent.pl?check_GDPR_PROCESSING=1
3. Note that it doesn't change the consent
4. Go to this path:
/cgi-bin/koha/opac-patron-consent.pl?check_GDPR_PROCESSING=0
5. Note that it doesn't change the consent
6. Click the "Yes" radio button and click "Save"
7. Note it changes the consent to Yes
8. Click the "No" radio button and click "Save"
9. Note it changes the consent to No

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2026-01-22 14:42:47 +00:00
David Cook ee5e755e6c
Bug 41593: Validate displayby parameter in suggestion.pl
This change validates the displayby parameter in suggestion.pl
in order to prevent SQL injection.

Test plan:
0. Do not apply the patch
1. Log into the staff interface
2. Visit the path /cgi-bin/koha/suggestion/suggestion.pl?
op=else&displayby=status+AND+EXTRACTVALUE(1,CONCAT(0x7e,@@version))
3. Notice a 500 error is generated
4. In the error logs, the MySQL version number will appear

5. Apply the patch
6. koha-plack --restart kohadev

7. Visit the path /cgi-bin/koha/suggestion/suggestion.pl?
op=else&displayby=status+AND+EXTRACTVALUE(1,CONCAT(0x7e,@@version))
8. Notice that no error is generated
9. Try each of the "Organize by" options on the left nav bar
10. Note that none of them generate an error and that the option is
retained after clicking "Go"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
2026-01-22 14:42:46 +00:00
Baptiste Wojtkowski cd3b3cd43f
Bug 40803: [24.11.x] Remove useless checkbox 2026-01-20 14:55:42 +00:00
Jonathan Druart 80e89f05b4
Bug 40803: Remove two unused parameter
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3b041f4cf0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c7282c7856)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-01-20 14:25:34 +00:00
Nick Clemens 24e6b13980
Bug 40803: Use submit form link to submit renewals from overdue items tab in opac user account
To test:
1 - Check out an item to a patron, backdated to be overdue
2 - Log in as that user to the OPAC
3 - From 'Your summary' - click the overdue tab, click renew
4 - 500 Error
5 - Apply patch
6 - Reload the page and repeat
7 - Success!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0219e4baf8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 75e25b4699)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-01-20 14:17:21 +00:00
Emily Lamancusa 3d7b256762
Bug 39502: (QA follow-up) Remove title attribute as well
When an element should be ignored by screen readers, it should have no
title attribute or an empty title attribute, in addition to a null alt
attribute.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 672982a683)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f6ad2409df)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-01-20 14:14:48 +00:00
Alexander Blanchard 118e675bdc
Bug 39502: Web Usability: Decorative Images Do Not Need ALT Text
A accessibility audit has highlighted that some of the decorative images on
the opac have alt text which is often followed by a spen that also contains the same
text. This results in screen readers reading this information twice.
The suggested solution is to set the alt text to null in these instances.

Test Plan:
Prior to applying patch:
1) Navigate to Koha OPAC
2) Carry out a search
3) On one of the records right click on the  Material Type: under the heading
4) Select Inspect
5) Note that the image has an alt text that matches the span that follows
6) Click on the item title and repeat the process for the icon below the contributors.
7) Scroll down to the holdings table and repeat the process for the image in the Item Type column
8) Apply the patch
9) Repeat the steps above and notice that the alt is now null in order to ignored by screen readers
11) Note that for the Dev tools may show alt but if you right click on the page and select View Page Source you will see that the code is alt="" as expected by screen readers
12) Note that for alt tags that have been updated in the xsl files e.g. the small icons that follow 'Material Type: ' may be cached.

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c5f99a3150)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8a6c09f9e3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-01-20 14:14:47 +00:00
Jonathan Druart 87039166c7
Bug 25952: Skip invalid repositories when searching for plugins
This patch prevents the end-user to get the ugly 500 "malformed JSON
string" when something wrong happens with the plugin search. It happens
currently in ktd with the plugin repos listed in $KOHA_CONF

An error is reported to the UI

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 438e51351d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a69f7a88ab)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-01-20 14:14:47 +00:00
Fridolin Somers c5e942294a
Bug 38770: [24.11.x] Update yarn.lock 2026-01-20 15:08:12 +01:00
Victor Grousset/tuxayo a1bd3e632c
Bug 38770: Remove @vue/cli-service and babel
And the webpack related dead config.

Test plan:
1. Do not apply
2. Switch to node 22
     sudo sed 's/18.x/22.x/g' -i /etc/apt/sources.list.d/nodesource.list
     sudo apt update ; sudo apt install nodejs
3. Try to install node deps
     sudo yarn install --modules-folder /kohadevbox/node_modules
4. It fails
     error @achrinza/node-ipc@9.2.5: The engine "node" is incompatible with this module.
     Expected version "8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 || 18". Got "22.12.0"
5. Apply patches
6. Try to install node deps
     sudo yarn install --modules-folder /kohadevbox/node_modules
7. It works! :)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2026-01-20 14:57:40 +01:00
Fridolin Somers 5dd0e8f8d8
RMaint 24.11 fix xt/find-license-problems.t
Fix unit test to allow http and https in licence.

For upper versions see :
See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40163
2026-01-20 14:54:44 +01:00
Fridolin Somers 4c055222b3
Revert "Bug 40897: Resized the field lengths to ensure even lengths"
This reverts commit bdafea91e5.
2026-01-20 09:43:03 +01:00
David Cook 822dee608e
Bug 34164: Redirect to referring URL when doing OIDC/OAuth SSO
This patch makes it so that a successful SSO will return you to
the place where you initiated the SSO. This is especially useful
when doing searches, placing holds, etc.

Test plan:
0. Apply patch and koha-plack --restart kohadev
1. Set up OIDC SSO using
https://wiki.koha-community.org/wiki/Testing_SSO
2. Go to http://localhost:8081/cgi-bin/koha/circ/circulation-home.pl
3. Do a staff login using SSO
4. Note that you're redirected to
http://localhost:8081/cgi-bin/koha/circ/circulation-home.pl
after the successful login

5. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
6. Do a OPAC SSO login
7. Note that you're returned to
http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
after the successful login

8. Logout of the staff admin and OPAC
9. Note your URL ends in ?logout.x=1
10. Try logging back into them using SSO
11a. Note that you're logged in and not automatically logged out
11b. Note that if you're on the OPAC, you should be redirected
to opac-user.pl instead of opac-main.pl or the root path

12. If you change the domain for the SSO users to something
that your user does not match, try logging in again, and note
that the error message should display on mainpage.pl or opac-main.pl/opac-user.pl
for the OPAC. (This is because these are the pages that show SSO errors.)

Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit dbadb00d7b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-01-09 09:42:39 +01:00
Lucas Gass b0e5551603
Bug 40527: Add SECURITY.md to ignored list in MakeFile.t
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit ea3fb6af6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-01-09 09:41:06 +01:00
David Cook 2e65bcbe3b
Bug 40527: Initial draft of SECURITY.md
This patch includes an initial draft of a proposed SECURITY.md
guideline for reporting security bugs to Koha.

Signed-off-by: Ludovic Julien <ludovic.julien@inLibro.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit d640840178)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-01-09 09:41:05 +01:00
David Gustafsson bcdb8e50a9
Bug 39468: EDI message status should be case insensitive
Make edi_order lowercase so that matching is case insensitive.

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit c681b0a18f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-01-09 09:36:42 +01:00
Tomás Cohen Arazi 4a84a833ff
Bug 41364: Fix error in preservation module breadcrumb
This patch makes the 'Processings' breadcrum element not be tied to a component but a plain string with the link disabled. This was causing errors:

- Breadcrumb element empty
- Error in the browser console

To test:
1. Enable the Preservation module
2. Go to Home > Preservation > Settings
3. Use the 'Add a new processing' button
=> FAIL: The breadcrumb has 'Settings > > Add processing' (i.e. is missing 'Processings' between >)
4. Click on 'Edit this processing'
=> FAIL: Same error, different context
5. Check the browser console
=> FAIL: You see something like this:

```
[Vue Router warn]: No match found for location with path "/cgi-bin/koha/preservation/settings/processings" devtools-BLCumUwL.mjs:59:1
```

6. Run the cypress tests for this module:
  k$ run_cypress --spec t/cypress/integration/Preservation/Settings.ts
=> FAIL: The breadcrumb navigation is broken
7. Apply this patch
8. Rebuild things:
   $ ktd --shell
  k$ yarn build
9. Fully refresh the page (Use cmd+shift+r on macOS, ctrl+shift+r on Linux/Windows)
10. Repeat 2-6
=> SUCCESS: The breadcrumb is no longer broken
=> SUCCESS: No errors/warnings about this in the browser console
=> SUCCESS: Tests pass!
11. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 30e48928d6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2026-01-09 09:26:38 +01:00
Rachel A-M b24903ed33
Bug 36518: Add IDs to sections (fieldsets) on the item search form
This patch adds IDs to the fieldsets on the staff interface search form
(Search > Item search), to make CSS customization easier.

Test plan:
1. Go to Search > Item search in the staff interface.
2. Right click: Inspect(Q)
3. Use ithe Search HTML bar to search for fieldset IDs:
   - "librarylocation"
   - "access_and_condition"
   - "barcodesearch"
   - "callnumber_checkouts"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 6967fe8d02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-26 10:14:37 +01:00
Nick Clemens 6f6287eb63
Bug 40645: Prevent 'rows' class fieldset from floating
To test:
1 - In the staff client do a search
2 - Select all results
3 - Add to list -> new list
4 - Scroll down, list name field is cut off
5 - Apply patch
6 - Close the list window and add to list again
7 - List name field is now visible

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 5cff1c453e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f6e0424add)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-22 14:08:13 +01:00
Tomás Cohen Arazi 9b1a3e5292
Bug 41490: Remove duplicated code from compare_es_to_db.pl
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
2025-12-22 13:58:58 +01:00
Lucas Gass 89b2dc121c
Bug 41421: [24.11.x] Fix DB update
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-10 10:53:52 -07:00
Fridolin Somers 0f3c9fb4f1
Bug 40873: [24.11.x] Use valid TT syntax
Make xt/tt_valid.t happy :)
2025-12-05 11:15:42 +01:00
Baptiste Wojtkowski ba67db305b
Update release notes for 24.11.11 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-12-04 15:26:13 +00:00
Baptiste Wojtkowski 9329a078dc
Increment version for 24.11.11 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-12-04 15:12:29 +00:00
David Cook c6de02ffe9
Bug 40524: [24.11.x] Update print format to use built-in formatter
This change updates the print format to use the built-in formatter
for operations like trim, strip HTML, strip newlines, and not
decoding entities.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/acqui/basket.pl?basketno=1
2. Click "add to basket"
3. Type "test" next to "From an existing record" and click "Submit"
4. On the "Gairm" row, click "Add order"
5. Fill in the required fields
6. In the "Internal note" put the following:
abc123
7. Click "Save"
8. In the Orders table, click "Export" and then "Print"
9. Note that the print page loads correctly, you can see the internal note,
and you cannot see lines for "Add internal note",
"Edit internal note", or "Add vendor note"

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2025-12-04 15:07:16 +00:00
Kyle M Hall 7feed05a77
Bug 41100: EDI vendor account port numbers no longer editable
It seems that port numbers are stuck at 21. Editing them does not change the port number in the database.

Test Plan:
1) Check out Koha 25.05
2) Try to edit an EDI vendor account port
3) Note the change doesn't save
4) Apply this patch
5) Restart all the things!
6) Note you can edit the port again!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 03542dc217)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:38:35 +01:00
Andrew Fuerste Henry 495f9b9f07
Bug 40961: Default item and patron library values to blank
To test:
1 - load the Circulation Statistics wizard
2 - confirm Home library, Holding library, and Patron library default to selecting the logged-in branch
3 - apply patch, restart_all, reload page
4 - confirm Home library, Holding library, and Patron library default to a blank selection
5 - confirm queries with those blank selections are not limited by items.homebranch, items.holdingbranch, or borrowers.branchcode

Signed-off-by: Katherine Wolf <wolf@sarsf.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b2d3ec043c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 701bb15059)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:30:42 +01:00
phette23 535c4ab33a
Bug 40873: AV dropdowns in OPAC don't use lib_opac
To test (ktd):
- Sign into the admin side
- Go to Administration > Authorized Values
- Edit or add to SUGGEST_FORMAT such that one AV has a different lib_opac
- Sign into the public catalog
- Go to purchase suggestions /cgi-bin/koha/opac-suggestions.pl?op=add_form
- Note that the AV in the 'Item type' dropdown does not use your lib_opac text
- Apply the patch and refresh the page
- Now the AV uses the lib_opac text

Sponsored-By: California College of the Arts
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 ff461167fd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 91b362041e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:26:55 +01:00
Lucas Gass c252e49a05
Bug 40205: data-categorycode should always be set to ALL
To test:
1. Add at least one rule to the default-circulation-rules table that contains a patron category.
2. Now add a "Default checkout, hold and return policy" rule.
3. Inspect the "Unset" button:

<a href="#" class="delete-branch-cat btn btn-default btn-xs" data-categorycode="T" data-branch="*"><i class="fa fa-undo"></i> Unset</a>

4. APPLY PATCH and clear browser cache
5. Try again, this time you should be able to delete the rule.

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d16b9f0311)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fbee8b9f0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:17:42 +01:00
Aleisha Amohia 3f9187478e
Bug 39985: Set items.onloan when recall adjusts checkout due date
This enhancement ensures the due date stored in items.onloan is changed when a recall causes a checkout due date to change.

To test:

1. Enable UseRecalls syspref and set corresponding circulation rules:
    - Recalls allowed
    - Recalls per record
    - On shelf recalls allowed - set to "If any unavailable"
    - Recall due date interval - set to 1
    - Recall pickup period
2. Check out an item to a patron (Patron A)
  2a. Make sure this patron has a primary email address set
  2b. Check the patron's messaging preferences - make sure this patron has the 'Email' checkbox checked for the 'Return recalled item' notice
3. Go to Tools -> Notices & slips and find the RETURN_RECALLED_ITEM notice. In the Email notice, change "[% checkout.date_due | $KohaDates %]" to "[% item.onloan | $KohaDates %]" and Save.
4. Log into the OPAC as another patron
5. Search for the item checked out in step 2, and place a recall on that item
6. Search for that item in the staff interface
=> Note that the item status says, "Checked out to <patron>: due <tomorrow>"
7. Create the following SQL report in the reports module, using the barcode of the item that was recalled:
SELECT onloan FROM items WHERE barcode='xxxxxxxxx'
8. Run the report
=> The onloan value is still set to the item's original due date, not the updated due date of tomorrow
9. Go to Patron A's account again and view their Notices tab. Click on the 'Notification to return a recalled item'
=> The original due date is used in the notice.
10. Apply the patch and restart services
11. Reset to run the tests again:
    - Check in the item, but do not confirm the recall in the pop-up
    - Go to the biblio detail page and cancel the recall
12. Repeat steps 2 to 5.
13. Run your report again (step 8)
=> The onloan value should now show the updated due date of tomorrow
14. View Patron A's latest 'Notification to return a recalled item' notice (step 9)
=> The updated due date should be used in the notice.
15. Confirm tests pass
    - t/db_dependent/Koha/Recalls.t

Sponsored-by: Auckland University of Technology
Signed-off-by: Brendan Gallagher <brendan@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 95f2639d64)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7c8dbf75ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:15:09 +01:00
Martin Renvoize e43cfd6c65
Bug 41229: Fix desk and register session persistence on library change
When changing library in circ/set-library.pl, desk and register values
were not being properly cleared from the session. This caused stale
desk/register data from the previous library to persist, resulting in:
- Incorrect cashup displays showing wrong library's register
- POS defaulting to registers from different libraries
- Session state inconsistent with visual UI

Three issues fixed:
1. Template: Changed register "None" option ID from "set-library-noregister"
   to "noregister" to match JavaScript expectations (consistent with desk handling)
2. Desk logic: Changed condition to use defined() and explicitly clear session
   when "No desk" is selected
3. Register logic: Added session clearing when "No register" is selected and
   fixed condition to handle empty initial state

Test plan:
1. Select Library A with Register 5
2. Change to Library B without selecting a register
3. Verify register is cleared from session (check POS page)
4. Repeat for desk selection
5. Verify explicit "-- None --" selection clears session values

Signed-off-by: Jason Robb <jrobb@sekls.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 92d6fcf2bd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit bb90bd0bab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:13:21 +01:00
Jonathan Druart 4f247dad7f
Bug 40760: Format 'Edit' link in item receive table as link
When receiving items in the acq module, the "Edit" link in the items
table for orders with items created when ordering is not recognizable
as link, but appears just formatted as normal text.

To test:
* Create a basket with items 'on order'
* Add an order line with 2+ items
* Close basket
* Receive shipment for the same vendor
* Click on "receive" link
* Verify the "Edit" in the items table on the left is formatted as a
  link

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 46bfbfee2d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4b6bb36310)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:11:03 +01:00
Jonathan Druart 0a92eb8542
Bug 41298: Fix filtering items by in transit
The filtering condition was not correct, the presence of a line in
the transfer table is not enough to now if the item is in transit.
Here we filter reusing the same conditions as
Koha::Item::Transfer->in_transit

Test plan:
Have at least 2 items for a given bibliographic record
Transfer item 1
Transfer item 2
Receive/Fullfill the transfer for item 1

Item 1 is now available and item 2 is in transit

Go to items record and filter holdings table with status "In transit"
=> Only item 2 is displayed

Filter holdings table with status "Available"
=> Only item 1 is displayed

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0485296221)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 01d8c0f1ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:08:47 +01:00
Katrin Fischer 141258d889
Bug 41008: Fix bulkmarimport.pl -a -d
After bug 35659 that added the OAI harvester to Koha the -d switch
for deleting authorities before importing with bulkmarcimport.pl
was broken and resulted in a FK error.

Switching from truncate to DELETE FROM like we already did for items,
biblio etc. fixes the issue.

To test:
- Make sure you have some authorities in your database
- Export some into a file for importing
- Run bulkmarcimport -a -d --file <filename>
- Verify you get the a DB FK constraint error.
- Apply patch
- Repeat steps, verify the script now works as expected again
  * Existing authorities are deleted
  * File is imported

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 59d07337de)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit eb6241644a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 15:03:44 +01:00
Martin Renvoize 36bfebe856
Bug 38072: Fix regression in modal_printer
This patch updates the JS for the modal printer to make it more
reliable.

I found that in recent versions of chrome the print dialog failed to
open and instead you were just faced with a flash of white before the
new tab autoclosed and no print takes place.

Test plan
1) Enable cash registers and point of sale preferences
2) Add a debit type and mark it as 'Can be sold'
3) Add a cash register
4) Use 'Point of sale' to sell one of the above item for cash against
   the register you just created.
5) Navigate to the register and 'cashup'
6) Click the 'summary' link to display a modal
7) Use the 'Print' option in the modal and confirm you face a print
   dialog and can print
8) The print tab should be closed and you should be back to Koha

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

Bug 38072: Ensure the printing tab closes

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Squashed and tidied.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit af31453c63)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit dd68cc79e6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 14:59:59 +01:00
David Cook b82c0ddd5f
Bug 38516: Use PDF template copy for exporting PDFs
Due to a bug in PDF::API2 or related libraries,
you cannot export a PDF if you do not have write
permission on the PDF template. We bypass this
problem by taking a string copy of the PDF template
and working on that instead.

Test plan:
0. DO NOT APPLY THE PATCH YET
1. chmod 444 /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/pdf/*.pdf
2. Create a basket with a vendor
3. Add an order to the basket
4. Close basket (and attach the basket to a new basket group with the same name)
5. Go to "Closed" tab and click "Export as PDF"
6. Note that you get an error when you try to open it in Adobe or some other PDF program

7. Apply the patch and restart koha (e.g. koha-plack --restart kohadev)

8. Try to "Export as PDF" again
9. Note that this time there is no warning and your PDF opens just fine
10. Repeat the "Export as PDF" process for every option of the
system preference "OrderPdfFormat". Every option should work
without errors.
11. Celebrate!

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a6ba625592)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 020e862d32)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 14:54:53 +01:00
Tomás Cohen Arazi b3a050fb20
Bug 41032: Fix Open Fifth missing in plugin repos config
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
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 cee02bbf3b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 420fb7148a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 14:35:24 +01:00
Lucas Gass 33ffba1f56
Bug 41149: Replace replaceWith() with empty() and append()
To test:

1. Set AllowRenewalOnHoldOverride to 'Dont allow'
2. Set  OverduesBlockRenewing to "block renewing"
3. Checkout an item and mark it as overdue.
4. Place a hold on that item to someone else
5. Now go look at the issues table for that patron/item
6. Check "Override renewal restrictions:"
7. Now a checkbox should appear in the "Renew" column, check it.
8. Click "Renew selected items"
9. After the "Renew failed: on hold" appears the spinning icon should
   disappear.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d51dc1fc69)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9fb160eca8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 14:33:42 +01:00
Marcel de Rooy b3d0db6e7b
Bug 41094: Fix search_anonymize_candidates, locked_account
We should not allow anonymizing patrons with failed login attempts
when the pref FailedLoginAttempts has not been set.

Test plan:
Run the test again from the previous patch. This should pass now.
Choose a patron with a positive value (say 55) in borrowers.login_attempts
or modify one. (NOTE: This patron will be anonymized in the test plan.)
Empty pref value for FailedLoginAttempts.
Set PatronAnonymizeDelay to 1.
Fill dateexpiry for this patron to yesterday.
Run cleanupdatabase.pl -confirm -v and check if the patron was NOT anonymized.
* Anonymized 0 patrons

Now set FailedLoginAttempts to a value (say 55) so that the patron is
considered as locked. (This unrealistic value is for testing only.)
MAKE SURE that you will not be anonymizing more patrons than you like
in the next step! (Set login_attempts to value < 55 for all other patrons.)
Run cleanupdatabase.pl -confirm -v again and check if the patron was anonymized.
* Anonymized 1 patrons
Restore the changed pref values.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 291c2f103d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 2fb7dab4a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:41:03 +01:00
Marcel de Rooy 56cd6fd0f0
Bug 41094: Improve test of search_anonymize_candidates/account_locked
Test plan:
Run the test without applying the follow-up patch.
The test should fail. This shows that we need the fix and will help
avoid future regressions.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 f4ff248b5c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9a2e2c3101)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:37:46 +01:00
Lucas Gass d7c98357c0
Bug 41212: Sort debit_types for manual invoice by description
To test:
1. Add some debit types that can be manually invoiced.
2. Go to members/maninvoice.pl?borrowernumber=X where X is your
   borrowernumber
3. In the type dropdown see that the entries are sorted by code not
   description.
4. APPLY patch and restart_all
5. Try again, now it should sort by code.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 644e4af1f6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a5c8ee1631)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:34:49 +01:00
Lucas Gass b93dafbb9e
Bug 40843: Sort patron attributes by description
To test:

1/ Have several borrower attributes set up so you can see how they sort
2/ Go to Tools >  Batch patron modification
3/ Notice the "Patron attribute:: dropdown near the bottom
4/ It is sorted by the attribute code, not the description.
5/ APPLY PATCH and restart_all
6/ Try again, it should sort by the description

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 29f9518785)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c63b49d8d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:31:14 +01:00
Caroline Cyr La Rose 829d8292b6
Bug 40664: Serial subscription input missing "Required" labels
This patch adds missing "Required" labels next to two mandatory fields
in the second page of the new serial subscription form.

To test:
1. Go to Serials
2. Click 'New subscription'
3. Enter a biblionumber in the 'Record' field (e.g. 230)
4. Click 'Next'
5. (Click 'OK' to confirm that you are not adding a vendor)
--> On the page 'Add a new subscription (2/2)' the fields 'Frequency' and 'Subscription start date' are red to indicate that they are mandatory, but there is no 'Required' note next to them.
6. Apply patch and refresh the page
--> It should say 'Required' next to all the mandatory fields (in red)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4bb7a1371c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f90a00164b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:27:00 +01:00
Jan Kissig 9b96dc0bb6
Bug 40836: (QA follow-up) Reduce params
Reduce params given to process method.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac7861bbe2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 69657d03f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:24:42 +01:00
Laura_Escamilla e5033e0c60
Bug 40836: OPAC Type column should show local debit/credit type descriptions
To test:
1. create a credit type that can be applied manually
2. create a debit type that can be applied manually
3. apply both a credit and debit to your patron (make sure auto-reconcile is off)
4. look at your patron's account in the staff interface, see values in the "account type" column
5. look at your patron's account in the OPAC, see the "Type" column is blank
6. Apply the patch - restart_all
7. Refresh the patron’s account in the OPAC — clear browser cache if necessary. The Type columns should now be populated.

Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a399374a2d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 66dde68869)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:23:39 +01:00
John Doe 2b724766f8
Bug 41039: Add cypress tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f59557d2a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d572b6f422)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:07:09 +01:00
Kyle M Hall 2a6485f8d1
Bug 41039: Prevent patron search button from being spammed triggering multiple api requests
Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching,
will trigger another patron search api request. This button should be disabled until the first searches results are displayed.

To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request.

Test Plan:
1) Browse to members-home.pl
2) Open the network tab of the developer console on your web browser
3) Double click the Search button
4) Note the two api requests in the network tab
5) Apply this patch
6) Reload the page
7) Double click the Search button
8) Note only one api request is made

If your results come back too fast, you may perform an initial search,
then change the number of results from the default 20 to "All" to
create a search that will take longer.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7db2818bf0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e203ba8dcc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 11:06:09 +01:00
Jonathan Druart c7d51c9423
Bug 38475: Skip some tests in InfiniteScrollSelect_spec
They are failing randomly for too long.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ef51ce1bd4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6733943bd3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 10:53:09 +01:00
Pedro Amorim 1537dc71a8
Bug 41257: Remove 'btn-sm' CSS class
It may have made sense in the past but I don't think it does anymore. It adds an odd bottom spacing to the button

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e59ad2eb48)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 445a942cf0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 10:51:35 +01:00
Pedro Amorim 32c5f14fc9
Bug 41257: Fix wording condition check
To reproduce:
1) Enable ILLModule
2) Visit ILL requests:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl
3) Where 'List requests' show, it should show 'Refresh'.
4) Apply patches, refresh, notice it now shows 'Refresh'.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c60be45364)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a334a1554c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 10:51:09 +01:00
Paul Derscheid 235d8ed495
Bug 35830: DBRev 24.11.10.002
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7d8199b1a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 10:36:24 +01:00
Brendan Lawlor 4376e369b2
Bug 35830: Add merge_borrowers subpermission
Merging patrons only required edit_borrowers permission
but would result in a patron deletion.

This patch requires a new merge_borrowers subpermission

To test:
1. Give a patron the following permissions
    catalogue, edit_borrowers, list_borrowers
2. Log into the staff interface as the patron
3. Do a patron search and select 2 patrons
4. Click merge patron - success - a patron got deleted
5. Apply patch, updatedatabase and restart_all
6. Repeat steps 3 and 4 - you can't
7. Add the new permission for merge_borrowers
8. Repeat steps 3 and 4 - now you can
9. prove t/Koha/Auth/Patrons.t

Sponsored-by: CLAMS
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5ce9d5af4e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 576b80bb1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 10:34:54 +01:00
Fridolin Somers 8f4d2803be
Bug 41167: [24.11.x] vendors not yet in VueJS
See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38010
2025-12-02 12:12:03 +01:00
Paul Derscheid b3ceaf8c7b
Bug 41167: (RMaint follow-up) Backport adaptation to satisfy xt/find-license-problems.t
Should be reverted as soon as Bug 40163 is backported.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 433e964526)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 12:06:29 +01:00
Marcel de Rooy 2ecd3a994a
Bug 41167: Add missing line to etx/koha-httpd.conf
Test plan:
Run xt/check_apache_conf.t again. Should pass now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5c0fb862ba)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit afe93c21a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 12:06:28 +01:00
Jonathan Druart 0583121b36
Bug 41167: Add test to compare both apache conf
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] chmod 755, shebang, remove Data::Printer, enable NoWarnings
       one regex delimiter; replaced a grep by a map
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1572ea7578)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8416af851b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 12:06:28 +01:00
Vivek Kumar 60ffc1a700
Bug 41167: Fix missing rewrite rules in koha-httpd.conf
This patch adds missing RewriteRules for ERM, Preservation and Acquisition modules in koha-httpd.conf to restore staff client functionality.

Test plan:
1. Apply patch
2. Restart Apache
3. Access acquisitions and ERM pages
4. Confirm functionality restored

Signed-off-by: Vivek Kumar <vivek.kumar@bestbookbuddies.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Bug 41167: (follow-up) Correct rewrite rules in koha-httpd.conf

This follow-up patch fixes issues from the initial patch for Bug 41167:
- Adds missing asterisks (*) in rewrite rule patterns
- Removes erroneous RewriteRules from the OPAC virtualhost
- Ensures all ERM, Preservation, and Acquisition rewrite rules are correctly placed under the intranet virtualhost

Test plan:
1. Apply patch
2. Restart Apache
3. Access ERM, Preservation, and Acquisitions modules
4. Confirm pages load correctly without 404 or routing errors

Signed-off-by: Vivek Kumar <vivek.kumar@bestbookbuddies.com>
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 47384fb03f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a483975974)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 12:06:27 +01:00
Lari Taskula 15d38d2104
Bug 41104: Remove -sameSite from checkauth() response headers
To test:
1. prove t/db_dependent/Auth.t
2. Observe success

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dbf812869d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c56b44ec98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 12:01:56 +01:00
lawrenceol-clams a2f8edf163
Bug 41207: Fix spelling of edit_items suggestion text in edit_catalog subpermission
This patch fixes the spelling of edit_items in the suggestion text in
an edit_catalog subpermission.

Test plan:
0. Go to a patron record
1. Click on more -> set permissions
2. Scroll down and expand the Edit Catalog
3. Notice the line says edit_item is required but the permission needed
   is edit_items
4. Apply patch
5. Repeat steps 0-3
6. Confirm the suggestion text in the edit_catalog subpermission now
   reads edit_items

Sponsored-by: CLAMS
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 1e3f2ccf2c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 09be4fb7f4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 11:52:59 +01:00
Nick Clemens 5c4970a830
Bug 41205: Skip undef records in Z39 response
This patch simply skips undefined records - this prevents the error
though it doesn't explain why we get undef records here and a Z39 search
from standard cataloging just returns nothing.

This prevents a breakage of the search.

To test:
1 - Have LOC defined as a Z39 Source (standard in KTD)
2 - Open the advanced editor
3 - Search for ISBN 9780520401129
4 - Search explodes, logs like:
     AH01215: stderr from /kohadevbox/koha/svc/cataloguing/metasearch: Can't call method "raw" on an undefined value at /kohadevbox/koha/Koha/MetaSearcher.pm line 267., referer: http://localhost:8081/cgi-bin/koha/cataloguing/editor.pl
    AH01215: stderr from /kohadevbox/koha/svc/cataloguing/metasearch: Magic number checking on storable file failed at /usr/lib/x86_64-linux-gnu/perl/5.36/Storable.pm line 443, at /kohadevbox/koha/Koha/MetaSearcher.pm line 144., referer: http://localhost:8081/cgi-bin/koha/cataloguing/editor.pl
5 - Must refresh the page to clear the bad error message
6 - Apply patch
7 - Repeat search - no results, LOC says 'Permanent system error'
8 - You can close the results and do a new search

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 7185201e93)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5c0c4bcb6a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 11:48:37 +01:00
Fridolin Somers 8f0f7fbf6a
Bug 29908: Remove warning when empty ClaimReturnedWarningThreshold in patron_messages.inc
System preference ClaimReturnedWarningThreshold manages the display of a patron message in case of too many claims.
But this preference may be empty. It is created empty in installer/data/mysql/mandatory/sysprefs.sql.

This generates a warning :
Argument "" isn't numeric in numeric gt (>) at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc line 128.

Test plan :
1) Set systempreference 'ClaimReturnedWarningThreshold' empty
2) Go to a patron details page
3) Check there is no warning in logs
4) Go to a patron check-out page
5) Check there is no warning in logs
6) Set systempreference 'ClaimReturnedWarningThreshold' with an integer (ie 5)
Repeat from 2)

Signed-off-by: Kyle M Hall <kyle@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 27230e64ad)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 86f3a33a2c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 11:33:09 +01:00
Lari Taskula cd8dc85ae9
Bug 41044: Fix warning
To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe success

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 d77c826c8c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit eec7e9ea48)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 11:27:50 +01:00
Lari Taskula 99a51b428d
Bug 41044: Add a failing test
To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe failing test

Subtest: test empty string warning
        1..1
        not ok 1 - No warnings were produced
           Failed test 'No warnings were produced'
           at t/db_dependent/Koha/Item.t line 3656.
         found warning: Argument "" isn't numeric in addition (+) at /usr/local/lib/x86_64-linux-gnu/perl/5.34.0/DateTime/Duration.pm line 70.
         didn't expect to find a warning
         Looks like you failed 1 test of 1.
    not ok 9 - test empty string warning
       Failed test 'test empty string warning'
       at t/db_dependent/Koha/Item.t line 3657.
     Looks like you failed 1 test of 9.
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 120ef099fc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 17b379984b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 11:27:49 +01:00
Marcel de Rooy e93bb2958d
Bug 40559: Fix noisy warning in MARCdetail
Rebased for 25.06.
Resolves:
    Use of uninitialized value in string eq at /usr/share/koha/catalogue/MARCdetail.pl line 203.

Test plan:
Make sure that there is a combination of framework/field/subfield having
an entry in marc_subfield_structure where kohafield is NULL.
To force this for default fw on 020$q:
    update marc_subfield_structure
    set kohafield=NULL
    where tagfield='020' and tagsubfield='q' and frameworkcode='';
Pick a biblio in this framework having that field/subfield. Or create
a 020 with $q filled. Hit catalogue/MARCdetail now.
Without this patch, it triggers the warn. With this patch, it does not.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 40d1cdeeb1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 96c574853d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 11:24:04 +01:00
Jonathan Druart e9e44a39e1
Bug 38080: Fix order of columns in opac's holdings tables
The order of the columns in the yaml file must match the order of the
columns in the template file.

Test plan:
Confirm that, with bug 30633 applied, you can pick "shelving location"
as the default sort order and that the items are correctly sorted by
shelving location.

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 9f42c5fe28)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 78ee3caa6f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 11:12:34 +01:00
Slava Shishkin 12a6dda17a
Bug 40720: Misleading title attribute "Remove all items" in Select2 fields
This patch updates our Select2 initialization script to update the
strings used as title attributes on the "X" control which appears in a
Select2 dropdown when you've made a selection.

The updated text reads "Clear selections" in order to eliminate the
ambiguity of the word "items."

To test, apply the patch and clear your browser cache.

- Go to Catalog -> Item search.
- Make one or more selections in any of the Select2 dropdowns (e.g. Home
  library, current library, item type, etc.).
- An "X" should appear at the end of the field after you've made one or
  more selections.
- Hover your mouse over the "X." The title which appears should read
  "Clear selections."

Sponsored-by: Athens County Public Libraries

Signed-off-by: Slava Shishkin <slavashishkin@gmail.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a8dd0bc13f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 98ec1e1134)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:54:42 +01:00
Jonathan Druart dd8b69b7d4
Bug 40988: Remove pagination for funds on acqui home
As well as the fund list view (admin/aqbudgets.pl)

Signed-off-by: Sarah Berry <sberry@pascolibraries.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7dac6055b2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7076be71db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:52:15 +01:00
Caroline Cyr La Rose a50e1a5395
Bug 41092: Some system preferences have target='blank' instead of target='_blank'
This patch changes target='blank' to target='_blank' in system
preferences.

To test:
1. Apply the patch
2. Check the following system preferences, click on the links,
   make sure every click opens in a new tab
   - UniqueItemFields
   - PatronSelfModificationMandatoryField
   - PatronSelfRegistrationBorrowerMandatoryField
   - PatronSelfRegistrationBorrowerUnwantedField
   - PatronSelfModificationBorrowerUnwantedField
   - EmailFieldPrecedence
   - BorrowerMandatoryField
   - BorrowerUnwantedField
   - PatronQuickAddFields
   - PatronDuplicateMatchingAddFields

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4d1a556c15)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8555a7a78e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:32:15 +01:00
Fridolin Somers dbe9bb170c
Bug 40903: Fix OPAC advanced search applies a limit of the logged-in library by default
This is caused by Bug 36742. It exists in main but starts in 24.11.

The OPAC advanced search now automatically applies a limit to the 'Location and availability' section using the patron's logged in library, even if there are multiple libraries in the system.
This feature must be depending on system preference 'SearchMyLibraryFirst'.

1) Set system preference 'SearchMyLibraryFirst' to 'Don't limit'
2) Go to OPAC
3) Authenticate with a user
4) Go to advanced search
5) Check there is no library selected in 'Location and availability'
6) Select a library and submit
7) Clik on 'Return to the last advanced search'
8) Check the library is selected in 'Location and availability'
9) Set system preference 'SearchMyLibraryFirst' to 'Limit'
10) Go to OPAC
11) Authenticate with a user
12) Go to advanced search
13) Check library of patron selected in 'Location and availability'

Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d14619158e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e4026f08a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:29:42 +01:00
Marcel de Rooy 0df2d94dfa
Bug 41024: Unify spelling of BorrowersLog, keep plural form
The singular form is wrong and only exists in textual context.
This is a result of git grep | xargs sed.

Test plan:
Read the patch.
git grep BorrowerLog

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4a267d0e9b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f59d8c46e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:28:33 +01:00
Marcel de Rooy 2a2d7eb0d2
Bug 41123: Remove useless dbh call in Koha::Patron
Test plan:
Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1a2d1774f0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e82a85a105)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:22:58 +01:00
Jonathan Druart bc7df6e6f1
Bug 40845: Remove hardcoded Koha version from t/Koha/Manual.t
Test plan:
Update the version in DB:
> update systempreferences set value="25.1100000" where variable="version";
restart_all
prove t/Koha/Manual.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8358957f57)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f298d75280)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:20:07 +01:00
Jonathan Druart f711c48bcd
Bug 39712: Add tests
Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5beaaf171d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fc8e8ad055)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:20:01 +01:00
Jonathan Druart 45bad98086
Bug 41082: Fix batch tools from reports when itemnumber col has been renamed
Description from comment 0

When creating an SQL report and it contains the column itemnumber, we
activate batch operations above the table. The itemnumber column can be
renamed, using the syntax [[itemnumber|Exemplarnummer]], which gives us
the option to translate the column name into something nicer for
display.

But: if you then send to batch item edit, the items are not
transmitted.

Test plan:

1) Create a report:
   select itemnumber, itemcallnumber from items;

2) Send some items to batch item edit, verify the items are shown above
   the item form

3) Update the report:
   select [[itemnumber|Exemplarnummer]], itemcallnumber from items;

4) Verify the report still shows as before with the batch options
   available and only the column being renamed.

5) Send some items to the batch item edit again

   => verify the items are shown above the item form

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 26d740f267)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a021250a87)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:17:14 +01:00
Baptiste Wojtkowski 5b493d626d
Bug 41112: Space is missing in report preview
This patch puts back a missing space between "Delete" and the fa
thrashcan. It is atm the lonely button without this space in the modal

No test plan needed. The change is too trivial.
Just check that lines before in the code have the desired space. The
missing space creates a weird sensation while looking at the window.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a95f5ea73a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a4ea95c924)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 10:15:29 +01:00
Martin Renvoize 447b86cad8
Bug 40625: Fix duplicate cashup records via POST/REDIRECT/GET pattern
The cashup functionality on both /pos/register.pl and /pos/registers.pl
pages was using GET requests via anchor tags, which could cause
duplicate cashup records when users refreshed the page after performing
a cashup.

This patch implements proper POST/REDIRECT/GET pattern with CSRF
protection:

1. Convert anchor tag buttons to proper HTML forms with submit buttons
2. Add CSRF token protection to all cashup operations
3. Change operation from 'cashup' to 'cud-cashup' for CSRF compliance
4. Implement redirects after successful cashup operations to prevent
   resubmission
5. Update JavaScript to populate form fields instead of href attributes

This ensures cashup operations follow HTTP semantics properly (POST for
state changes) and prevents duplicate submissions while maintaining the
existing user experience.

Test plan:
1. Apply patch and restart services
2. Go to Point of Sale > Cash registers
3. Click "Record cashup" on any register - should open modal
4. Click "Confirm" - should perform cashup and reload page
5. Refresh the page - should NOT create duplicate cashup record
6. Go to Point of Sale > Register for individual register
7. Click "Record cashup" - should open modal
8. Click "Confirm" - should perform cashup and reload page
9. Refresh the page - should NOT create duplicate cashup record
10. On registers page, try "Cashup all" button - should work correctly
11. Verify all existing functionality (modals, summaries) still works
12. Check browser developer tools - all requests should be POST for
    cashup operations

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 26f1f91a13)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d4d9a849b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 09:52:51 +01:00
Jonathan Druart dce55591a8
Bug 40978: Remove warnings from Budgets.t
If no shipment_budget is set then undef is set as key of the hashref
which generates a warning:
  Use of uninitialized value $row[0] in hash element at /usr/lib/x86_64-linux-gnu/perl5/5.40/DBI.pm line 2122.

Later we only access the hashref by budget_id, so this change seems
safe.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f073262263)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d4fd8fd299)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 16:33:18 +01:00
Nick Clemens 2861e8fdf8
Bug 41074: Don't reverse previous_patrons arrary
This patch alters the code to append instead of prepend, removing the need to reverse the list

To test:
1 - Write a report to get some patron
SELECT cardnumber,surname FROM borrowers WHERE cardnumber <>'' ORDER BY rand() LIMit 6
2 - Enabled 'showLastPatron' and set count to 3
    http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=showLastPatron
3 - Copy the barcodes in order from the report and search for them in patron search, you'll want two tabs so you can keep report open
4 - Notice at 4th patron that list order has changed
5 - When 5th patron is loaded, the 4th is removed from the list
6 - Apply patch
7 - Clear the list
8 - Repeat the test plan, but note that list order does not change
9 - Confirm the patrons are removed from the list in expected order when adding new
10 - Change the count to 1 and search for several patrons, ensuring the last patron link is always correct

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f689133aaf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 0ca35af93a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 16:24:10 +01:00
Pedro Amorim 150cafc68f
Bug 41057: Return 404 if creating backend is not an OPAC backend
Signed-off-by: Nial Halford-Busby <n.halford-busby@lboro.ac.uk>
2025-11-10 16:22:41 +01:00
Lucas Gass 7650698667
Bug 40969: Mock the RenewalPeriodBase preference correctly
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 412879a418)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fb29ac4205)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 16:21:25 +01:00
Jonathan Druart 12d0074b82
Bug 40470: Fix filtering by REPORT_GROUP when auth val is numeric
When the authorised value of a REPORT_GROUP is numeric the filtering
does not work.

Test plan:
Create a new REPORT_GROUP av "123" (the description can be alphanumeric)
Create a new report and assign it to this new group
Confirm that with this patch the filtering works when the "123" tab is
selected

Signed-off-by: George <george@nekls.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bed343d5ed)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 82a10f632d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 16:20:29 +01:00
Jonathan Druart 7c4c2009b6
Bug 40907: Prevent DT crash when searching with regex metachars
We should remove the regex metacharacters from the string or JS code
will raise an error and the query won't be generated, leading to the DT
neverending loading problem.

Test plan:
Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4
In the global "Search" of the items table, search using a regex
metacharacters in order to form a broken regex (eg. '[')
=> Without this patch there is a JS error in the console "Uncaught
SyntaxError: unterminated character class" and you get the "Processing"
that never ends
=> With this patch applied the search succeeds.

Signed-off-by: Mathieu <mathsabypro@gmail.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0f6f5ab252)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c338abe8c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 16:18:07 +01:00
Jonathan Druart 5f2b48dc54
Bug 40907: Add a Cypress test
Signed-off-by: Mathieu <mathsabypro@gmail.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7c4c013645)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 000ba6efdd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 16:18:06 +01:00
Andrew Fuerste Henry 6528be8687
Bug 40937: Include show data menu button for batch_borrowernumbers
To test:
1 - save and run a report of "SELECT borrowernumber FROM borrowers"
2 - observe your results page does not include the Show Data Menu button
3 - save and run a report of "SELECT cardnumber FROM borrowers"
4 - observe your results page does include the button
5 - save and run a report of "SELECT borrowernumber, cardnumber FROM borrowers"
6 - observe you are once again buttonless on the results page
7 - apply patch
8 - run your report from step 1, observe you now have the button
9 - run your report from step 3, observe you still have the button
10 - run your report from step 5, observe you now have the button
11 - confirm that the batch actions dropdown only includes the patron actions once

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5e5ffeea82)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8c8128a7ba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 16:06:12 +01:00
Nick Clemens 7355dafbe1
Bug 40997: Remove uneccessary whitespace
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 605cc89893)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 251f394413)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:59:11 +01:00
Nick Clemens ef164eec66
Bug 40997: Don't check elements that have been removed
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a7be3a3f8b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e579b8a15a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:51:31 +01:00
Jonathan Druart 868e309ec0
Bug 40041: Remove duplicated or unecessary entries
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 01c2e93a5d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9c0d13b39b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:47:59 +01:00
Tomás Cohen Arazi 7353e74c03
Bug 40041: Reorganize and fix .mailmap file
- Group same-person entries together for better maintainability
- Normalize excessive whitespace padding that breaks terminal tools like tig
- Add column alignment with second column at position 65 for readability
- Move all sponsor entries to bottom of file
- Add missing canonical name mappings for unmapped emails:
  * Matt Blenkinsop, Andrew Auld, Colin Campbell variations
  * Mathieu Saby email/username mappings
- Remove malformed entry (Alex Arnaud = <=>)
- Fix Colin Campbell canonical mapping to OpenFifth email

This improves .mailmap functionality in both newer git versions
and older versions like those in KTD (git 2.39.5).

To test:
1. Run:
   $ ktd --shell
  k$ for i in colin.campbell@openfifth.co.uk chloe.zermatten@openfifth.co.uk martin.renvoize@openfifth.co.uk aude.charillon@openfifth.co.uk andrew.isherwood@ptfs-europe.com matt.blenkinsop@openfifth.co.uk matt.blenkinsip@ptfs-europe.com matt.blenkinsop@ptfs-europe.com andrew.auld@ptfs-europe.com pedro.amorim@ptfs-europe.com msaby mathsabypro@gmail.com marjorie.barry-vila@collecto.ca andrew.auld@openfifth.co.uk catrina@bywatersolutions.com felicie.thiery@biblibre.com janne.seppanen@lahti.fi jesse@bywatersolutions.com kelly@bywatersolutions.com laurence.rault@biblibre.com samalau@gmail.com ; do git check-mailmap -- "<$i>" ; done
=> FAIL: Don't look like canonical email entries
2. Apply this patches
3. Repeat 1
=> SUCCESS: They look great!
4. Sign off :-D

Signed-off-by: Tomás 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 357558d954)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 57f02a13b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:44:11 +01:00
Tomás Cohen Arazi 614653e9d6
Bug 40041: Fix structurally incorrect .mailmap entries
This patch fixes malformed entries in .mailmap that were causing
display issues and incorrect author mapping.

Issues fixed:
- Marjorie Barry-Vila: Missing closing '>' in email address
- Mathieu Saby: Incorrect alias format instead of proper mailmap format
  (was using excessive padding with alias, now uses proper
   'Name <email> OldName <email>' format)

These structural issues were breaking terminal display in tools like
tig and preventing proper author consolidation.

Test plan:
1. Apply patch
2. Run: git log --oneline | head -20
=> SUCCESS: Authors display correctly
3. Check in tig or other git tools
=> SUCCESS: No excessive column width issues
4. Verify mailmap functionality:
   git shortlog -sn | grep -E 'Mathieu|Marjorie'
=> SUCCESS: Authors properly consolidated
5. Sign off :-D

Signed-off-by: Tomás 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 6c3153a481)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 52b59aa736)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:42:58 +01:00
Tomás Cohen Arazi a283a8d97f
Bug 40959: Fix LOC classification display (staff interface)
This patch fixes the display logic for the LOC classification field
(050).

The current issue is that the inner components (each subfield) gets
separated with the pipe symbol (|) instead of grouping the components
together and using the separator for the outer 050 occurences.

To test:
1. Open a record to edit it
2. Add 050 like this:

```
050  4 $aE337.5 $b.O54 2025
050  4 $aE415.7 $b.A44 2025
```

3. Save
=> FAIL On the staff interface it displays:

```
LOC classification: E337.5 | .O54 2025 E415.7 | .A44 2025
```

4. Apply this patch
5. Run:
   $ ktd --shell
  k$ restart_all
6. Reload the detail page
=> SUCCESS: Things display correctly!
7. Sign off :-D

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d2d85c9f4a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 1ad044b981)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:39:41 +01:00
Paul Derscheid 9efaa024cf
Bug 40936: DBRev 24.11.10.001
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3200bc9301)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:36:51 +01:00
Kyle M Hall 67af009e28
Bug 40936: Add index for default patron sort order
The default sort order for Koha's patron search includes many columns, some of which are not indexed:

[% CASE 'name-address' %] {
"data":"me.surname:me.preferred_name:me.firstname:me.middle_name:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country",

Depending on the number of patrons in the database, and the specific configuration of the server, this can end up generating a query that creates a temp table in the hundreds of gigabytes of data or more. Not only does this risk crashing a database server with insufficient disk space, it's also incredibly slow.

We've found a compound index prevents the issue and also makes the search much faster. InndoDB indexes have a fixed maximum length which is too small ( 3072 bytes ) to encompass the full data for all the fields we need to sort by.

The following works well as a comprise to keep the index length within the maximum:
CREATE INDEX idx_borrowers_sort_order ON borrowers (
    surname(100),        -- 400
    preferred_name(80),  -- 320
    firstname(80),       -- 320
    middle_name(50),     -- 200
    othernames(50),      -- 200
    streetnumber(20),    -- 80
    address(100),        -- 400
    address2(75),        -- 300
    city(75),            -- 300
    state(40),           -- 160
    zipcode(20),         -- 80
    country(40)          -- 160
);

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Perform a patron search
4) No change in behvior should be noted!

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 63c44cbd0e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b8fa49bb73)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:35:44 +01:00
Martin Renvoize d191e33740
Bug 39408: (QA follow-up) Add unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ef5ba9a42d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 754820b8ef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:23:54 +01:00
Nick Clemens 3e506d58ab
Bug 39408: Don't attempt to send a message if one is not generated
The routine to create the message can return nothing if there is no content,
we should handle this case and not attempt to send.

To test:
1 - Test plan from last patch
2 - Apply this patch
3 - POST to patron API again
4 - Success!

Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c1fa513be9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 91da4b4b38)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:21:27 +01:00
Nick Clemens 0a843c9a30
Bug 39408: Handle BadParameter exception better
Currently we assume BadParameter has been thrown with a parameter that is a valid patron field.
It may only include a message, or it may have come from outside the patron object, we should
handle all cases.

To test:
1 - Wrap "WELCOME" notice content in conditional:
    [% IF borrower.categorycode != 'SELFREG' %]
    ...
    [% END %]
2 - Enable preference AutoEmailNewUser
3 - Attempt to self register a patron via API with body:
    {"surname":"PATRON","firstname":"PROBLEM","library_id":"CPL","category_id":"SELFREG","email":"eample@example.org"}
4 - Response error: "Given  does not exist"
5 - Apply this patch, restart all
6 - Repeat 3
7 - Response error: "Exception 'Koha::Exceptions::BadParameter' thrown 'Parameter message_id cannot be empty if passed.'\n"
8 - It's uglier, but actually helpful

Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ae14a11937)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7036902f57)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:21:27 +01:00
Jonathan Druart 73cc0de5da
Bug 41012: (bug 40622 follow-up) Clear the MSS cache
For some reasons t/db_dependent/ILSDI_Services.t fails if run after
t/db_dependent/api/v1/biblios.t

When we modify the MARC subfield structure from the tests we must flush
the cache.

Actually I don't understand why the tests are even passing.

I have not tracked down why it only fails when run after t/db_dependent/api/v1/biblios.t

Test plan:
0. Do not apply this patch
1. prove t/db_dependent/api/v1/biblios.t t/db_dependent/ILSDI_Services.t
It fails
    #   Failed test 'Title hidden in output as expected'
    #   at t/db_dependent/ILSDI_Services.t line 874.
    #          got: '1'
    #     expected: '0'
2. Apply this patch, repeat 1.
=> it's green!

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b6aab57065)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit adbc9548fd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:05:40 +01:00
Fridolin Somers 24825b223c
Bug 40785: Cronjob cleanup_database.pl remove args in usage first line
Cronjob cleanup_database.pl usage is wrong :
Usage: $0 [-h|--help] [--confirm] (...) [--bg-days DAYS [--bg-type TYPE] ]
Those args has been renamed jobs-days and jobs-type.
Also some args are missing.

There are too many args, I propose to remove them from there, one need to read the full help.

Test plan:
Run command line `misc/cronjobs/cleanup_database.pl -h`
You see first line:
Usage: misc/cronjobs/cleanup_database.pl

   -h --help          prints this help message, and exits, ignoring all
...

Signed-off-by: Anke Bruns <anke.bruns@gwdg.de>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3aefbaeaf6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d46e9d25a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:04:03 +01:00
Lisette Scheer c7f9a1f655
Bug 35700: Holds reminder cronjob - Fix --triggered switch if the day to send notice hits concurrent holidays
If the holds reminder cronjob would send a reminder on a holiday,when holidays are taken into account, it also will send it on the subsequent holidays and the first open day.
This bugfix adds a check to the cron when --holidays is set to skip sending the notices for that library if today is a holiday.

To Test:
Before applying:
1. Create a hold for a patron (I used patron 23529000035676 and 39999000000252)
2. Ensure your patron has an email address set and the hold reminder email selected.
3. Set the hold to waiting by checking it and confirming the hold.
4. In Tools->Calendar add a holiday to yesterday and a seperate holiday to today.
5. On the command line (the date should be set to 5 days ago for my commands to work and any dates adjusted accordingly)
koha-mysql kohadev
update reserves set waitingdate="2025-09-25"
exit
perl misc/cronjobs/holds/holds_reminder.pl -days 3 -t -v -holidays --date 2025-09-29
6. Observe that 1 notice would have sent to your patron
7. On the command line
perl misc/cronjobs/holds/holds_reminder.pl -days 3 -t -v -holidays
8. Observe that 1 notice would have sent to your patron
9. On the command line
perl misc/cronjobs/holds/holds_reminder.pl -days 3 -t -v -holidays --date 2025-10-01
10. Observe that 1 notice would have sent to your patron

11. Apply patches
12. Repeat the last command from step 5 and step 7
13. Observe that no notice should be sent for your patron
14. Repeat step 7
15. Observe that a notice should be sent for your patron.
16. Run
perl misc/cronjobs/holds/holds_reminder.pl -days 5 -t -v
17. Confirm the notice should be sent for your patron
18. Sign off

Signed-off-by: Katie Bliss <KEBliss@dmpl.org>

Bug 35700: (QA follow-up) fix POD and $today

This patch replaces the inncorrectly removed POD note and replaces $today with the more correct $date_to_run for checking if we should be skipping sending the message on the day.

Amended-by: Jonathan Druart
Squashed and adjusted commit title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b895eb9b7d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 00ee0cc163)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:03:05 +01:00
Marcel de Rooy 18ab14ca08
Bug 40985: Clarify POD of Holds->filter_by_found
Test plan:
Read POD.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f0991861e2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ae9b83ae96)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 15:00:54 +01:00
Paul Derscheid c8ad1f3163
Bug 40915: (RMaint follow-up) Backport adaptation to satisfy xt/find-license-problems.t
Should be reverted as soon as Bug 40163 is backported.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 43c06a34ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:52:06 +01:00
Tomás Cohen Arazi 70c9fa23b0
Bug 40915: Add enhanced debug logging for empty critical fields in SIP message parsing
This patch adds debug logging to C4::SIP::Sip::MsgType::_initialize() to help
identify when critical fields (patron_id, item_id) are parsed as empty values.

Empty critical fields in SIP messages can later cause DBIx::Class constraint
errors when passed to Koha::Objects->find() operations, generating confusing
'Odd number of elements in anonymous hash' errors in SIP server logs.

The enhanced logging helps administrators identify the root cause by logging
when empty patron_id or item_id fields are detected during message parsing.

To test:
1. Apply regression tests patch first
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/SIP/MsgType.t
=> FAIL: Debug logging tests fail (no enhanced logging present)
3. Apply this patch
4. Run:
   $ ktd --shell
  k$ prove t/db_dependent/SIP/MsgType.t
=> SUCCESS: All tests pass, debug logging works correctly
5. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 220fdce180)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c7330715b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:52:06 +01:00
Tomás Cohen Arazi 4a2e548fff
Bug 40915: Add comprehensive regression tests for SIP MsgType message parsing and debug logging
These tests verify that C4::SIP::Sip::MsgType correctly parses SIP messages without
creating problematic arrayref field values, and validates enhanced debug logging for
empty critical fields.

Test Coverage:
• Message parsing with correct protocol versions (PATRON_INFO/HOLD/RENEW use v2, CHECKOUT
uses v1)
• Empty patron_id and item_id field detection with debug logging
• Malformed delimiter handling (double delimiters, trailing empty fields)
• Multiple consecutive empty fields in single message
• Confusing delimiter patterns that could break parsing
• Verification that parsed fields are strings, not arrayrefs
• Working siplog mock infrastructure in C4::SIP::Sip::MsgType

Arrayref Prevention Tests:
Tests verify message parsing DOESN'T create empty arrayrefs that would later cause "Odd
number of elements in anonymous hash" errors when passed to Koha::Objects->find()
operations.

Enhanced Debug Logging Tests:
Tests validate that empty critical fields (patron_id, item_id) are detected during
parsing and generate appropriate debug messages to help troubleshoot downstream
constraint errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 499b23d63c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 116d3d9f06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:52:05 +01:00
David Cook 7275f61b59
Bug 40622: Use OPAC MARCXML for ILS-DI GetRecords
This change makes it so that the ILS-DI GetRecords output for
"marcxml" will contain the OPAC version of the record.

Test plan:
0. Apply the patches
1. prove t/db_dependent/ILSDI_Services.t
2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29
3. Click "Settings" to change the framework to Default, and click "Save"
4. Go to http://localhost:8081/cgi-bin/koha/admin/marc_subfields_structure.pl
?op=add_form&tagfield=245&tagsubfield=a&frameworkcode=#subafield
5. Untick the "OPAC" box and click "Save changes"
6. Go to system preferences
7. Change "ILS-DI" to "Enable"
8. Change "ILS-DI:AuthorizedIPs" to 0.0.0.0/0
9. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29
10. Note that you cannot see the title in the MARCXML.

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 02aba8c0b2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 0ec1ea7fc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:46:42 +01:00
David Cook 51d4529b63
Bug 40622: Add missing interface parameter
This change adds the missing interface parameter which
Bug 38233 initially added.

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 e5a302d968)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 1e35ae3e20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:45:37 +01:00
Tomás Cohen Arazi 3eed9284d6
Bug 40027: (follow-up) Add .github/ to Makefile.PL
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7939c4d7d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 0fa5eb583b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:44:11 +01:00
Michał Kula 1843ec8b72
Bug 40027: Use GitHub workflow to automatically close PRs opened on the Koha repo there
Automatically redirect users who try to submit a PR at GitHub to instructions on how to submit patches and close the PR. Better experience for potential new developers (since they get immediate feedback, while still in the flow for submitting the patch).

The sparse checkout of readme is probably required, so that the gh command knows on what repo to work with.

Based on: https://github.com/mozilla-firefox/firefox/blob/main/.github/workflows/close-pr.yml

Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d6b95024bc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f3538049b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:42:18 +01:00
Lucas Gass fd8fa396b1
Bug 40899: Fix rendering of JSON in data-attribute with html filter
To test:
1. Place a hold on many items
2. Change the "Pickup at:" dropdown" to something else
3. Notice the "Pickup location:" dropdowns do not change with it
4. APPLY PATCH
5. Try steps 1 & 2 again. This time the dropdpwns should adjust accordingly

Signed-off-by: Chip Halvorsen <chip.halvorsen@westlakelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3ffeb14e4b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 2f273e4655)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:36:47 +01:00
Martin Renvoize fa35104e12
Bug 32950: (follow-up) Fix copy_field regression for cross-field operations
The bug 32950 fix introduced a regression that broke copy_field operations
when copying between different fields or when copying a subfield to itself
within the same field.

The original fix correctly handled moving subfields between different
subfields within the same field (e.g., 020$z to 020$a) by using
field_exists() to identify which fields have the source subfield.

However, this logic was applied too broadly:

1. Cross-field operations (e.g., 650$a to 651$a): The fix passed source
   field_numbers to _update_subfield for the target field, causing it to
   look for non-existent target field positions. This resulted in
   insert_fields_ordered creating new fields out of order.

2. Same-field, same-subfield operations (e.g., 952$d to 952$d): The fix
   prevented copying to fields that didn't have the source subfield, but
   the original behavior was correct for duplicating a subfield to itself.

This patch restricts the bug 32950 logic to only apply when:
- Source and target fields are the same AND
- Source and target subfields are different

Additionally, it ensures field_numbers are not passed to _update_subfield
when copying between different fields.

Test plan:
1. Run prove t/SimpleMARC.t
2. All tests should pass, including:
   - Cross-field copy operations (650$a to 651$a)
   - Same-field, different-subfield operations (020$z to 020$a)
   - Same-field, same-subfield operations (952$d to 952$d)

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 83126898de)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b30e54a86c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:50:33 +00:00
Jonathan Druart 0bfc22ae46
Bug 32950: Remove unecessary DELETE
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e39e568e6a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 22930bb0f1)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:50:32 +00:00
Martin Renvoize 83979b0c85
Bug 32950: Fix moving subfield losing values for repeatable fields
Moving one subfield to another was failing for repeatable fields where
the field to be moved doesn't exist in the first instance. When moving
subfields within the same field type (e.g. 020$z to 020$a), existing
subfield values in fields that didn't contain the source subfield were
being overwritten with values from other fields.

This patch fixes the issue by determining which fields actually contain
the source subfield and only updating those corresponding target fields,
preserving existing values in fields that don't have the source subfield.

The fix adds logic to _copy_move_subfield to:
1. Use field_exists() to identify which fields have the source subfield
2. Pass these field numbers to _update_subfield for targeted updates
3. Preserve all existing functionality while fixing the data loss bug

Test plan:
1. Create a MARC modification template to move 020$z to 020$a
2. Create a record with multiple 020 fields:
   - Some with existing $a values
   - Some with $z values to be moved
3. Apply the template
4. Verify existing $a values are preserved
5. Verify $z values are moved to $a only in appropriate fields
6. Verify $z subfields are removed after the move

Signed-off-by: Bernard Scaife <bernard.scaife@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 346dd2073a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8166a95f2a)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:50:30 +00:00
Martin Renvoize 1c0bfc69b4
Bug 32950: Add test for moving subfield in repeatable fields
This test verifies that when moving subfields between repeatable fields,
existing values in fields that don't contain the source subfield are
preserved.

The test creates multiple 020 fields:
- Some with existing $a values
- Some with $z values to be moved to $a

After applying the move template, it verifies:
- Existing $a values are preserved
- $z values are moved to $a only in fields that had $z
- $z subfields are properly removed after the move

Signed-off-by: Bernard Scaife <bernard.scaife@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit daa661f86c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 84839808bb)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:49:55 +00:00
Kyle M Hall 7b0d801b7e
Bug 40953: marc_ordering_process.pl broken due to accidental newline
Executing marc_ordering_process.pl will fail to run with the following errors:

/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 21: =head1: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 23: marc_ordering_process.pl: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 25: =head1: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 27: --confirm]: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 27: --verbose]: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 27: ./marc_ordering_process.pl: No such file or directory
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 29: or,: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 31: 0: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 33: =head1: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 35: This: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 36: If: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 38: =head1: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 40: =over: command not found
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 42: syntax error near unexpected token `newline'
/usr/share/koha/bin/cronjobs/marc_ordering_process.pl: line 42: `=item B<-v|--verbose>'

This is due to an inadvertent newline before the shebang of the script.

Test Plan:
1) Run ./misc/cronjobs/marc_ordering_process.pl
2) Note the error
3) Apply this patch
4) Run ./misc/cronjobs/marc_ordering_process.pl
5) No error!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a067423f3f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit edec2009dc)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:41:29 +00:00
Laura_Escamilla bdafea91e5
Bug 40897: Resized the field lengths to ensure even lengths
To test:
1. Select an existing record and manage items (or create a new record) so that you are on the additem.pl form.
2. Notice that the fields are uneven lengths.
3. Apply the patch. Do a yarn build and restart_all. Clear your browser cache if necessary.
4. Refresh the additem.pl page and notice that the fields are all the same length now.
5. Sign off and have a great day!

Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 932c1c07dd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9b4891ea2f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:20:58 +00:00
Marcel de Rooy c79dd1546a
Bug 40929: Add $hold test in opac-modrequest
Test plan:
Login at OPAC.
Pass an unexisting reserve_id in a opac-modrequest.pl URL.
Verify that you get a 403 redirect.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 013a469b45)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 79c93d7a3d)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:12:36 +00:00
Pedro Amorim bd4a8ca6f7
Bug 40171: Add tests
prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 46ffd07b85)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ded9e8584d)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:06:00 +00:00
Pedro Amorim 5f492b1824
Bug 40171: Return fail if no transports for patron
Test plan, k-t-d, don't apply patches yet:
1) Enable ILLModule
2) Create a new ill request at:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Pick any type and any library, pick '42' for patron. This is the 'koha' user.
4) Create the request, click 'Send notice to patron'. Pick any template. Notice nothing is shown on the UI.
5) Apply patches. Repeat. Notice you get the message:
  "The requested notice was NOT queued for delivery by email, SMS".
6) Edit the 'koha' patron and tick the following boxes on 'Patron messaging preferences':
   - Interlibrary loan ready
   - Interlibrary loan unavailable
7) Go back to the request and click 'Send notice to patron' and pick any option again. Notice now you get a success message.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4bd5b58cd9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 82c23565be)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:05:59 +00:00
Pedro Amorim 925e3cf731
Bug 40171: Remove extraneous join()
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e82dbf43a1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 85bcc44aa7)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:05:58 +00:00
Pedro Amorim 4f17917489
Bug 40171: Fix tt param name
Its tran_fail, not tran_error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dbbdfaa7f2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6e64b1b432)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:05:56 +00:00
Jonathan Druart 92b7657785
Bug 40467: Remove t/00-deprecated.t
it only tests for the presence of "switch"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d996664353)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 316c59c3e3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 15:00:35 +00:00
Marcel de Rooy effbbafd8a
Bug 40605: Copy sentence from opac-memberentry in opac-patron-consent
Test plan:
Enable PrivacyPolicyConsent; you can set it to Permissive.
Check if the OPAC user page (tab Consents) shows it correctly now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2a7d8cddc2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit eb8b5e60cb)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:58:13 +00:00
Tomás Cohen Arazi c3841f7554
Bug 40820: (follow-up) es_indexer_daemon.pl missed on 34070
The es_indexer_daemon.pl was missing handling for the case where
Koha::BackgroundJob->connect() returns undef without throwing
an exception (which happens when connection fails silently).

This adds the missing warning for that case, matching the behavior
in background_jobs_worker.pl.

Test plan:
1. Set JobsNotificationMethod to 'STOMP'
2. Configure invalid STOMP settings that cause connect() to return undef
3. Run es_indexer_daemon.pl - should show connection warning
4. Verify jobs are still processed via database polling

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9ca0e183b5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f39c370980)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:54:07 +00:00
Tomás Cohen Arazi a69abf0bb1
Bug 40820: Fix STOMP connection warnings when JobsNotificationMethod is 'polling'
The background job workers are showing STOMP/RabbitMQ connection error
warnings even when the JobsNotificationMethod system preference was set
to 'polling', which doesn't require a message broker connection.

This patch adds checks for the JobsNotificationMethod preference before
displaying connection warnings, so warnings only appear when STOMP is
actually expected to be available.

Changes:
- misc/workers/background_jobs_worker.pl: Check syspref before warning
- misc/workers/es_indexer_daemon.pl: Check syspref before warning

Test plan:
1. Set JobsNotificationMethod to 'polling'
2. Run background_jobs_worker.pl - should not show STOMP warnings
3. Run es_indexer_daemon.pl - should not show STOMP warnings
4. Set JobsNotificationMethod to 'STOMP' without RabbitMQ running
5. Run workers - should show appropriate STOMP connection warnings
6. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4ff1f4ca9c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c9f4566aa6)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:54:06 +00:00
Paul Derscheid 43d06148d7
Bug 40857: add context parameter for modal overlay
- The combobox dropdown in modals scrolled with the modal body instead of overlaying, due to Bootstrap's overflow: hidden on
modals clipping extending content.
- Added context parameter to combobox config; setting context: 'modal' uses Popper's fixed positioning strategy for proper
overlay.
- For reference: https://popper.js.org/docs/v2/constructors/#strategy

To test:
1. Make an item bookable
   1.1. Go to a record (e.g. http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=285)
   1.2. Go to the Items tab on the left side of the screen
   1.3. Under Bookable, choose Yes and click 'Update'

2. Place a booking
   2.1. Click 'Place booking' at the top of the detailed record screen
   2.2. Fill out the form
   2.3. Click 'Submit'

3. Try to cancel the booking
   3.1. Go to the 'Bookings' tab on the left side of the screen
   3.2. Click 'Cancel' next to the booking
   --> A modal appears with a text field for the cancellation reason
   3.3. Click 'No, do not cancel'

4. Add one authorised value in BOOKING_CANCELLATION
   4.1. Go to Administration > Authorized values
   4.2. Search for BOOKING_CANCELLATION
   4.3. Click 'Add'
   4.4. Fill out the form
   4.5. Click 'Save'

5. Redo step 3
   --> The option appears as a dropdown below the text field -- OK

6. Add one or two more authorised values

7. Redo step 3
   --> The options appear as a dropdown below the text field -- OK

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f6df86c170)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4b734ebaca)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:46:40 +00:00
Jonathan Druart 873aa29f66
Bug 40265: (try to) prevent OAI/Server.t to fail on slow server
Jenkins failed with:
21:50:07 koha_1       |     #    got : '2025-06-26T19:50:06Z'
21:50:07 koha_1       |     # expect : '2025-06-26T19:50:07Z'

A guess is that we change second between the 2 dt_from_string calls, and
the comparison fails.

One thing however: it seems that we want to deal with timezone correctly
here, but if we change the timezone in koha-conf.xml, the tests fail...

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Change looks good, but does not work for another timezone.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 73719c417f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a712b68635)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:40:38 +00:00
Jonathan Druart 128c28163b
Bug 37622: Remove location from 2 preservation 'update' routes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1a2a7e4619)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 428ea2baf6)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:38:37 +00:00
Jonathan Druart 1ef190535b
Bug 37622: Fix add_debit
We should not call discard_changes after accessing ->id but before

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9e8b9f607a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3c55573d4f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:38:33 +00:00
Jonathan Druart 9eaeb73980
Bug 37622: Adjust 'location' header test
We were ignoring whole files and parsing the whole file to check if
location and 201 were together. It's way better to check per subroutine.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a32495bf58)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4c331a9bc8)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:37:51 +00:00
Hammat Wele 2d12610ae3
Bug 37622: Error in erm module when editing an agreement, a license, a package or a titles
To reproduce

1- Enable the ERMModule system preference
    1- Go to Administration > System Preferences
    2- Search for ERMModule
    3- Change the value to "Enable"
    4- Click on "Save all e-resource management preferences"
    5- Return to the main screen
1- Create an agreement
    1- Go to e-resource management
    2- Click on "Agreements"
    3- Click on "New agreement"
    4- Fill out the form (mandatory fields)
        - Agreement name: Natural Medicines
        - Status: Active
    5- Click on "Submit"
2- Edit the agreement
    1- Click on "Agreements"
    2- Click on "Edit" to the right of the Natural Medicines agreement
    3- Click on "Submit"
        --> Something went wrong: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
We got the same error when editing a license, a package or a title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ddbd11cbad)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5d8ba2c368)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:35:54 +00:00
David Cook 17abd3d8d0
Bug 40473: Use better algorithm for calculating Code39 barcode length
This patch uses the PDF::Reuse::Barcode algorithm for calculating barcode
background box length relative to barcode length in order to determine
the actual barcode width and thus the X scale factor required to re-size
that barcode so that it fits on the label width (or rather the
"Barcode width" which is a percentage applied to the label width
to create a narrower usable surface for the barcode and barcode background
box).

To test:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=29
2. Add an item with barcode 123456, add an item with barcode 39999000001310399991,
    and ensure an item with barcode 39999000001310 already exists
3. Go to http://localhost:8081/cgi-bin/koha/labels/label-manage.pl?label_element=batch
4. Create a patch that uses 3 items using 39999000001310, 2 items with 123456,
    and 2 items with 39999000001310399991
4. Go to http://localhost:8081/cgi-bin/koha/labels/label-manage.pl?label_element=layout
5. Edit the layout "Label Test"
6. Change the "Barcode width" to 1, and enable "Draw guide boxes", and click "Save"
7. Export the batch using the template "Avery 5160 | 1 x 2-5/8" and the layout "Label Test" and open as PDF
8. Note that the whole barcode fits inside the red guidebox (there should be some
overlap of white on top of the red guidebox but that is normal since we're using 100% of the
barcode label width).
9. Edit the "Label Test" layout to try "Code39 + Modulo43" and "Code39 + Modulo10" and retry batch export
10. Edit the "Label Test" and try different "Barcode width" like the usual default .8
11. Celebrate that your barcodes fit on the label!

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9da5f23f96)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e06e3d8ec9)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:33:47 +00:00
Jonathan Druart d7c86fccd5
Bug 40565: Correctly fix the retrieval of 'id'
For other tables than those from Vue apps, table_node is the node and we
need to retrieve the object before accessing the attr function

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9af7d9dfd7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cfa17e1bc5)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:20:47 +00:00
Jonathan Druart 30d4555af4
Bug 40565: Fix column filters on item search
The item search table is different from the other tables.
It is using server-side but its own way (not using the REST API).

Test plan:
Search items and filter using the column filters: collections, library,
item types, AVs, etc.

QA: I am not very happy with this patch but, feel free to suggest a
better fix!
Note that "results" was too generic and it felt better to adjust it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 825172c9f2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 01d94090c7)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:20:45 +00:00
Jonathan Druart 319ca68044
Bug 40876: Apply 'exact' to all attributes when column filtering
If you select an option in a column filter, the "exact" behaviour will
only apply to the first attribute mapped to this column

eg. on the patron search we have "Libraries" mapped to library.name and
library.library_id. If you select Centerville/CPL, the generated q
parameter will be {name: CPL, id: {like: "%CPL%"}}

This is caused by:
    if (value.match(/^\^(.*)\$$/)) {
        value = value.replace(/^\^/, "").replace(/\$$/, "");
On the second parameter we have lost the ^$ markers

Moving it out of the loop fixes the problem (and does not impact the
other behaviours: we search the same value for all the attributes

Test plan:
Create a library with code=CPLL and use if for a patron
Go to http://localhost:8081/cgi-bin/koha/members/members-home.pl
Click search
Select "Centerville" in the "Libraries" column filter
=> Without this patch you get the patrons from CPL and CPLL
=> With this patch applied only patrons from CPL are listed

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9e437a4089)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 66e8f837dd)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-31 14:18:26 +00:00
Fridolin Somers 69aadbad4b
Bug 40525: [24.11] Fix missing use raw
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-29 15:13:57 +01:00
Fridolin Somers 17f9b8a96c
Bug 40818: [24.11] Fix html_helpers.inc
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-29 15:13:56 +01:00
Baptiste Wojtkowski 7135f9b39c
Update release notes for 24.11.10 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-28 15:25:23 +00:00
Baptiste Wojtkowski 8d362c9cfa
Increment version for 24.11.10 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-28 15:25:22 +00:00
David Cook 054641d3c8
Bug 40818: Add missing html filter on html_helpers.inc
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-28 15:01:05 +00:00
Jonathan Druart d9682db2f5
Bug 40818: Replace raw with html filter for marc_lib
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-28 15:01:03 +00:00
Jonathan Druart 0d6b153d28
Bug 40818: Remove HTML from marc_lib
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-28 14:59:13 +00:00
David Cook 28788b5839
Bug 40525: [24.11] Update spreadsheet format to escape formulas
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-28 14:59:12 +00:00
Jonathan Druart 47fdda0603
Bug 39814: [24.11] Restore filtering to the serials search table
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-17 14:27:03 +00:00
Baptiste 89278ee497
Bug 39775: [24.11] Restore filters
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-10-17 14:26:42 +00:00
Lucas Gass 4c7967e137
Bug 40679: Fix display of cancellation reason dropdown
To test:
1. Have some holds
2. Go to reserve/request.pl?biblionumber=x for your biblionumber
3. Change at least one hold priority to 'del'
4. Notice the toolbar above the table with Update Hold, Cancel selected, Cancellation reason now looks wonky.
5. APPLY PATCH
6. Try again, the display of the toolbar should be better.

Signed-off-by: Eric Garcia <cubingguy714@gmail.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fd1adddb35)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cf828af0a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:23:21 +02:00
Jonathan Druart b965dd5d49
Bug 40861: Remove warning from serials/acqui-search-result.pl
Odd number of elements in anonymous hash at /kohadevbox/koha/serials/acqui-search-result.pl line 84.

it's coming from closedate that is empty, and output_pref that will
reach this return:
278     if ($str) {
279         local $@;
280         $dt = eval { dt_from_string($str) };
281         Koha::Exceptions::WrongParameter->throw("Invalid date '$str' passed to output_pref") if $@;
282     }
283
284     return if !defined $dt;    # NULL date

if str is undef, we don't enter if l.278 and return l.284
which will shift the elements of the hash (because of the list context)

We force the scalar and we are good.

There was no side-effect because closedate was the last of the list.

Note that total (and the 'count(*)' key) is not used in the template.

Test plan:
Create an order for a basket of the first vendor "My vendor" and hit
http://localhost:8081/cgi-bin/koha/serials/acqui-search-result.pl?supplier=d
Without this patch you get the warning
Odd number of elements in anonymous hash at /kohadevbox/koha/serials/acqui-search-result.pl line 84.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 71619f90e5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6ebf2b7e45)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:16:45 +02:00
Janusz Kaczmarek 4e2fe4241c
Bug 40618: The display of the field 255 (Cartographic Mathematical Data) is missing (both in intranet and OPAC)
For the maps, one of the key characteristics is the information about
the scale of the map (in MARC 21 - in the field 255:
https://www.loc.gov/marc/bibliographic/bd255.html). Currently, we do not
display it neither in intranet view, nor in OPAC.

Test plan:
==========
1. Modify any bibliograhic record inserting a 255 field with example
   content. (You may need to make the subfields visible in the editor by
   modifying the MARC framework).
2. Verify in Normal view (intranet) and in OPAC that you are unable to
   see the inserted data.
3. Apply the patch ; restart_all.
4. Verify in Normal view (intranet) and in OPAC that you are now able to
   see the cartographical data from 255 field.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Fixed some indentation
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e225b8b3b5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6b106ee8cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:13:31 +02:00
Owen Leonard e3e4f0ecb7
Bug 40614: Invalid markup in cookie consent modal
This patch corrects a minor markup error in the OPAC's cookie consent
modal, removing a "type" attribute from an <a> tag.

To test apply the patch and make sure you have the CookieConsent system
preference enabled.

- Go to the OPAC. You should see a cookie consent banner across the
  bottom of the page.
- Click "More information."
- Click "Cancel" in the modal window. The modal should close.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Noah Tremblay <noah.tremblay@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 86d79a48d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7d8b9337c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:12:27 +02:00
Jonathan Druart 6591dd5fee
Bug 40759: Correctly format dates in subscription brief history in OPAC
Test plan:
To test:
* Add a subscription and receive 1-3 issues
* Set the DateFormat system preference to format unlike yyyy-mm-dd
* Go to the OPAC
  * Verify dates show corectly on the subscriptions tab itself
* Click on more details
  * Verify dates how correctly in the full history
  * Verify the dates on the brief history show correctly.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 96cf2d9935)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5da371a3d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:09:59 +02:00
Alexander Blanchard 5982361496
Bug 38633: Prevent holidays from being ignored
If weekly repeatable holidays are set, Koha ignores these days when other holidays are set using the Holidays repeated yearly on a range option.

To test:
1) Navigate to Tools > Calendar
2) Click on a weekend date on the calendar to open the Add New Holiday option
3) Give your holiday a title and select Holiday repeated every same day of the week
4) Click on the calendar again and set a holiday from 20 December 2021 to 06 January 2022
5) Give your holiday a title
6) Select Holidays repeated yearly on a range and click save
7) Using the calendar, navigate forwards to December 2024 and note that there are days that should be highlighted in the holdiay period that are not highlighted
8) Apply Patch
9) Run the reset_all command
10) Repeat the steps above
11) Notice that now when you click forwards through the calendar, all of the dates for your holidays repeated yearly on a range are still selected

Signed-off-by: Marion Durand <marion.durand@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c36498fd1d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4ba00dc292)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:07:06 +02:00
Tomás Cohen Arazi 9958d5dd77
Bug 38967: (follow-up) Force 'op' parameter
This fixes a failing test:

To test:
1. Run:
   $ ktd --shell
  k$ prove xt/find-missing-op-in-forms.t
xt/find-missing-op-in-forms.t .. 2/3
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 071b6322c7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cd6c198b5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:02:16 +02:00
Lucas Gass ea1b016068
Bug 38967: Make exportItems use POST
To test:
1. Go to item search.
2. Enter parameters that retrieve more than 500 items.
3. From the item search results page, show All entries, then "Select visible rows."
4. Select either Export selected results to CSV or Barcode file.
5. A resulting error message of either "This site can't be reached. The connection was reset" or a 400 Bad request page with a URL with all the item numbers inserted appears.
6. APPLY PATCH
Try steps 1 - 4 again, this time it should export.

Signed-off-by: Eric Garcia <cubingguy714@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 8f1fff8b70)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a17f6cf5ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 12:02:05 +02:00
Martin Renvoize a0f4709180
Bug 40675: Add unit tests for SIP line ending normalization
This patch adds comprehensive unit tests for the add_field function
to verify that all types of line endings (Unix \n, Windows \r\n,
Mac \r, and mixed) are properly normalized to spaces to prevent
SIP message corruption.

Tests cover:
- Unix line endings (\n)
- Windows line endings (\r\n)
- Mac line endings (\r)
- Mixed line ending combinations
- Normal text without line endings
- Empty values

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b535f20596)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6260f6c40d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 11:52:21 +02:00
Bernard Scaife 10b6823ff7
Bug 40675: Fix SIP message corruption from embedded line endings
Patron messages containing carriage returns, line feeds, or CRLF
combinations can break SIP protocol communication since CR is used
as the SIP message terminator. This causes message parsing failures
and protocol errors in self-check systems.

The previous regex only handled single carriage returns (\r),
missing Windows CRLF (\r\n) and Unix LF (\n) sequences.

This patch normalizes all line ending variations to spaces to
prevent SIP message corruption while preserving message content.

Test plan:
1. Go to a patron record and click "Add message"
2. Select "Add message for OPAC..." from dropdown
3. In a text editor (e.g., Word), create a message with line breaks:
   "This is line one[Enter]This is line two[Enter]This is line three"
4. Copy and paste this multi-line text into the message box and save
5. Run the SIP emulator: misc/sip_cli_emulator.pl
6. Execute a patron information request for this patron
7. Before patch: Observe message breaks at line endings, corrupting
   the SIP response
8. Apply patch and restart SIP server
9. Repeat steps 5-6
10. After patch: Verify the message appears as single line with
    spaces replacing line breaks: "This is line one This is line two
    This is line three"
11. Test with different line ending types (Windows, Mac, Unix) to
    ensure all variations are handled correctly

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Adjusted the comment in Sip.pm
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit affa3e62fd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5709be47e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 11:51:51 +02:00
Owen Leonard ca27bd4547
Bug 40585: (follow-up) Display error if no records were found
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b9bf3609d1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5b92e3ba7f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 11:22:02 +02:00
Marcel de Rooy 13badabaf8
Bug 40585: Check on Biblios->find in addbybiblionumber scripts
Just jumping to the next biblionumber (and adding found biblio recs) is
more user friendly than crashing without any further clarification to
the user.
Note that this should be a rare exception when the URL is not manipulated
(someone deleting a biblio while another wants to add it to a list).
For another bug: The template is not designed to handle the situation that
no biblio is found at all.

Test plan:
Select a biblio to add to a list and add a not-existent biblionumber
to the URL.
Without this patch, that URL will crash. With this patch, it will
silently ignore a wrong biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 60b1cf95c4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8198f36473)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 11:17:08 +02:00
Chloe Zermatten 38538d2230
Bug 40807: fix: username field in quick add form
The username field would not appear in the quick add form despite being marked as required in BorrowerMandatoryField.
This was due the interaction between a change introduced by Bug 38459 and the dummy input for the username field.

This patch moves the dummy input so that the true input is the last child that the change in Bug 38459 targets.
This allows the username field to appear when added to BorrowerMandatoryField.

Test plan:
0. (Before applying the patch, follow the replication tests as in the comment above.)
1. Login to the Koha staff interface
2. Search system preferences for BorrowerMandatoryField
3. Toggle on Username (userid) so it is added to the list of fields and save your changes.
4. Navigate to /cgi-bin/koha/members/memberentry.pl?op=add_form&categorycode=PT, notice that username still shows and is marked as required
5. Navigate to /cgi-bin/koha/members/memberentry.pl?op=add_form&categorycode=PT&quickadd=true, notice that the username field does show.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6b92afd73f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e1fe71f372)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 11:09:10 +02:00
Andrew Fuerste Henry 1b9f388e09
Bug 40839: Add Keyword to advanced z39.50 search in advanced catalog editor
To test:
1 - apply patch
2 - go to advanced cataloging editor
3 - perform a keyword z39.50 search from the quick search, note results
4 - click Advanced and see Keyword is also a search option here
5 - repeat your search, confirm results match those frmo step 3

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dcbf3b51b1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6c8fb24ef1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 10:34:47 +02:00
Nick Clemens a3eefbe567
Bug 31460: Merge item groups when merging records
Test:
1. Have a record (A) with 3 items.
2. Create an item group with 2 of these items.
3. Have a second record (B) with 4 items
4. Create an item group with 2 of these items.
5. Merge the two records together keeping record A
6. Results will show that all items are moved over to record A, but the item group from record B, is not there.
7. Apply patch
8. Create a new record (C) with 3 items.
9. Create an item group with 2 of these items
10. Merge this into record A
11. The item groups are moved!

Signed-off-by: Miranda Nero <mnero@oslri.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f7897d7d81)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ba8d8ea3bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 10:31:20 +02:00
Tomás Cohen Arazi 2785927c60
Bug 40812: Move Theke sample plugin repo to GitHub
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 18ff4d4933)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9e2eafec0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 10:24:14 +02:00
Jake Deery 412b5bdc44
Bug 40782: Selections toolbar checkbox now adds tabindex -1
This patch now sets tabindex to -1 if a disabled class is applied to a
control, and removes it when the class evaporates. This improves
accessibility by making these disabled items non-focusable.

To test:
a)  make a search on the OPAC
b)  tab through the selections toolbar, notice how visually disabled
    items are focusable
APPLY PATCH
c)  repeat steps a-b, notice how the elements are no longer focusable
SIGN OFF

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

Bug 40782: (follow-up) Tidy results-list.js

Tidy converts single quotes to double quotes

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c6402b951)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fe12e361f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 09:41:39 +02:00
David Cook a9a8843fa5
Bug 40689: Fix "Damaged status" and "Lost status" on moredetail.pl
This change just repairs moredetail.tt to re-apply the fix from bug 16157
which seems to have only been partially applied back in 2016.

Test plan:
0. Apply the patch
1. Set the "Damaged status", "Withdrawn status", and "Lost status" for an item
2. Create a user that only has "catalogue" permission and log in as them
3. Go to /cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<biblionumber from item>
4. Note how "Withdrawn status", "Lost status", and "Damaged status" all appear now

Signed-off-by: Noah Tremblay <noah.tremblay@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9278eed6f2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e9b45d28a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 09:39:45 +02:00
David Cook 715768506c
Bug 40702: Add missing "Title" header in Inventory csv export
This patch adds a missing "Title" header in the Inventory csv export.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/tools/inventory.pl
2. Check the "Export to CSV file" checkbox and click "Submit"
3. In the export, note that the A1 cell now says "Title"

Signed-off-by: Noah Tremblay <noah.tremblay@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c5a9f270ba)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9bcc48d7e8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 08:11:17 +02:00
Jonathan Druart 2cff5b1f5a
Bug 40765: Fix EDI.t
I have no idea why this is fixing the test!

Without this patch they fail:

t/db_dependent/Koha/EDI.t .. 1/5
    #   Failed test '14 log lines recorded for passed invoice file'
    #   at t/db_dependent/Koha/EDI.t line 725.
    #          got: '12'
    #     expected: '14'

    #   Failed test 'Warn recorded for transferring items'
    #   at t/db_dependent/Koha/EDI.t line 728.
    #                   'Unmatched item at branch:WID'
    #     doesn't match '(?^u:transferring.*)'

    #   Failed test 'Warn recorded for transferring items'
    #   at t/db_dependent/Koha/EDI.t line 728.
    #                   ''
    #     doesn't match '(?^u:transferring.*)'

    #   Failed test 'Warn recorded for unmatched item'
    #   at t/db_dependent/Koha/EDI.t line 728.
    #                   ''
    #     doesn't match '(?^u:Unmatched item at branch:.*)'
    # Looks like you failed 4 tests of 32.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ec2fbf3a4d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 2ee0a54788)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 07:55:14 +02:00
Jonathan Druart 9bebbf1b49
Bug 40765: Prevent acquisition tests to fail if order.quantity = 0
When using TestBuilder to build an order the tests will fail when the object will be saved:

00:09:41 koha-1      |     # Looks like you planned 58 tests but ran 26.
00:09:41 koha-1      |
00:09:41 koha-1      | #   Failed test 'cancel() tests'
00:09:41 koha-1      | #   at t/db_dependent/Koha/Acquisition/Order.t line 1042.
00:09:41 koha-1      | Cannot insert order: Mandatory parameter quantity is missing at t/db_dependent/Koha/Acquisition/Order.t line 868.
00:09:41 koha-1      | # Looks like your test exited with 255 just after 14.
00:09:41 koha-1      | [22:03:54] t/db_dependent/Koha/Acquisition/Order.t

This happened on Koha_Main/3350

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 621b75ddf0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ba7b962235)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 07:55:14 +02:00
Pedro Amorim ae9c5b786d
Bug 39345: 24.11 SQUASH
The following tests must pass:

prove t/db_dependent/api/v1/erm_usa*
prove t/db_dependent/Koha/ERM/EUsage/*
prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t
prove t/db_dependent/api/v1/erm_custom_reports.t
prove xt/author/Text_CSV_Various.t

Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2025-10-16 07:47:17 +02:00
Pedro Amorim da9f26681f
Bug 40644: Add tests
If you apply this patch before the other one:

prove t/db_dependent/Koha/Biblio.t

Will fail. Apply both patches. The above now passes.

This highlighted something. Following the test plan I can't reproduce
this anymore. In order to reproduce, the check-outs need to happen
before the bookings, otherwise when the check-outs happen on an existing
booking it'll 'complete' or 'cancel' the booking thus not causing the
error.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1617927b99)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b3a9ed2262)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 07:38:42 +02:00
Pedro Amorim 774cbf2386
Bug 40644: Only count checkouts that have not yet been counted as bookings
Test plan:
1) Have a record with 8 items.
2) Place a booking on 6 of the items (6 bookings total) for a full month
   (e.g. August)
3) Check-out all 6 of those bookings
4) Attempt to place a new booking for one of the 2 free items for end of month, e.g. (Aug 26 -> Aug 28).
5) It will fail with error "Booking conflicts". This is because the code
   is adding 6 checkouts with 6 bookings = 12 which is higher than 8
bookable items.
6) With this patch, check-outs that refer to an existing booking are
   excluded, so the check becomes if 8 - 6 > 0 (which passes the check) rather than 8 - 12 > 0 (which fails the check)

Run existing tests:
prove t/db_dependent/Koha/Item.t
prove t/db_dependent/Koha/Biblio.t
prove t/db_dependent/Koha/Booking.t

Signed-off-by: Andrew Fuerste Henry <andrew@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 6a729b4442)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4530773512)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 07:38:03 +02:00
Lucas Gass 15f12c32c9
Bug 39820: Add cancellation reason and clean up cancellation request
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f2adf0ad82)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 54728d4f68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 07:35:46 +02:00
Martin Renvoize 2a68a220f7
Bug 39820: (QA follow-up) Unit tests
This patch adds unit tests.. but it also adds some FIXME and QUESTION
statements to those tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 888ec190ef)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit bb8da54478)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 07:35:45 +02:00
Lucas Gass 105e977fb7
Bug 39820: Cancel holds with cancellation requests via SIP
To test:
1. In circ rules set a Default waiting hold cancellation policy to allow hold cancellation requests.
2. Add a hold for a patron and create a hold cancellation request.
3. Check the item in via SIP, I used the SIP emulator:

kohadevbox/koha/misc/sip_cli_emulator.pl -a localhost -p 6001 -l MPL -su term1 -sp term1 -m checkin --patron 23529000035676 --item 39999000001310

4. The hold remains.
5. APPLY PATCH, restart_all
6. Try 2 - 4 again, the hold should be cancelled

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2246bfbb4a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 80253423db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-16 07:35:16 +02:00
Laura_Escamilla 977a778175
Bug 40747: Fixed placeholder text for publication details in the holds queue filter
To test:
1. Place an item on hold. Run the holds queue (perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl)
2. Go to Circulation > Holds queue and notice that the filter under Publication details says "Author" as the placeholder.
3. Apply the patch. Restart_all
4. Repeat step 2 or refresh the page. Notice that the placeholder text for Publication details now says "Publication details"
5. Sign off -- have a wonderful day! :D

Signed-off-by: Lawrence ORegan-Lloyd <hello@lawrenceol.dev>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 902ab4b009)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 648a3cd7d3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 16:43:32 +02:00
Nick Clemens e40b58e2b4
Bug 40331: (follow-up) Adjust t/db_dependent/Circulation/transfers.t
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e327039ba1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit db39dc1607)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 16:34:06 +02:00
Nick Clemens 65d9e92354
Bug 40331: Return existing transfer if requesting a new transfer that is identical
Currently request_transfer checks for the existence of a current transfer on the item, and a new one can either be
enqueued or replace this transfer. This patch adds a check to see if the requested transfer matches an existing transfer
on the item. In the case that it does we simply return that transfer rather than create a new transfer.

This has the effect of eliminating 'WrongTransfer' generation if an item is checked in twice at the same branch, which feels correct.

To test:
 1 - place a hold on an item that is currently at branch A, for pickup at branch B
 2 - check your item in at Branch A, click to confirm the hold and transfer (print slip if you want to)
 3 - sudo koha-mysql kohadev: SELECT * FROM branchtransfers -- See one transfer
 4 - check your item in at Branch A again, get a message that the item is supposed to go to Branch B. Don't click on the modal yet
 5 - repeat 3 -- See two transfers, one cancelled as WrongTransfer, one pending
 6 - Click 'Confirm and transfer' on the modal
 7 - repeat 3 -- See three tranfers - the two from before and a new active transfer
 8 - DELETE FROM branchtransfers
 9 - Apply patch, restart all
10 - repeat 3 - no transfers
11 - Check item in at branch A again and confirm
12 - repeat 3, one transfer
13 - Check item in, don't confirm the modal
14 - repeat 3, one transfer
15 - Confirm the modal
16 - repeat 3, one transfer
17 - Check the item in at branch C
18 - repeat 3, two transfers - one cancelled WrongTransfer, one active
19 - Confirm modal
20 - repeat 3, two transfers
21 - Check item in at branch B
22 - repeat 3, two transfers, one cancelled, one completed

Signed-off-by: Christine Lee <chlee@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit acdc512cea)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 93b5d837cf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 16:32:17 +02:00
Nick Clemens 4d239368a3
Bug 38906: Use SUBSTRING and LOCATE over REGEXP_REPLACE
To test:
1 - Check out an old version of Koha and set some columns settings for holdings tables, or:
    UPDATE columns_settings
    SET columnname = CONCAT("holdings_",columnname)
    WHERE module = 'catalogue' AND page='detail' AND tablename = "holdings_table";
    UPDATE columns_settings
    SET columnname = CONCAT("otherholdings_",columnname)
    WHERE module = 'catalogue' AND page = 'detail' AND tablename = "otherholdings_table";
2 - perl -e 'use C4::Installer; my $result = C4::Installer::run_db_rev("/kohadevbox/koha/installer/data/mysql/db_revs/240600064.pl"); warn Data::Dumper::Dumper($result)'
3 - SELECT columnname FROM columns_settings WHERE module="catalogue" AND page="detail" AND ( tablename="holdings_table" OR tablename="otherholdings_table");
4 - Confirm column names are correct
5 - repeat 2
6 - Confirm column names are not affected on subsequent runs (items_group does not become group)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c1f4e2712b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b71d4d3e94)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 16:29:29 +02:00
Thibaud Guillot 1f5553b0dd
Bug 40691: Add ccode label on inventory table
Test plan:

1) Perform an item inventory, be sure to have some items with problems
   :) like 'wrong place'
2) On table if item has 'wrong place' problem (maybe others cases ?) if
   it's linked to collection code just the AV code appears not the label
3) Apply this patch
4) Refresh page, normally that's okay now

Sponsored-by: BibLibre
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 25b9895c8d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a3abffea85)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:48:22 +02:00
Nick Clemens 67361ee2e4
Bug 39072: Only select exact matches when populating search terms
This patch simply reduces our matching pattern to ensure the string is an exact match, rather than partial

To test:
- Create LOC authorized values of ADULT with description "Adult" and ADULTG with description "Adult - Grab and Go"
- Find a record with items and set one item to shelving location "Adult"
- Find a second record with items and set one item to shelving location "Adult - Grab and Go"
- Create an Item Search for Shelving location and select 'Adult' only
- Search and get one result from the record selected above
- Click Copy shareable link and paste/go in new tab
- See that the results now include both records from above
- Click Edit search button and notice that the Shelving location 'Adult - Grab and Go'  was added to the selected criteria for the search
- Apply patch
- Repeat original search for 'Adult' location
- Click 'Copy shareable link'
- Open in new tab and confirm correct results
- Repeat with a search for 'Adult - Grab and Go' and confirm shareable link gets the correct results

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4d3ebcbe69)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6a7bf9a8d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:40:36 +02:00
Paul Derscheid bdba8d6156
Bug 40643: Prevent keypress buildup in circulation
We have reports of progressive slowdown on the circulation page during
long sessions. A likely cause might be a block in `circ/circulation.tt`
that attaches a new keypress handler to `#barcode` on every submit. Some
submits do not navigate (e.g. waiting holds modal, quick slip on empty
barcode), and pages restored from the bfcache keep previously attached
handlers. Over time, listeners accumulate and the UI becomes sluggish.

This patch installs a single, namespaced keypress handler at page load,
guarded by an in-flight flag toggled on submit. The handler shows the
“Barcode submitted” modal and prevents typing only while a submit is
in flight. The flag is reset on bfcache restores via `pageshow`. This
preserves existing UX while keeping the listener count constant.

Test plan:
1. Before applying the patch, open circ/circulation.pl for any patron.
2. In the browser console, run:
   (function () {
     const el = $('#barcode')[0];
     const dataFn = jQuery._data || jQuery.data;
     const ev = (dataFn && dataFn(el, 'events')) || {};
     return (ev.keypress || []).length;
   })()
   Note the keypress handler count.
3. Enter a barcode and submit. Use the browser Back button to return.
4. Re-run the IIFE from step 2. The count has increased.
5. Repeat steps 3–4 a few times and observe the count continues to grow.
6. Apply the patch.
7. Reload the page and re-run step 2; count should be ~1.
8. Enter a barcode and submit. Use Back to return. Re-run step 2.
   The count remains ~1 across submits and back/forward navigations.
9. Confirm UX is preserved:
   - While submit is in flight, pressing keys in `#barcode` shows the
     “Barcode submitted” modal and prevents typing.
   - Waiting holds flow still shows its modal and behaves as before.
   - Submitting with an empty barcode still triggers the quick slip
     behavior per system preference and does not add handlers.
10. Optional: Simulate scanner behavior by pressing Enter rapidly after
    submit. Verify the handler count remains stable.

Signed-off-by: krimsonkharne <philip.orr@posteo.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b3c1261777)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 11c0675696)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:22:31 +02:00
Laura_Escamilla 7a1abb4480
Bug 40609: Improve button visibility in Identity providers
To test:
1. Go to Administration > Additional Parameters > Identity providers
2. Click on +New identity provider
3. Notice that the "Add default OAuth configuration" and "Add default
   OAuth mapping" buttons are not too visible. They just look like text
   unless they are hovered on.
4. Apply the patch, restart all
5. Refresh the page and view the buttons again. The button visibility
   has improved.
6. Sign off and have a nice day!

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 e20b9c8359)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f72596c441)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:20:28 +02:00
David Cook cf3446fce2
Bug 40690: Fix if/else/end logic for checkout
This change fixes the Checkout status on moredetail.pl so that it
actually shows "Not checked out" when it's not checked out.

Test plan:
0. Apply the patch
1. Go to /cgi-bin/koha/catalogue/moredetail.pl?biblionumber=29 on a fresh KTD
2. Note that the "Checkout status" is "Not checked out"
3. Check out the item to someone
4. Go to /cgi-bin/koha/catalogue/moredetail.pl?biblionumber=29
5. Note that it says "Checked out to <person> Due back on <date>"
6. Renew the item
7. Go to /cgi-bin/koha/catalogue/moredetail.pl?biblionumber=29
8. Note that it says "Checked out to <person> Last renewed <date>, Due back on <date>"

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 59d43e8d48)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ad886b5869)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:18:46 +02:00
Baptiste Wojtkowski 8313da3aca
Bug 40515: Fix regexp for cud-mark_as_lost_and_notify
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 6cfac72f7e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit afb9c9c531)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:08:27 +02:00
Lucas Gass 6a76219c25
Bug 40678: Add hidden value to remember exemptfine selection
To test:
-Same test plan as with "Book drop mode" but for "Forgive overdue charges"

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 771815b88d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c0cb2e6b85)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:05:48 +02:00
Lucas Gass 15e87dbd5f
Bug 40678: Add hidden value to remember dropboxmode selection
To test:
1. Put an item in transfer to a different library than the logged in branch
2. Go to Circulation > Check in
3. Choose the "Book drop mode" option and check in a few items NOT from step 1.
4. See the "Book drop mode" choice is remembered after every selection.
5. Check in the item from step 1 to make a wrong transfer
6. The modal pops up for wrong transfer, click confirm
7. Now the choice of "Book drop mode" is forgotten.
8. APPLY PATCH
9. Try again, this time the "Book drop mode" selction should be retained

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 13b82826cb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6d4be440f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 15:04:59 +02:00
Lucas Gass 0aba14f867
Bug 40709: Use data-colname for adding filters
To test:
1. Set the 'item-level_itypes' system preference to 'Bibliographic record'
2. Go to any record that contains items and look at the holdings table.
3. Click 'Show filters'.
4. Notice that the Status column doesn't appear to have a filter.
5. APPLY PATCH
6. Try again, the Status filter should appear correctly. Make sure all other filters appear correct.
7. Set 'item-level_itypes' back to 'specific item'.
8. Make sure the filter still appears correctly. Make sure all other filters appear correct.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d5adba9101)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 58fb7cd002)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:50:50 +02:00
Caroline Cyr La Rose 1a66b6337c
Bug 40071: MARC21 Addition to relator terms in technical notice 2025-06-04
This patch adds a relator term that was added to the MARC code list for
relators in the June 4, 2025 technical notice. The new term is waw -
Writer of afterword.

To test:
1. Apply patch and reset_all
2. Go to Administration > Authorized values
3. Search for the RELTERMS list and click on it
4. Search for waw
   --> There should be an entry for waw - Writer of afterword

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 17acb0c157)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8e6e70cd35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:46:15 +02:00
Caroline Cyr La Rose e33d2784d0
Bug 40072: MARC21 Addition to relator terms in technical notice 2025-04-03
This patch adds a relator term that was added to the MARC code list for
relators in the April 3, 2025 technical notice. The new term is wfw -
Writer of foreword. This technical notice also deprecates an existing
term, aui (author of introduction), in favour of the new term.

To test:
1. Apply patch and reset_all
2. Go to Administration > Authorized values
3. Search for the RELTERMS list and click on it
4. Search for wfw
   --> There should be an entry for wfw - Writer of foreword
5. Search for aui
   --> Term should not exist

Note : This update includes a term deprecation. I decided to go ahead
and remove it from the authorized values list because, unlike for MARC
frameworks, a nonexistent value will not delete data from the records.
It will simply say "aui (Not an authorized value)". Furthermore, this
only affects new installations. Nothing will be deleted from existing
installations, unless the libraries themselves remove the authorized
value. They can make a batch modification before deleting it if
necessary.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 38a5b8190d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4e0697968c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:45:32 +02:00
Caroline Cyr La Rose 37dac0d38b
Bug 40073: MARC21 Addition to relator terms in technical notice 2025-02-06
This patch adds new relator terms that were added to the MARC code list
for relators in the Februrary 2, 2025 technical notice. The new terms
are ink - Inker, and pnc - Penciller.

To test:
1. Apply patch and reset_all
2. Go to Administration > Authorized values
3. Search for the RELTERMS list and click on it
4. Search for ink
   --> There should be an entry for ink - Inker
5. Search for pnc
   --> There should be an entry for pnc - Penciller

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit add898d8a9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4eaea617ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:44:57 +02:00
Lucas Gass 8d896e2f5c
Bug 40725: Add TableExists check to db_revs/231200053.pl
This patch makes the DB revision idempotent.

To test:
1. Fix the Koha version right before the broken upgrade:
   $ ktd --shell
  k$ koha-mysql kohadev
   > UPDATE systempreferences SET value="23.1200052" WHERE
variable="version"; \q
2. Restart everything (memcached should be enough)
  k$ restart_all
3. Run:
  k$ updatedatabase
=> FAIL: You get:

```shell
Upgrade to 23.12.00.053  [19:34:35]: Bug 36755 - Increase length of 'code' column in borrower_attribute_types
	ERROR: C4::Installer::foreign_key_exists(): DBI Exception: DBD::mysql::db selectrow_array failed: Table 'koha_kohadev.pseudonymized_borrower_attributes' doesn't exist at /kohadevbox/koha/installer/data/mysql/db_revs/231200053.pl line 11
```

4. Apply this patch
5. Repeat 3
=> SUCCESS: Update runs smoothly!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4066d2a4fc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b394a6dec8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:37:15 +02:00
Jonathan Druart c2c5d5f791
Bug 40566: Display "Home library" on "Recalls history"
Test plan:
Go to http://localhost:8081/cgi-bin/koha/members/recallshistory.pl?borrowernumber=19
and confirm that with this patch applied you see the "Home library" of
the patron in the patron's info block (top left)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 8a576c2bf3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 61a08eb2e6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:21:20 +02:00
Nick Clemens 37bce14ff9
Bug 40651: Add a link to manage item search fields
When debugging this reported issue, I didn't know where to add these
fields, let's make it more obvious for users who can manage those

To test:
1 - Be a user who can manage item search fields
    i.e. have manage_item_search_fields permission
2 - Go to item search
3 - Note a link to Manage item search fields
4 - Confirm it works
5 - Be a user without the permission
6 - Go to item search
7 - There is no link!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e7b960e655)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f45b325307)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:18:13 +02:00
Nick Clemens 95ca056cdc
Bug 40651: Select custom search field if passed in via link
This patch checks for a custom field value and preselects it in the
dropdown if present

To test:
1 - Browse to Administration - Item search fields
2 - Add a new search field pointing to a marc field with some known
    value on a record with items
3 - Browse to Item search
4 - Construct a search using your new field and search
5 - From results click 'Copy shareable link'
6 - Go to the link
7 - No results or wrong results!
8 - Edit the search
9 - Note your custom field is not selected
10 - Apply patch
11 - Visit the link again
12 - Correct results!
13 - Edit search
14 - Custom field is correctly selected!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 14b485c6db)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 684cad615c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:17:13 +02:00
Tomas Cohen Arazi d26d32db83
Bug 40543: Remove pickup_library.branchname embed
This patch removes this wrongly added embed and adjusts the patron holds
history to use `pickup_location.name` instead.

To test:
1. Have a patron with some past holds from different branches
2. Browse their holds history
3. Search on the 'Library' column by name
=> SUCCESS: It works :-D
4. Apply the patch
5. Run:
   $ ktd --shell
  k$ yarn api:bundle
  k$ koha-plack --restart kohadev
6. Repeat 2-3
=> SUCCESS: Still works!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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 260a0af5db)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9488baf31f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 14:11:53 +02:00
Baptiste Wojtkowski 9d9d5073d6
Bug 38619: UNIMARC prices should also be extracted from 071d
When adding a document that does not use 010d as price document, but 071d, the price is not imported from koha since it only checks 010d and 345d.

To reproduce:
1 - Create a Koha item, make sure there is neither 010d or 345d
2 - Add a 071d and fill a price
3 - Export the item as marcxml
4 - If you do not have one: in acquisition, create a vendor, a basket associated to this vendor, and a line associated to this vendor
5 - Add a line to any open basket, select: import "from a new file" and
  select the exported marcxml -> The price in 071 is not imported
6 - Apply patch
7 - Repeat 5 -> the price is properly imported

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 1cb2f97e8c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 404280c868)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-10 13:44:18 +02:00
Owen Leonard 83b68d332a
Bug 39169: Automatically hide "active" and "budget period" columns on Acquisitions home page
This patch adds column configuration to the table settings for the
"Available funds" table on the Acquisitions home page. If a table has
column configration, hidden columns should be hidden in the
configuration rather than in the in-page table options.

To test, apply the patch and restart all services.

- Go to the Acquisitions home page
- In the "All available funds" section, you should not see "active" and
  "budget period" columns.
- NOTE: You may have to clear you browser's Local Storage in order for
  the change to show.
- If you go to Administration -> Table settings -> Acquisition ->
  acq_acqui-home you should see that the first two columns are hidden by
  default and cannot be toggled.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6df6337080)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-08 10:17:00 +02:00
Nick Clemens fa698d8026
Bug 39389: Don't stringify the system preference value
This bug is caused by the code that is intended to hide the export column when disabled failing
because the value of exports_enabled is "0" and not 0

To test:
1 - Checkout an item to a patron
2 - Disable ExportCircHistory
3 - Load the patron's circulation table on the Check Out tab
4 - Notice no export column
5 - Click 'Export' above the table and you can export
6 - Go to the patron's circulation table on the Details tab
7 - The export column shows
8 - Try to export - JS error
9 - Apply patch
10 - Clear local storage in the browser
11 - Repeat 3-6 - no more export column and you can export
12 - Enable ExportCircHistory
13 - Confirm the circ table on both pages hsows the export column and can be exported
     (You may need to clear local storage again)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Janne <janne.seppanen@lahti.fi>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4800537201)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-08 10:00:13 +02:00
Fridolin Somers c5b4736a80
Revert "Bug 39842: Populate current location for SIP item with holdingbranch"
This reverts commit eae8858d51.
2025-10-07 13:37:38 +02:00
Nick Clemens b9eba44a52
Bug 39421: Restore missing date picker on Circulation > Renew
This patch restores the renewal date input field (with a date
picker) for Circulation > Renew. This was missing.

It changes the behavor slightly so that it mirrors Circulation >
Check in. A settings icon is included in the barcode field,
clicking this then shows the date field with the date picker
(and any other options).

Previously on the renewals page (24.05.x and earlier), there was
no settings icon in the barcode field and the date input field
with date picker was already shown.

This user interface pattern is used elsewhere in Koha, and this
chnage will help improve consistency.

Test plan:
1. Browse to Circulation > Check in.
2. Note the settings icon in the barcode form field.
3. Click it to show the the return date field with a date picker,
   and other options.
4. Browse to Circulation > Renew.
5. Note there is no settings icon.
6. Apply the patch.
7. Repeat step 4 - note that there is now a settings icon.
8. Click the settings icon to show the renewal date form field.
9. Click the input field to show teh date picker.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

PA amended: Squashed both patches for 24.11
2025-10-06 18:04:13 +02:00
Imani Thomas f8ba476990
Bug 39029: When a basket contains an order transferred from another basket some info is incorrect.
To test:
1 - Create a new basket - 'Gonna transfer'
2 - Add an order to the basket
3 - Create another basket 'Has the transfer'
4 - Return to first basket and transfer order to second
5 - Return to second basket, click 'Add to basket' and inspect the modal
6 - Note basketno says 'Gonna transfer'
7 - apply the patch
8 - redo steps 1 through 6 with fresh baskets and the modal should have the correct values

Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:59:05 +02:00
Alexander Blanchard 95bbddfda2
Bug 33012: Accessibility - Fix OPAC navigation when using the tab key
An accessibility audit highlighted that when logged in you cannot tab
to the log out link in the welcome menu. The search history link in
the same menu was also unable to be tabbed to. These links were also
not able to be reached using arrows.

The links for Your Lists, Private Lists and New List could be reached
using the arrows on the keyboard but not via the tab option.

Test plan:
1) Navigate to the Koha OPAC.
2) Ensure you are logged in.
3) Use tabs to navigate the site.
4) When you reach the Welcome menu press enter.
5) Note that you can tab to 'Your Account' and the 'Clear' icon but not
   to 'Search History' or to 'Log Out'
6) Tab also to the hamburger menu and press enter
7) Note than you can navigate this menu via the arrows on the keyboard but
   not via the tab button
8) Apply patch
9) Repeat steps 1-7
10) Note that you can now tab to all of the above links

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a83c07da19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:46:25 +02:00
Lucas Gass 9b1310d3f0
Bug 39604: Remember cancelreserve choice when remembering patron for session
To test:
1. Put a few items on hold and make note of the barcodes.
2. Check out one of the items to a patron who doesn't have the hold
3. Check the cancel hold radio button
4. Also check the Remember for the session for this patron
5. Click 'Yes, check out'
6. Notice the item is checked out and the hold is cancelled
7. No checkout another on hold item to the same patron
8. No confirm screen ( good )
9. The item is checked out ( good )
10. The hold is not cancelled. ( bad )
11. APPLY PATCH and restart all
12. Try steps 1 - 9 again. This time the 2nd hold should be cancelled.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6b80dec84d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:41:06 +02:00
David Cook 32cbbc4e61
Bug 39618: (QA follow-up) add prefix length to index key
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ba3feb54ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:37:22 +02:00
Katrin Fischer f51547cfa7
Bug 39618: DBRev 24.11.009.002
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8099e118ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:36:22 +02:00
Lucas Gass 1db6734bfd
Bug 39618: Add index to borrowers.preferred_name column
To test:
1. APPLY PATCH
2. updatedatabase

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9276f33d4b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:33:53 +02:00
Lucas Gass 9b1cf2cdb7
Bug 39484: Fix external sounds in self checkout module
To test:
1. Enable AudioAlerts
2. Set something up in the SCO to play a sound from an external source. ( I used #sco_main as my selector )
3. Go to SCO and try to trigger the sound, nothing plays.
4. APPLY PATCH
5. Try steps 2 and 3 again, this time you should hear the sound from an external source.

Signed-off-by: Andrew <andrew.auld@openfifth.co.uk>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9f16b085b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:29:01 +02:00
Emily Lamancusa 31ab21c214
Bug 39400: (QA follow-up) Adjust link text
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f3080cbe5b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:27:06 +02:00
Phil Ringnalda 429cec6f31
Bug 39400: "Jump to add item form" doesn't work while editing an existing item
The link at the top of the item editor page to "Jump to add item form"
tries to scrollIntoView the element with id="additema", but that element
only exists while you are adding a new item. While you are editing an
existing item, it is replaced by an element with id="edititem".
Whichever element you have at the moment is always just below the form
with id="f", so we can just scroll that into view instead.

Test plan:
 1. Without the patch, go to the details page for any bib record with at
    least one item, and click the Edit button on the row for an item in
    the holdings table.
 2. You should be scrolled down to the form for editing that item
 3. Scroll up to the top of the page, click the Jump to add item form
    link
 4. You will not be scrolled back down to the form
 5. Apply patch, shift+reload page
 6. Now the link should scroll you back down to the form
 7. Return to the biblio details page, click Edit - Manage items and
    verify that the Jump to add item form link still works when you are
    not editing an existing item
 8. Click the Add multiple copies of this item button and add 30 items
 9. Make sure that the link still scrolls the form into view both while
    you are editing an existing item, and while you are adding a new item

Sponsored-by: Chetco Community Public Library
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fcf705e2e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:26:04 +02:00
Jonathan Druart 5dfad59117
Bug 35885: Sort vendors by name by default
Signed-off-by: Magnus Enger <magnus@libriotech.no>
To reproduce:
- Set ERMModule = Enable
- In the Acquisitions module I added 4 vendors, with names
  X, A, C, Y, in that order
- Went to E-resource management > Agreements > New agreement
- In the "Vendor" dropdown, the vendors are listed in the
  order they were entered: X, A, C, Y

To test:
- Applied the patch + restart_all + run "yarn js:build" in the
  cloned Koha repo inside KTD
- Shift-reload the "New agreement" page
- Vendors are in alphabetical order

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f6fd36ab77)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:23:50 +02:00
Andrew Auld e6f5c4711d
Bug 39543: Error modal when trying to add two controlling licences to an agreement duplicates error message
If you try to add two licences with the status 'controlling' to an
agreement record, the error modal duplicates the error message
'Only one controlling license is allowed'.

Test Plan:
1) Enable ERMModule sys pref
2) Add an agreement record
3) Add two licence records
4) Edit the agreement record and associate both license records to the agreement
5) Try to set both licenses to status 'controlling'
6) Note error modal duplicates the error message 'Only one controlling license is allowed'
7) Apply the patch, run yarn js:build and then hard refresh the browser
8) Repeat steps 1 to 5 and enjoy the single error message!

Signed-off-by: Magnus Enger <magnus@libriotech.no>
I took the liberty of fixing up the commit message a bit.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f201ea5076)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:15:33 +02:00
Jonathan Druart f5ca9d88c6
Bug 39080: Adjust the fixed header after we added the column filters
If a column contains a dropdown list (for libraries for instance), the
width of the column will be modified, but DT's fixed header need to be
adjusted.

Test plan:
One example where this problem can be observed is the "holds to pull"
table: "Title" is followed by "Libraries".
Test without and with the patch, and confirm that the display/offset is fixed.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8e808e97b3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 17:11:05 +02:00
Baptiste Wojtkowski 53df24cb17
Bug 39317: Fix CSRF protection for letters
TEST PLAN:
1 - go to /cgi-bin/koha/tools/letter.pl
2 - click on New notice -> claim serial issue (or any other one)
3 - Fill required fields with random string
4 - Save -> if it breaks, go to
5 - Open a network panel (F12 -> network)
6 - Filter on letter.pl
7 - Fill another new notice -> the arguments of the form page have been
  passed in the address of the POST request.
8 - Apply patch
9 - Repeat the whole process and see it works now

Signed-off-by: Magnus Enger <magnus@libriotech.no>
I can't recreate the problem, but the change seems sensible enough
and does not seem to introduce a regression, I can still save a
new letter/notice.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 248013a2a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 16:39:16 +02:00
Martin Renvoize a7b23c744e
Bug 37546: Error message output improvements
As suggested by David, I've re-arranged the message output so we pass
'message' first, followed by the error reference inside brackets,
followed by "for SERVER" and finally "result No."

This follows the Z39.50 suggestions more closely whilst still including
our level of detail for Server + Result number.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d32a1b7063)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 16:24:58 +02:00
Martin Renvoize 4f48879e58
Bug 37546: Output error message from ZOOM in Z3950 errors
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 03afbb442c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 16:24:34 +02:00
Jonathan Druart c0e27917b6
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>
(cherry picked from commit 3c7ddb4070)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 16:22:59 +02:00
Jonathan Druart ac640e3813
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>
(cherry picked from commit b8709b9df0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 16:22:59 +02:00
Jonathan Druart e274de676d
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>
(cherry picked from commit 1406d3b7a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 16:20:54 +02:00
Lucas Gass 57f40adebc
Bug 39606: Add a cypress test
To test:
1. APPLY PATCH
2. cypress run --spec "t/cypress/integration/Tools/"
3. Tests should pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b0cfcea861)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-06 16:20:40 +02:00
Lucas Gass 8c387f9d5b
Bug 39212: Explicitly set the contentType to JSON
To test:
1. Make an item or item type 'Bookable'
2. Place a booking for that item
3. Go the 'Bookings' tab for that item.
4. Edit the booking
5. Submit the edit request and see at the top of the modal "Failure"
6. APPLY PATCH
7. Try editing bookings, now it should work.

Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7a125d7cc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:26:53 +02:00
Lucas Gass b9a826b4f4
Bug 38861: Use a render function to display pickup name or pickup ID
To test:
0. Have some bookings that are ready to collect.
1. Load the bookings to collect report.
2. Table does not load.
3. APPLY PATCH
4. Try again, table loads.
5. Make sure you can filter by 'Pickup library'

Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 139fff4b27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:25:48 +02:00
Andrew Fuerste Henry 9ec67bcba2
Bug 39576: Show preferred_name for hiddenborrowername
The last patron menu uses the value "hiddenborrowername." I've made that use preferred_name instead of firstname. When a patron's preferred_name is not manually set/edited, it automatically takes the value of firstname, so we don't need an IF in the template toolkit here.

To test:
1 - have a patron with a preferred_name and one without
2 - get both patrons in the Last Patron dropdown, confirm they both show firstname
3 - apply patch, restart services, clear cache, reload page
4 - get your patrons in Last Patron again, confirm now one shows preferred name and the other firstname

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 829186d77d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:21:23 +02:00
Hammat Wele 5748ef0ebc
Bug 33224: OPACHoldsIfAvailableAtPickup and no on-shelf holds don't mix well
When OPACHoldsIfAvailableAtPickup preference is set to Don't allow and circulation rules allow on-shelf holds only if any unavailable, and we have a record with a checked out copy at Centerville and an available copy at Midway, a Midway patron should not be able to place a hold for pickup at Midway since the Midway copy is available.

This is the setting:
- circulation rules allow on-shelf holds only if any unavailable
- OPACHoldsIfAvailableAtPickup is set to Don't allow

To test:
1. Set up the circulation rule so that on-shelf holds are allowed ('Yes')
2. Create a record with two items, one at Centerville and one at Midway
3. Check out the Centerville item
4. Log into the OPAC with a Midway patron (I used Henry Acevedo)
5. Try to place a hold on the record
   --> Midway is not a valid pickup location (correct behaviour)
6. Cancel
7. Change the circulation rules so that on-shelf holds are only allowed 'if any unavailable'
8. Try to place a hold on the record from the OPAC again
   --> The system allows you to place the hold for pickup at Midway (incorrect behaviour)
9. Optionally, check the Holds to pull for Midway (the hold is there, it shouldn't)
10. Optionnaly, check in the Midway item (it is trapped for Henry's hold)
11. Apply the patch
12. Try again to place a hold on the record from the OPAC
   --> it is impossible to select Midway, Midway is not a valid pickup location

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e303854076)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:17:15 +02:00
Jonathan Druart 99781912b6
Bug 39075: DBIC schema changes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a387c0c381)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:13:01 +02:00
Jonathan Druart a8a6e9afff
Bug 39075: Explicit NOT NULL for timestamp
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 01f842f4a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:12:44 +02:00
Katrin Fischer 8817cc6a21
Bug 39075: DBRev 24.11.09.001
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4278abd185)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:12:20 +02:00
Marcel de Rooy ddd0188cf5
Bug 39075: (QA follow-up) Use new bug number. refer to old
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0334dd9093)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:11:26 +02:00
Matt Blenkinsop d3e892fa7c
Bug 39075: Fix DB inconsistencies
This patch fixes DB inconsistencies introduced in bug 34587

Test plan:
1) Run 'updatedatabase'
2) There should be no errors
3) Check the database and observe the correct assignment of the following columns
- erm_counter_logs.importdate
- erm_counter_files.date_uploaded

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] chmod 755 on new dbrev
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 50ef9576d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:11:17 +02:00
Brendan Lawlor 9f081a212d
Bug 39569: Fix branch name in alert when cancelling holds over x
To test:
1. On a bib with one item place a hold for pickup at library A and Library B
2. Check the item into library A
3. Set the first hold's expiration date to the past
4. On Holds awaiting pickup > Holds waiting past their expiration date
   In the actions column click the 'Cancel hold' button
5. Notice the alert says 'This item is on hold for pick-up at'
   with no library name
6. Apply patch and redo steps 1-4
7. Confirm the alert include's Library B's name
   This item is on hold for pick-up at Library B

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c095e09ff9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:09:11 +02:00
Jonathan Druart 6fb39317e7
Bug 39995: Prevent Koha/Biblio.t to fail on slow servers
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 82bd6aac35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 16:06:05 +02:00
Baptiste b6472510cc
Bug 38841: Check non-patron guarantor while deleting patron guarantor
When editing a child while Childneedsquarantor active, trying to delete
a guarantor while saving a non-patron guarantor will prevent the user
from saving. However, if an adult has expired, some librarian would like
to remove the account and let some information in non-patron guarantor.

TEST PLAN

Before applying patch
1 - Open Lisa Charles'page, add Henry Acevedo as Guarantor, also fill
  Guarantor surname and firstname
2 - Edit the page and try and remove Henry Acevedo, it won't work
  however there is still one guarantor

3 - Apply patch
4 - Try and remove Henry Acevedo -> it will work
5 - add HA as a guarantor again
6 - try and remove him AND let guarantor firstname and surname empty ->
  you can't
7 - Add HA and Edna Acosta as guarantor
8 - Remove HA and ler guarantor firstname and surname empty -> you can

Signed-off-by: Thibault Keromnes <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e0be89266d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:53:43 +02:00
Jonathan Druart 0ca30deab0
Bug 39020: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5127534f5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:52:32 +02:00
Lisette Scheer 6b75fe9034
Bug 39020: Search filters can't parse query
1. Turn on the SavedSearchFilters system preference
2. Go to advanced search, select a number of item types and search
3. Save the search
4. Enter a search term (such as power)
5. select the filter. Observe the following message:
Error: Unable to understand your search query, please rephrase and try again.
6. Apply patch
7. Repeat steps 4 & 5, search should work as expected.
8. Sign off!

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d6c2124b29)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:51:56 +02:00
Janusz Kaczmarek f3267b81ee
Bug 38925: Update record 'date entered on file' when duplicating a record -- in advanced editor (MARC21)
With Bug 36552 we set 'date entered on file' (MARC21: 008/0-5)
of a record created by duplication of an existing record to the current
date instead of having there the value from the original record.

The same should be done for the advanced editor (for now, it retains
the date of the original record).

Test plan:
==========
1. Enable EnableAdvancedCatalogingEditor systempreference.
2. Open any record in advanced editor to make it default. Go back to
   record normal display.
3. Make a duplicate: Edit > Edit as new (duplicate)
4. Note that the date in 008/0-5 is of the original record, not of
   today.
5. Apply the patch ; restart_all.
6. Repeat p. 3. The date in 008/0-5 should be of the today. If not,
   refresh browser's cache (Ctrl+Shift+R etc.) to get the fresh
   version of the JS.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c0b3310ab8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:49:57 +02:00
Emily Lamancusa 23c76b43e7
Bug 39904: (QA follow-up) Fix a few other cases
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0868f260c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:45:34 +02:00
Kyle M Hall 52eda9ba69
Bug 39904: EDIFACT error messages are malformed
Perl can interpolate hashrefs but not method calls. This results in messages like "Cannot connect to Koha::Schema::Result::VendorEdiAccount=HASH(0xaaab059252f0)->host: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58." when running the edi_cron.pl cronjob.

Test Plan:
1) Enable EDIFACT
2) Create a fake EDI account with a bad FTP server in it
3) Run edi_cron.pl
4) Note the errors like:
    Cannot connect to Koha::Schema::Result::VendorEdiAccount=HASH(0xaaab059252f0)->host: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58.
5) Apply this patch
6) Run edi_cron.pl
7) Note the errors are now like:
    Cannot connect to test.example.com: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 26e7c07302)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:40:44 +02:00
Hammat Wele 5da9ec9b27
Bug 39800: Error 500 when trying to delete patron card template
Test plan:

1. Go to Tools > Patron card creator
2. Click Manage > Card templates
3. Click Delete next to the HB-PC0001 template
--> Error 500
4. Go back to Tools > Patron card creator
5. Click Manage > Printer profiles
6. Click Delete next to the '16' printer profile
--> Error 500
7. Apply the patch
8. Repeat step 1, 2, 3
--> Card template is deleted
9. Repeat step 4, 5, 6
--> Printer profilesis deleted

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0bfad63507)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:36:48 +02:00
Owen Leonard 0973bf2537
Bug 39354: (follow-up) Override additional BS5 CSS for multiple-select
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6c95ae68be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:35:51 +02:00
Owen Leonard 4f9cf0d8c2
Bug 39354: Remove unintended Bootstrap 5 change to scroll-behavior
This patch updates the "variables" SCSS file in the OPAC and staff
interface in order to disable the "smooth scroll" behavior introduced in
Bootstrap 5. This was an unexpected and unintentional change.

The patch also corrects another unexpected side-effect of the BS5
upgrade: A change to the "cursor" property of elements with a
".placeholder" class. This class is used by the multiple-select jQuery
plugin found in some system preference controls.

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

- Clear your browser cache if necessary.
- In the staff interface, go to Administration -> System preferences ->
  Circulation, and click "Patron restrictions" in the left-hand sidebar.
  The page should jump immediately to that section without any scrolling
  effect.
- Go to the "Article requests" section of that page. Hover your cursor
  over a dropdown which doesn't have any option selected. Your cursor
  should not change to a "waiting" cursor.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 09c79110a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:35:19 +02:00
Nick Clemens eae8858d51
Bug 39842: Populate current location for SIP item with holdingbranch
This patch simply adds the holdingbranch to the SIP item as current_location

To test:
1 - Find an item and check it in at a different location than its homebranch
2 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR -m item_information --item 39999000004151
3 - Note no AP field is returned
4 - Apply patch, restart all
5 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR -m item_information --item 39999000004151
6 - You see the current holdingbranch in the AP field
7 - Return the item to its homebranch
8 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR -m item_information --item 39999000004151
9 - Confirm home and holding branches are the same now

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0049543314)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:30:23 +02:00
Fridolin Somers d1eae2cec9
Bug 39733: Remove system preference delimiter mention in misc/cronjobs/staticfines.pl
Bug 27486 renamed system preference "delimiter" into "CSVDelimiter"

This patch just replaces the commented code with a TODO text

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 269ad710b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:14:13 +02:00
Michael Skarupianski 922d644b0a
Bug 39528: Remove schema.org "Product" type from OPAC record pages
OPAC record detail pages include https://schema.org microdata information
in the HTML page markup, such as CreativeWork.

It incorrectly includes the "Product" type - this is not needed
and is also rejected by some search engines, for example
... vocab="http://schema.org/" typeof="CreativeWork Product" ...

(Koha maps schema.org to the RDFa Lite syntax https://www.w3.org/TR/rdfa-lite/)

Test plan:
1. Look at HTML source of a details page for a record in the OPAC.
2. Search for schema.org
3. Note that it there are two typeof entries:
   .. vocab="http://schema.org/" typeof="CreativeWork Product" ...
4. Apply the patch.
5. Refresh the page and look at the HTML source again.
6. Note that the "Product" schema.org type is removed:
   .. vocab="http://schema.org/" typeof="CreativeWork" ...
7. Sign off.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4adc1a065f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:10:58 +02:00
Nick Clemens 37d3df99ca
Bug 39561: Allow users with fast_cataloging to continue after duplicate is found
This patch adds the fast_cataloging permission to those checked when a duplicate is found

Additionally, the barcode was missing from the duplicate check and is now added to be passed forward

To test:
 1 - Create or choose a borrower and grant permissions:
     catalogue
     circulate
     borrowers: list_borrowers
     editcatalogue: fast_cataloguing
 2 - Log in as that patron
 3 - Search for another borrower and go to checkout screen
 4 - Enter random string as barcode to checkout
 5 - Item is not found, click to fast catalogue
 6 - In the editor type into 245$a 'Perl best practices' - or another title that exists in your system
 7 - Get a notice of duplicate with options:
     Yes: View existing items
     No, save as new record
 8 - Clicking 'Yes' will take you to the record details page - you cannot add an item because record is not FA framework
 9 - You can click 'back' to return to the messages
10 - Clicking 'No' will create a new record and take you to the details page - you can add an item (Edit->manage items)
     but barcode has been dropped
11 - Apply patch
12 - Repeate 3-6
13 - You now get options:
     Yes: View existing items (you cannot add items to an existing record)
     No, save as new record
14 - 'Yes' will take you to details view
15 - Click back
16 - 'No' will take you to the edit items screen and populate the barcode
17 - Saving the item should return you to patron and issue item
18 - Repeat again with a staff patron with full permissions and confirm saying 'Yes' completes the fast catalogin workflow as expected

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6812b170a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 15:08:49 +02:00
Fridolin Somers 147d89d8bf
Bug 39737: Obsolete call on system preference 'PatronSelfRegistrationAdditionalInstructions'
Bug 34889 moved to additional contents.
Remove call in opac pages.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cef1685925)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:58:52 +02:00
Fridolin Somers d6132642f6
Bug 39736: Remove obsolete call on system preference 'OPACResultsSidebar'
Bug 34869 moved additional contents.
Remove call in opac/opac-search.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a210683610)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:57:01 +02:00
Martin Renvoize 2c80caac7d
Bug 39696: (follow-up) Set text-bg-info on badge
We also use a badge without a text-bg-# class on the modal claims
include.. this patch adds the same text-bg-info to that.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 79e872915f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:54:02 +02:00
Martin Renvoize ad5d362fc4
Bug 39696: Set text-bg-info on badge
With bootstrap 5, a 'badge' class should always be accompanied by a
text-bg-# class. This second class sets the badge color and an
appropriate forground text color to ensure appropriate contrast.

Steps to test:
1. Enable the ability to mark items as "Claimed Returned" by setting
   the ClaimReturnedLostValue system preference.
2. Check out an item to a patron, and backdate the due date so that it
   becomes overdue.
3. Navigate to: /cgi-bin/koha/circ/overdue.pl to view the overdue item.
4. Mark the item as "Claims Returned".
5. Observe the display: the claim return date text uses #fff (white),
   which is not visible on white table rows and has poor contrast on
   grey rows.
6. Apply the patch
7. Clear cache in browser and observe the display: the claim return date
   badge is now blue with black text.
8. Sign off and have an amazing day! :D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2f4f34de0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:53:27 +02:00
Nick Clemens ae937750a9
Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat
When building queries for matchign Zebra uses OR to combine searches - Elasticsearch
has been effectively using 'AND' - this patch checks whether and_or has been passed
and follows the variable when present.

To test:
1 - Have an import file of auths with multiple 035
2 - Setup an authority matching rule
    Search index: other-control-number
    Score: 1000
    Tag: 035
    Subfields: a
3 - Make sure Koha is using Elasticsearch
4 - Stage file without matching, import file
5 - Stage file again, using your matching rule
6 - Note all records match
7 - Setup Cataloging->Marc modification template
8 - Add an action to delete first 035 field
9 - Run it against the records you just imported
    You can use a report:
    SELECT authid FROM auth_header WHERE authid > #### (find the lowest new record number in batch you imported)
10 - Change matching rule in batch to none, then back to your rule
11 - No matches!
12 - Apply patch, restart all
13 - Set matchign rule to none, then back to your rule
14 - Matches!

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised!
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-10-03 14:35:53 +02:00
Lucas Gass 5044496b38
Bug 39861: Delegate click function to the table
To test:
1 - Add a new Z3950 server with basic information filled out, it doesn't need to be valid
2 - Add a second copy via the DB:
    INSERT INTO z3950servers SELECT null,host,port,db,userid,password,servername,checked,rank,syntax,timeout,servertype,encoding,recordtype,sru_options,sru_fields,add_xslt,attributes FROM z3950servers WHERE id=6;
3 - Delete the copy, assuming it is on page one, it works
4 - Spam the DB with the SQL above and create 20+ entries
5 - Open the Z3950 admin page
6 - Go to second page of servers
7 - Attempt to delete any entry
8 - Nothing happens
9 - APPLY PATCH
10 - Try deleting again, it should now work.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a009011d5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:27:14 +02:00
Slava Shishkin 652126118f
Bug 39787: Fix missing sender EAN when only one EAN is defined
If only one EAN is defined for the library, the Create EDIFACT order
button template used the eans.0 object instead of its ean field.
As a result, the data-ean attribute contained an object, not the EAN
string. Fixed by explicitly accessing the field: eans.0.ean.

Steps to reproduce:
1. Ensure only one Library EAN is configured in
   /cgi-bin/koha/admin/edi_ean_accounts.pl.
2. Create a new basket.
3. Inspect the HTML of the Create EDIFACT order button.
4. The data-ean attribute will show an object instead
   of EAN string — e.g. Koha::Schema::Result... (this is the bug).
5. Apply the patch and reload the basket page.
6. Inspect the HTML again — data-ean should now show
   the EAN string (fixed).
7. Click the button, confirm basket closure, then go to EDIFACT messages
(/cgi-bin/koha/acqui/edifactmsgs.pl) and verify the message was created.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:24:47 +02:00
Jonathan Druart ecb96b76d0
Bug 39930: Prevent DT's state to be lost overnight
The default value for stateDuration is 7200 (2h). Which means DataTables
will ignore the saved state if reused after this delay.

Additionally is causes problem on some tables where the default state is
not restored and all columns are displayed.

From https://datatables.net/reference/option/stateDuration
```
Please note that the value is given in seconds. The value 0 is a special value as it indicates that the state can be stored and retrieved indefinitely with no time limit.
```

We are going to set it to 0 so that the state is only lost/reset after a
logout

Test plan:
Ideally you can should edit this file and set saveState to 60 (seconds),
so it's easy to test.
Do not apply this patch and confirm that the state is not restored after
either 60s or 2h (if you modified the file or not).
It is a problem on the checkout list table as extra columns (like
"Today's checkouts") are displayed.

With this patch applied the state should be restored correctly.
If you logout the state will be lost however.

Ideally we might want to store user's preferences on the server.

Signed-off-by: Ludovic Julien <ludovic.julien@inLibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ad11a32584)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c2a7a1906c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 08:22:25 +02:00
Tomas Cohen Arazi aef73ebc5d
Bug 39784: Remove stray 'xxx' string in migrate.inc
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a8afc9f8d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 12:03:44 +02:00
Tomas Cohen Arazi 7df6e4d9f7
Bug 39771: Make `data` attribute nullable for jobs
This patch makes the `data` attribute nullable. This happens when
`$job->finish()` is called with no parameters.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/jobs.t
=> FAIL: Tests don't pass, a 500 is returned when `finish()` was called
with no data
3. Apply this patch
4. Rebuild the API spec:
  k$ yarn api:bundle
5. Repeat 2
=> SUCCESS: Tests pass! The API doesn't explode
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b0f21ad50a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:59:15 +02:00
Tomas Cohen Arazi 2e4e7387f9
Bug 39771: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 01e3a6f600)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:59:05 +02:00
David Cook 4273af433f
Bug 39623: Remove "install" target's dependency on "all" target
This change removes the install target's dependency on "all". There
is no clear reason why "install" would need to depend on all other
build targets.

After you remove this dependency, running "make" and "make install"
work the way you'd expect them to work. "make" does the build and
"make install" does the install.

Test plan:
0. DO NOT APPLY THE PATCH YET!
1. Setup intall target
sudo mkdir /opt/koha
sudo chown kohadev-koha  /opt/koha
2. Clean build env
rm -rf blib Makefile /opt/koha/*
3. perl Makefile.PL
Installation mode (dev, single, standard) [standard] single
Please specify the directory in which to install Koha [/var/lib/koha/kohadev/koha] /opt/koha
NOTE: Otherwise accept all defaults
4. make
NOTE: build-resources.PL is run and the blib directory is populated
5. make install
NOTE: build-resources.PL is run and the blib directory is populated and the built
files are installed to /opt/koha

6. Apply the patch now
7. mv /opt/koha /opt/koha.bak
8. Re-setup install target
sudo mkdir /opt/koha
sudo chown kohadev-koha /opt/koha
9. Clean build env
rm -rf blib Makefile /opt/koha/*
10. perl Makefile.PL
Installation mode (dev, single, standard) [standard] single
Please specify the directory in which to install Koha [/var/lib/koha/kohadev/koha] /opt/koha
NOTE: Otherwise accept all defaults
11. make
NOTE: build-resources.PL is run and the blib directory is populated
12. make install
NOTE: Only the install step is run

13. diff -r /opt/koha /opt/koha.bak
14. Note that there are no differences between the two directories

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d06c27e75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:56:35 +02:00
Jonathan Druart a5a3c0b292
Bug 39826: UTF8-decode vendor interface's password on display
We store an encrypted version of the passwords for vendor's interfaces, but we don't utf8 decode it after it is decrypted

Test plan:
0. Do not apply this patch
1. Create or edit a vendor and add at least one interface with non ascii
   characters, eg. émyPassword❤
2. Go to the detail view of the vendor and click the "Show password"
   link
=> The password is not correctly utf8-decoded
3. Apply this patch, repeat 2
=> The password is correctly displayed
4. Repeat 1 and 2
=> The password is correctly displayed

Note that maybe we should make sure the encrypt_hex is getting a valid
utf8-encoded variable.

(cherry picked from commit 25a805e8e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:51:09 +02:00
Lucas Gass 19ad8d24b5
Bug 39582: Syndetics support for UPC and OCLC numbers on OPAC results page
To test:
1. Enable Syndetics
2. Have a record with an 024 and 1st indicator.
3. Do a search to return the record from step 3.
4. The image does not display.
5. APPLY PATCH
6. Try step 3 again, this time the cover image should display properly on the OPAC results page.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2d484d326b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:47:51 +02:00
Nick Clemens e2a3710b7d
Bug 39076: Use state variable to avoid creating extra ES connections
As elsewhere in the code, we should use a state variable for our
'bib_searcher' object to avoid overhead of extra ES connections.

Worth noting - we don't actually use the 'bib_searcher' at all during
record auto linking as we pass skipmetadata

To test:
0 - Apply patch
1 - Enable biblio auto linking
    AutoLinkBiblios, CatalogModuleRelink, LinkerRelink
2 - Stage and import a marc file
3 - Confirm record authorities link as expected
4 - Search authorities in the staff interface
5 - Confirm usage counts are shown for results

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e2207cb478)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:39:37 +02:00
Matt Blenkinsop d31f8d7279
Bug 39752: Check for biblio existence when matches are found
Currently when adding to a basket from a new/staged file, we don't check whether a matched record still exists when importing. This patch changes the conditional check to be based on the existence of the biblio record rather than just on the biblionumber from the match

Test plan:
1) Stage and import a record into Koha
2) Stage the same record again, this time matching on ISBN
3) Check that the match has been found in the batch details
4) Delete the original record that you imported in step 1
5) Find a basket, and add to it from a staged file
6) Choose the file/record you imported in stage 2
7) Select the record and save to add the orders
8) You will get a 500 error
9) Apply patch and restart_all
10) Refresh the page to re-submit the form
11) The form should submit correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37538b22a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:35:15 +02:00
Nick Clemens 2f45f272a2
Bug 39752: (QA follow-up) Unit test
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 08da4b33b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:35:15 +02:00
Nick Clemens 9aba7c0b4e
Bug 39070: Don't request facets when searching for recrod matches
This patch adds a new option to Elasticsearch to skip facets in build_query and
build_query_compat.

There should be no behavior change, however, queries to ES should be simpler

To test:
1 - Export some record from Koha
2 - Stage the records for import, matching on 999c
3 - Confirm expected matches
4 - Switch batch to use ISBN for matching
5 - Confirm expected matches
6 - Apply patches, restart all
7 - Switch batch to use 999c
8 - Confirm matches
9 - Switch batch to use ISBN
10 - Confirm matches

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d73e3399ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:31:25 +02:00
Fridolin Somers a63b204191
Bug 39747: Fix wrong system preference 'DefaultHoldExpirationUnitOfTime' in test suite
Correct preference is 'DefaultHoldExpirationdateUnitOfTime'.
Also no reason for ";".

Test by running : prove t/db_dependent/Reserves.t

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b79fb6aedf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:23:57 +02:00
Fridolin Somers 523eee0bf2
Bug 39746: Fix wrong system preference 'AutoLocation' in test suite
Bug 26176 renamed 'AutoLocation' to 'StaffLoginRestrictLibraryByIP'
Needs to be fixed in test suite

Test plan:
Enable 'StaffLoginRestrictLibraryByIP' in prefs
Run : prove Auth.t
Should pass

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ea6e31c39b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:21:34 +02:00
Fridolin Somers 8b0fef77af
Bug 39735: Fix typo in system preference call 'OPACFineNoRenewalsIncludeCredit'
Typo in system preference call 'OPACFineNoRenewalsIncludeCredit'
=> 'OPACFineNoRenewalsIncludeCredits'

Test plan :
Run : prove t/db_dependent/Circulation.t
Run test plan of Bug 23293

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0a32b7371f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:19:13 +02:00
Lucas Gass 2fa1204cc8
Bug 39603: Make sure authorised value category is ITEMTYPECAT
To test:
1. Add some AVs for ITEMTYPECAT and set some of your item types to be in that Search category. I made one called OTHER
2. Go to the OPAC advanced search page, the item types should be correctly displaying under ITEMTYPECAT with the correct description from ITEMTYPECAT.
3. Create a new AV called OTHER in a different category like 'ERM_AGREEMENT_CLOSURE_REASON'. Make the description something different like 'Wrong description'.
4. Now go back to the OPAC advanced search.
5. Notice your OTHER option now reads 'Wrong description'.
6. APPLY PATCH and restart_all
7. Try again, the OPAC descriptions should now be correct.

Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f79aec38b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:09:45 +02:00
Andrew Fuerste Henry 5fc9393cb6
Bug 39525: Label policy as 'Hold and booking pickup library match'
To test:
Apply patch, go to circ rules, confirm it says "Hold and booking library pickup match" under both "Defaul checkout, hold and return policy" and under "Default holds and bookings policies by item type" at both the all libraries and library-specific levels.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 66074093c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:08:12 +02:00
Tomas Cohen Arazi d0895bf487
Bug 39379: Only display Edit patron button if enough permissions
This patch adds a check for the current user permissions in order to
display the 'Edit' button on the patron search screen.

To test:
1. Have a patron with staff access and only `list_borrowers` permission
   (I picked Henry Acevedo, henry - Acevedo123)
2. Login as that user
3. Perform a patron search at http://kohadev-intra.localhost/cgi-bin/koha/members/members-home.pl
=> FAIL: There's an 'Edit' button
4. Click on the 'Edit' button
=> SUCCESS: You are told you don't have enough permissions
5. Apply this patch
6. Repeat 3
=> SUCCESS: The button is not displayed
7. Login with a superlibrarian user
8. Repeat 3
=> SUCCESS: You can see the button
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 989924e963)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:04:37 +02:00
Fridolin Somers c53631d969
Bug 39734: Remove obsolete call of system preference IntranetmainUserblock
Bug 35153 moved IntranetmainUserblock to additional contents.

Remove call in C4/Auth.pm

Test plan :
Check additional content "IntranetmainUserblock" is still OK ;)

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c74a67a8ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:02:01 +02:00
Jonathan Druart 6e614957e2
Bug 39833: Adjust character_set_client in kohastructure.sql
koha-dump now generates the dump with utf8mb4

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a41f52530a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:58:56 +02:00
Fridolin Somers e6d570ee11
Bug 39738: Obsolete call on system preference 'SelfCheckHelpMessage'
Bug 35065 moved to additional contents.
Remove call in opac/sco/help.pl.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 49e852e0a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:55:16 +02:00
Tomas Cohen Arazi a6d13bd980
Bug 39783: Fix typo in migrate.inc
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2b69baa3c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:53:10 +02:00
Janusz Kaczmarek 6a4699397c
Bug 39692: With OnSiteCheckoutsForce the due date should be set
When OnSiteCheckoutsForce is set it is possible to on-site checkout an
item to a restricted patron. But the due data that is labelled with
"Automatic due date:" is not being set. As a result, when such a
checkout is performed and you do not set the date manually, the due
date will be set as for normal checkout (even if it is marked as
on-site checkout).

Test plan:
==========
1. Enable OnSiteCheckouts and OnSiteCheckoutsForce; manually restrict
   a patron.
2. Go to checkout page for this patron. You will notice:
   "On-site checkouts only. Automatic due date:" with an empty input
   field for the date. Perform the checkout (pick any existing
   barcode).
   Note the due date in patron's checkouts. In standard ktd it will be
   +5 days from today, as for a regular checkuot (cf. Circulation and
   fine rules) and the checkout will be marked as on-site checkout.
3. Apply the patch ; restart_all.
4. Repeat p. 2 (with another barcode or after checking-in). The date
   in the date input field should be set to today's date and after
   performing the checkout the sue date should also be set to
   the current date.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 103f095c2e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:49:24 +02:00
Owen Leonard daca6c3e3f
Bug 39947: Do not use bg-* Bootstrap classes
This patch removes a few instances of the "bg-*" class from our
templates, and adds some CSS to ensure that we can safely add the
".bg-*-subtle" class to a div with ".page-section."

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

- Go to Administration -> Circulation and fine rules. The information
  about rules specificity should have a pale blue background matching
  the color found in an "info" style alert.
- Go to Tools -> Import patrons. The "Notes" section should match what
  you saw in the previous step.
  NOTE: I made a small change to whitespace in the markup of this
  section to prevent the database column list from displaying without
  line breaks--an issue introduced by the global tidy.
- Go to Authorities and perform a search which will return results.
  - Click Actions -> Merge on one of the results. An "info" style alert
    should be shown at the top of the page, "Merging with authority..."
  - Without completing a merge, go to the Authorities home page. You
    should see an identical alert.
- In KTD, bibliographic record 369 can be used to test errors related to
  encoding problems:
  - Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=369
    and confirm that you see a "warning" style alert (a pale yellow
    background).
  - Edit that record and confirm you see a similar error messages on
    that page.

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 753ce067e6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 71f601dabb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:38:27 +02:00
Brendan Lawlor b6f36fcf40
Bug 39597: Fix cancel_hold_alert badge color contrast for accesibilty
This patch add a class for the background on the badge element to fix color contrast

To test:
1. Go to a bib record and place multiple holds on it
2. Select multiple holds and click 'Cancel selected (4)'
3. The Alert says 'This action will cancel 4 hold(s).'
4. Note that the contrast on the number of holds is very low
5. Click 'Cancel' apply patch and restart_all
6. Repeat steps 2-3
7. Note that the contrast on the number of holds is good

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 858a53d897)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:32:41 +02:00
Owen Leonard 7a2f563974
Bug 39274: [24.11.x] Non public notes are low contrast in the issues table - Previous checkouts
This patch reflects some rethinking on my part about how the Bootstrap
color classes are meant to be used, and makes some changes which I hope
will be more consistent with the Bootstrap 5 documentation while keeping
our interface usable.

The main difference is in the use of the classes "text-bg-*" and
"bg-*-subtle." For example the class "bg-info-subtle" will give an
element a subtle colored background. "text-bg-info" will have a more
saturated background color. The "text-" part of the class is a reference
to the fact that elements with that category of classes will have text
color which adapts to provide correct contrast.

This patch also makes a minor adjustment to the color used for "warning"
type elements (e.g. <div class="alert alert-warning">. I've adjusted the
color slightly in order to differentiate it from the "primary"
class color we use for submit buttons.

To test, apply the patch and rebuil the staff interface CSS. Clear your
browser cache if necessary.

Checkouts:
1. Have an item with a non-public note.
2. Check it out, it looks fine while under "Today's issues"
3. Set the issuedate to some time in the past
   `update issues set issuedate = '2025-03-04 15:58:46';`
4. The non-public note should appear in legible red.

Return claims:
1. The "Claims" tab on the patron detail and checkout pages already used
   the "text-bg-*" classes but the "-success" class didn't work well
   with the tab background color so I removed it. I notice there is a bug
   in the way the classes change as the tab is activated, but that will
   have to be dealt with on another bug.

Bibliographic details:
1. Place at least one hold and at least one article request on a title.
2. The detail view should show "Holds: 1", and "Article requests: 1"
   with the numbers in legible Bootstrap badges.

Holds:
1. Perform a catalog search which will return multiple titles.
2. Select multiple titles and click "Place hold."
3. Select a patron to place a hold for.
4. Confirm the holds by clicking "Place hold."
5. The holds should now be shown under the heading "Existing holds,"
   with Bootstrap badgets showing the hold count on each.

Patrons requesting modification:
1. Submit an update to a patron record via the OPAC.
2. On the patrons home page in the staff interface there should be a
   "Patrons requesting modifications" link at the top, with a count of
   pending modifications shown in a Bootstrap badge.

Check-ins:
1. Check in an item from a patron account with multiple other checkouts.
2. In the table of checked-in items the patron's remaining checkout
   count should be shown in a Bootstrap badge.

SMTP servers:
1. Go to Administration -> SMTP Servers.
2. Edit at least one server so that debug mode is enabled and it is
   marked as a default server.
3. In the view of servers, the debug mode and default status should be
   shown in Bootstrap badges.

Plugins:
1. Go to Administration -> Plugins.
2. Upload a plugin if necessary, and check the list of installed plugins
   when the plugin is disabled and when it is enabled. In both cases the
   status should appear in a Bootstrap badge.

About page:
1. Go to the About page.
2. Under the "Server information" tab, the status of Memcached and
   Message broker should be shown with a background color--pale blue for
   okay statuses.

Tools home page:
1. If necessary, go to the OPAC and submit at least one comment on a
   bibliographic record and tag at least one record.
2. In the staff interface, on the Tools home page, the number of tags
   pending approval and the number of comments awaiting moderation
   should show in Bootstrap badges.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:30:28 +02:00
Matt Blenkinsop 71d4afd742
Bug 39530: Make MARC order cronjob dependent on AcqCreateitems
Test plan:
1) View the patch diff and confirm that the hardcoded value of 'ordering' has been replaced with undef
2) In C4/Acquisition.pm, look at the method description for ModBasketHeader and observe the descritpion for 'create_items'
3) Note that if the value is set to undef as per step 1, the AcqCreateItem syspref takes precedence

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2186bf7fa8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:07:33 +02:00
Nick Clemens 6e1b270b65
Bug 39717: Use numeric comparison for stock rotation stages
To test:
 1 - Enable SotckRotation
     http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=StockRotation
 2 - Browse to "Cataloging -> StockRotation"
 3 - 'New rota' - fill out the form and save
 4 - Manage->stages
 5 - Add many stages, more than 10 at least
 6 - Try to move a stage form the bottom to position 3
 7 - Note message above list: Saving changes... Error: Bad Request
 8 - Apply patch, restart_all
 9 - Attempt to move stages, try many combinations
10 - Success!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 85003674ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:06:37 +02:00
Nick Clemens d30fdab95b
Bug 39652: (QA follow-up) Update misc/maintenance/pseudonymize_statistics.pl
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e744f001ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:00:07 +02:00
Pedro Amorim 325d608293
Bug 39652: Rename new_from_statistic
This new method name better reflects the fact that it now creates - and stores - the PseudonymizedTransaction object

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54205bd6ba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:00:07 +02:00
Pedro Amorim 4649544ee8
Bug 39652: store PseudonymizedTransaction before adding related entries
Test plan:
Run the tests before and after applying this patch:
perl t/db_dependent/Koha/Pseudonymization.t

They should fail before this patch and pass after applying patch.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f23632a352)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:00:00 +02:00
Pedro Amorim dfa1d9918f
Bug 39652: Add tests
These tests prove the bug:
perl t/db_dependent/Koha/Pseudonymization.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:59:54 +02:00
Marcel de Rooy fb8198142c
Bug 39485: Fix wide character in print-warn in opac-export
Similar change in intranet counterpart: catalogue/export.

Test plan:
Verify no warning anymore when using ris or isbd when record
contains specific Unicode character(s).

Signed-off-by: Magnus Enger <magnus@libriotech.no>
I could not trigger "Wide character" for RIS in the OPAC, but for
ISBD I can see it removes that warning.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 81359cc8a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:55:22 +02:00
Pedro Amorim 7d1afb05dd
Bug 39663: Fix header element for Patrons
Commit https://github.com/Koha-Community/Koha/commit/f42df40 renamed 'Members' to 'Patrons' but didnt adjust h3->h2 as it did with every other entry in this page

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8538c885f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:52:00 +02:00
Janusz Kaczmarek 7f850b8d35
Bug 39500: Subfield 111 $n is badly displayed in OPAC (MARC21)
If the main heading is 111 and id contains subfield $n, the content of
this subfield is badly displayed in OPAC: at the beginning of the
heading text (right after "By:"), and then correctly, as the part of
the link.

Test plan:
==========
1. Check if the 111 $n subfield is available in the framework you are
   using. If not, activate it (Editor checkbox).
2. Take any bibliographic record and replace the main heading with a
   conference heading (111), e.g.:
   111 $a Annual Koha Hackfest $n (13 : $c Marseille : $d 2025)
   Control in OPAC that the $n subfield is displayed twice (first time
   at the beginning)
3. Apply the patch ; restart_all
4. Check the result in OPAC: the main heading should be displayed
   correctly now.

Signed-off-by: Thomas Klausner <domm@plix.at>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 34870b7d6a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:46:42 +02:00
Pedro Amorim b64fc2ecd7
Bug 39449: Fix table sort arrows
Test plan:
1) Look at the same biblio on both OPAC and Staff:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=76

2) Click on the 'current library' column header for OPAC and 'Home
   library' for staff. Notice that on Staff when it's DESC, arrow points
   down (as expected), but on OPAC when it's DESC, the arrows points up.

3) Apply patch. Reset CSS:
   yarn css:build

4) Do a hard refresh on the OPAC. Repeat test plan. Notice they now
   behave the same.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1d6017bbd8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:44:48 +02:00
Andrew Fuerste Henry 3a30284d32
Bug 39321: Hide subfield tag information for control fields in bib and authority editing
This applies only to the basic editor, but for both bibs and authorities
To test:
1 - Open a bib in the basic editor, see that the control fields show the subfield tag value label and that the value of 00 is slightly cut off in the display
2 - Open an authority in the basic editor and confirm same
3 - apply patch
4 - reload your records and see that the subfield value and label are now hidden for control fields in both bib and authrority editing

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 13b813a4f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:40:28 +02:00
Marcel de Rooy c7c6726f34
Bug 38904: Allow opac translation in admin/localization
Test plan:
Try to translate itemtype for an opac language not part of
intranet languages.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c80e9c015c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:38:48 +02:00
Marcel de Rooy cfe71bde53
Bug 38903: Fix theme in some getTranslatedLanguages calls
Combining opac with pref template is wrong. This pref should
actually be renamed to something like intranetTheme(s) or so.

Replacing the obsolete prog theme in Languages.t by undef. This
achieves the same: getting all themes for that interface.

Test plan:
Add some languages for opac and intranet. Do not enable exactly
the same set.
Enable TranslateNotices.
Verify that you have all OPAC languages on memberentry and
opac-messaging. And all languages on additional contents.
Run t/db_dependent/Languages.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with:
OPAC  languages: en, nl-NL, de-DE
Staff languages: en, de-DE, fr-FR
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit baea457996)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:37:15 +02:00
Marcel de Rooy 6c7bed9109
Bug 38630: (QA follow-up) Fixing few calls of getTranslatedLanguages
The fourth parameter is now removed and was never used.
Also replacing the 'both' interface by passing no interface to make
it consistent with call in additional-contents.
Resolving warn for empty interface or theme on Languages.pm L128.

Test plan:
Run t/db_dependent/Languages.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1f6e409871)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:52 +02:00
Marcel de Rooy 49dfd3899a
Bug 38630: (QA follow-up) Two typos
Prefered and chose.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d84f06ebab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:51 +02:00
Marcel de Rooy 830146cb81
Bug 38630: (QA follow-up) Add copyright, license and/or POD
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bbf0392359)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:51 +02:00
Julian Maurice 045818de6e
Bug 38630: Make the REST API respect KohaOpacLanguage cookie
The REST API can return translated strings to the opac or staff
interface, so it should respect the KohaOpacLanguage cookie and return
translations in the same language than the interface.

Test plan:
1. Do not apply patch yet
2. Log in to koha staff interface
3. Use the browser's devtools to get the value of CGISESSID cookie
4. Make sure you have at least 2 languages installed ('en' + another
   one - I'll use 'fr-FR' as an example in this test plan)
5. Find an item and note its itemnumber and itemtype
6. Go translate this itemtype's description (admin » item types » edit
   item type » translate). Add a translation for 'en' and another one
   for your language.
7. Close your browser tab (do not logout) and restart Koha to flush the
   memory cache.
8. Execute the following commands (replace variables by the correct
   value):

    curl -sSL "$KOHA_URL/api/v1/items/$ITEMNUMBER" \
        -H 'x-koha-embed: +strings' \
        -H "Cookie: KohaOpacLanguage=en; CGISESSID=$CGISESSID" \
        | jq -r '._strings.item_type_id.str'

   If you do not have jq, it can be found in most distributions
   packages. Or you could inspect the JSON manually at the path
   /_strings/item_type_id/str

   Restart Koha again, and execute the same command but with your
   language set in KohaOpacLanguage cookie:

    curl -sSL "$KOHA_URL/api/v1/items/$ITEMNUMBER" \
        -H 'x-koha-embed: +strings' \
        -H "Cookie: KohaOpacLanguage=fr-FR; CGISESSID=$CGISESSID" \
        | jq -r '._strings.item_type_id.str'

   Depending on how Koha sort the languages (not sure how it's done),
   you should get either the 'en' one or the 'fr-FR' one, but the
   important thing is you should get the same translation, no matter
   what the value of KohaOpacLanguage is, which is the issue this patch
   is trying to fix.
9. Apply the patch and restart Koha
10. Repeat step 8. This time you should get the translation
    corresponding to the language set in KohaOpacLanguage cookie

Side note:
* The need to restart Koha before each request is due to a bug (see bug
  38454). If already pushed when you're testing this one, you don't have
  to restart.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ca5db9ffb7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:42 +02:00
Marcel de Rooy c575e4bb6a
Bug 40608: (QA follow-up) Delete notice in test, adjust about.tt
[1] This prevents a warn 'Violation of unique constraint in Letter'
    from TestBuilder if the notice already exists.
[2] The about warn should no longer say that password changes will
    fail but only warn about a missing notification.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8d31c2e067)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 585ea49741)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:25:50 +02:00
Tomas Cohen Arazi 029b37dde7
Bug 40608: (follow-up) Some tests rely on existing data
Playing with the about page, I noticed prior tests in the codebase fail
if the letter doesn't exist.

This patch fixes that.

To test:
1. With a fresh KTD run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Patron.t
=> SUCCESS: Tests pass!
2. Delete the existing notices:
  k$ koha-mysql kohadev
   > DELETE FROM letter WHERE code="PASSWORD_CHANGE"; \q
3. Repeat 1
=> FAIL: Tests fail! Current tests print a warn (Test::NoWarning)
doesn't like this
4. Apply this patch
5. Repeat 1
=> SUCCESS: Tests now pass. The test creates its own notice.
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 93a830b8ca)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ab0fa4fea6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:25:35 +02:00
Tomas Cohen Arazi 7fb7827988
Bug 40608: (follow-up) Add warning in about page
This patch adds a check in about.pl for when `NotifyPasswordChange` is
enabled but no notices are present on the system.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8e05336a08)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a6b22a27dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:24:09 +02:00
Tomas Cohen Arazi 47782a1513
Bug 40608: Continue password change even if notification fails
When NotifyPasswordChange is enabled and GetPreparedLetter fails to find
a PASSWORD_CHANGE letter template, the set_password method was returning
early with undef, preventing the password from being changed.

This fixes the issue by:
1. Removing the 'or return;' statement after GetPreparedLetter
2. Wrapping the letter processing in an if block to handle missing templates
3. Ensuring password change continues regardless of notification success

The password change should not fail just because the notification cannot
be sent. The notification is a nice-to-have feature, but the core
functionality (changing the password) should always work.

Test plan:
1. Apply the tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Patron.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Verify that when the letter template exists, notifications are still sent
6. Verify that when NotifyPasswordChange is disabled, password changes work
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f748205ad0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cb3a4f094c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:23:55 +02:00
Tomas Cohen Arazi 4024f7ce91
Bug 40608: Regression tests
When NotifyPasswordChange is enabled and a patron has a valid email address,
but there is no PASSWORD_CHANGE letter template, the set_password method
fails silently and returns undef instead of changing the password.

This adds comprehensive regression tests to demonstrate the bug:

1. Bug condition: Missing PASSWORD_CHANGE letter template causes password
   change to fail and method returns undef
2. Control test: Password change works when NotifyPasswordChange is disabled
3. Control test: Password change works when PASSWORD_CHANGE letter exists

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c310ccfc0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6ebff3d47f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:21:01 +02:00
Owen Leonard 8f5f1c5f9c
Bug 37926: Allow for translation of "to" in date range selection
When a calendar widget has been initiated as a date range selector (as
it is when creating a new booking), the selected dates are added to the
input field as "0000-00-00 to 0000-00-00". This "to" needs to be
translatable.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

- Update a translation:
 > gulp po:update --lang fr-FR
 > cd misc/translator
 > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
  - Locate strings pulled from intranet-tmpl/prog/js/calendar.js for
    translation, e.g.:

    #: koha-tmpl/intranet-tmpl/prog/js/calendar.js:144
    msgctxt "As in, from date1 to date2"
    msgid "to"
    msgstr ""

    - Edit the "msgstr" string however you want (it's just for testing)
    - Install the updated translation:

    > perl translate install fr-FR

- In the staff interface, locate an bibliographic record with items and
  change the "Bookable" option from the item details screen.
- Switch to your updated translation in the staff interface.
- Click the "Place booking" button.
- Fill out all the fields in the "Place booking" modal.
- After you select a date range, the "Booking dates" input field should
  show your translated text.

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 00bb254149)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 120a4f86c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:08:28 +02:00
Marion Durand f01e242348
Bug 38455: UNIMARC XSLT diplay field 036 correctly
In Unimarc, the field for music incipit is 036. The test to display the music player is correctly on field 036 but the field displayed was 031 (which is valid for Marc21 but not for Unimac).

To test:
On a Koha Unimarc instance:
1- Set system preference "OPACPlayMusicalInscripts" to "Play" and "OPACShowMusicalInscripts" to "Show"
2- set the system preference OPACXSLTListsDisplay is set on koha-tmpl/opac-tmpl/bootstrap/{languagecode}/xslt/UNIMARCslim2OPACDetail.xsl
3- Update a framework of your choice to display subfield 036$2 $g $n $o $p in OPAC, intranet and editor (make sure the collapse checkbox is not checked)
4- Create a record with the previously modified framework, fill all mandatory fields and add a 036 field with at least subfield $2 $g $n $o $p, make sure you have no 031 field
example of a valid 036 field
    036$2 pe
    036$g G-2
    036$n bB
    036$o 3/4
    036$p {8C'8C'}/4D4C'4F/2E
5- Go to the OPAC detail page for the record created (with interface in English)
6- check that the music player does not appear
7- apply the patch
8- Reload the OPAC detail page for the record created (sill with interface in English)
9- check that the music player appears and is working

Signed-off-by: Emmanuel Bétemps <e.betemps@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 b364089c70)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 15be16d017)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:03:30 +02:00
Fridolin Somers c196fd7753
Bug 39423: Fix column checkboxes in batch item modification hide incorrect columns
In batch item modification, unchecking any column hides the previous column.

This is caused by new HTML in table header :
<span class="dt-column-title"></span><span class="dt-column-order"></span>

This patch fixed by adding ".dt-column-title" to function guess_nb_cols().

Test plan :
1) Go to batch item modification
2) In "Show/hide columns:" click on "Home library" column
=> Check correct column is hidden
3) Go to another batch item modification
=> Check column "Home library" is hidden (from cookie storage)

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7c501cc381)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ee3bf78fd4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:01:52 +02:00
Lisette Scheer f9a3d52e5b
Bug 40620: Holds Queue will assign to the lowest item number if multiple branches have the same transport cost
To Test:
Before applying:
1. Turn on the UseTransportCostMatrix system preference
2. Create holds on a record with multiple items. (I used Lanark in KTD)
3. Set the item location to all be the same (I used MID)
4. Set the holds to pickup at Centerville, Fairfield, and Pleasant Valley
5. Set the transport cost matrix to
Centerville\fairfield 1
Centerville\Midway 1
Fairfield\Centerville 1
Fairfield\Midway 1
Midway\Centerville 1
Midway\Fairfield 1
Midway\Pleasant Valley 4

6. Build the holds queue (either turn on realtime hold queue and then edit the bib to update or run the cron on the command line)
7. Run a report: select * from hold_fill_targets where biblionumber=9 order by borrowernumber;
8. Rebuild the hold queue
9. Run the report again, the results should be the same.

10. Apply the patch
11. Run the hold queue again
12. Observe the results should now be different.
13. Try a few more times and ensure the numbers are changing, create some more items at midway and try again to see more variety in numbers.

Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5832521086)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 642802d8cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 15:23:50 +02:00
Fridolin Somers eb2d1a61e6
Update release notes for 24.11.09 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-25 16:53:03 +02:00
Fridolin Somers c992f0ac2e
Increment version for 24.11.09 release
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-25 16:48:28 +02:00
Marcel de Rooy 2e7de645f2
Bug 40766: (QA follow-up) Operator precedence, quoting
Adding parentheses since I was not sure about precedence here. The filter
should be applied to the whole expression.
Adjusted double to single quotes in the second change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2025-09-25 16:45:23 +02:00
Jonathan Druart b43812f3bd
Bug 40766: Prevent XSS on set-library
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2025-09-25 16:45:22 +02:00
David Cook 196f9a2c55
Bug 40748: Check for HTTP URLs and skip shell when using system()
This change checks for HTTP(S) URLs and skips the shell when using
system() so that shell metacharacters aren't interpreted.

Test plan:
0. Apply the patch
1. Insert the following into the Babeltheque_url_update system preference:
$(whoami > /tmp/rce.log)
2. koha-shell kohadev
3. perl misc/cronjobs/social_data/update_social_data.pl
4. Note the script says the following:
$(whoami > /tmp/rce.log) is not a HTTP URL. Aborting.
5. Note also that /tmp/rce.log is not created
6. Change Babeltheque_url_update syspref to something like the following:
http://localhost:8080
7. perl misc/cronjobs/social_data/update_social_data.pl
8. Note that the wget succeeds but the bunzip2 fails (as expected) since
we haven't fetched a bzipped file
9. Try to create a payload that passes the HTTP URL test with shell
metacharacters and note that they're not interpetted and instead
just used as part of a URL string.

Signed-off-by: Jake Deery <jake.deery@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7bb61b3114be14d2d18d03f855385d863f0bac60)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-25 16:45:22 +02:00
Jake Deery efe749d8f5
Bug 40748: Fix RCE in update_social_data.pl
This patch fixes an identified RCE in the update_social_data.pl
social_data, which when executed, allows an attacker to run arbitrary
code on the system's shell.

TO TEST:

a)  In the Babeltheque_url_update syspref, wrap any bash in $(), and then
run the update_social_data.pl script.
    *)  For example, $(whoami >
/tmp/rce.log) will output to a file the username the perl script is
running as.
APPLY PATCH
b)  Run the update_social_data.pl script again. The string is now
meta-escaped, and the RCE no longer works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a26836bac54183c82fd5934e07c3c7306012998a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-25 16:45:20 +02:00
Jonathan Druart 71984a49dc
Bug 33856: Make inventory problems translatable
We should make the inventory 'problem' column translatable.

Test plan (assuming KTD):
1- Update po
    misc/translator/translate update LANG
    (for example LANG="fr-FR")
2- translate the new strings
    vim misc/translator/po/LANG-messages-js.po
    edit for example "wrong place" or "missing"
3- install the language
    koha-translate --install LANG --dev kohadev
4- use it for the UI and confirm that the CSV generated has 'problem' column translated
    a- Using the test language (activate it with sysprefStaffInterfaceLanguages)
    b- Go to Cataloging > Inventory
    c- Fill some barcode and some filter (for example a filter on callnumber)
    d- Select "Export to CSV file"
    e- Submit
    f- Open the CSV file generated, check that the colomn problem is now translated according to what you have filled in step 2

Signed-off-by: Marion Durand <marion.durand@biblibre.com>

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3e68067e7e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6388bb3bee)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-09-25 14:04:34 +00:00
Lucas Gass acbe2fc9af
Bug 40654: [24.11.x] Fix how rank/priority is adjusted when changing from the UI
To test:
0 - APPLY PATCH
1 - Place 50 holds on a bib record
https://github.com/kidclamp/handy-koha-script/blob/main/randhold.pl
2 - View the holds page for the record
3 - Sort the holds alphabetically
4 - Change the dropdown priortiy for the alphabetically first hold to 1
5 - All the priorities should now ajust accordingly but they will NOT be resorted on the fly
6 - Play with adjusting some priorities, making sure everything correctly adjusts.
7 - Click 'Update holds' to make sure the priorities adjust right
8 - Make sure you test with the 'del' option and the adjustments still work.

Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:49:50 +02:00
Owen Leonard aa35b93543
Bug 40590: Prevent OPACAuthorIdentifiersAndInformation from showing empty list elements for unknown 024$2
This patch modifies the template which is used to display additional
author information if OPACAuthorIdentifiersAndInformation is displayed.
The change prevents an empty list item from appearing.

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

- Search for OPACAuthorIdentifiersAndInformation and make sure that
  "Identifiers (024$2$a)" is checked.
- Have a record with at least 2 persons (100, 700) linked to an
  authority record
  - One of those authority records should not have an 024 tag
  - The other authority record should have two 024 tags:
    - 024 $a someidyoumakeup $2orcid
    - 024 $a someidyoumakeup $2somethingelse
- Check the detail page in OPAC -> "Author information" tab
- Check the authority detail page in OPAC, under "Author information"
  in the right-hand column.

Before the patch, '$2somethingelse' is not "supported" and will create
the empty list element. After the patch there should be no empty list
item.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 43dfb04536)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit df6768d616)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:39:27 +02:00
Andrew Fuerste Henry 6027deac31
Bug 40647: Spell dictionary correctly
To test:
1 - go to reports home
2 - inspect Reports dictionary
3 - see that it has class rep_dictonary
4 - apply patch, reload page
5 - see that class is now rep_dictionary

Signed-off-by:  Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ea98862fa9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ae5df2bc75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:34:49 +02:00
Lucas Gass 7baf3fb81b
Bug 40296: Fix failing Returns.t test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eab5aa774c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 2cb92275a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:29:24 +02:00
Paul Derscheid ac6963712e
Bug 40296: (QA follow-up) Increment test count to include Test::NoWarnings
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fdd089a3ba)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6ec782810f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:27:17 +02:00
Martin Renvoize 6e4b429cd9
Bug 40296: Add unit tests for booking status handling
This patch adds test coverage for the new booking status management
in AddIssue:

Test scenarios covered:
- Patron checking out their own booked item (marks as completed)
- Different patron checking out booked item during actual booking period
  (cancels booking)
- Checkout conflicts only during lead period (preserves booking, respects
  librarian decision)
- Checkout period encompassing entire booking period (cancels booking)
- No booking present (normal operation)

Tests ensure proper booking lifecycle management and validate that
librarian override scenarios work as intended.

To test:
1. Apply all patches
2. Run: prove t/db_dependent/Circulation.t
3. Verify all booking status handling scenarios pass

The test plans now provide:
- Step-by-step instructions for manual testing
- Multiple scenarios covering different use cases
- Clear expectations for what should happen in each case
- Practical workflow that staff would actually follow
- Edge cases like lead period conflicts and overrides

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0a2b541321)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cdb4e0dd30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:10:09 +02:00
Martin Renvoize 8f651f11ff
Bug 40296: (follow-up) Fix booking patron ownership and cancellation logic
This follow-up addresses critical issues in the initial implementation:

1. **Patron Ownership Check**: Only mark bookings as 'completed' when
   the patron checking out the item is the same patron who made the booking

2. **Smart Cancellation**: When another patron checks out an item that
   conflicts with an existing booking:
   - Cancel the booking only if checkout overlaps with actual booking period
   - Respect lead/trail periods - don't cancel if conflict is only during
     preparation periods (allows librarian override scenarios)

3. **Date Logic**: Proper overlap detection using start_date and end_date
   rather than periods extended by lead time

This prevents incorrect booking completion and handles librarian override
scenarios appropriately.

Test plan:
1. Apply previous patch and this follow-up
2. Enable bookings and create a bookable item

Test A - Patron's own booking completion:
3. Create booking for Patron A: start = today, end = +7 days
4. Check out item to Patron A (due date = +5 days)
5. Verify booking status = 'completed'

Test B - Lead period override scenario:
11. Return item, set bookings_lead_period circulation rule = 3 days
12. Create booking for Patron A: start = +5 days, end = +8 days
13. Check out item to Patron B (due date = +4 days) - conflicts with lead period
14. Override the booking conflict warning
15. Verify Patron A's booking status remains 'new' (not cancelled)
16. This respects librarian's decision that item will return in time

Test C - No booking scenario:
17. Return item, ensure no active bookings exist
18. Check out item to any patron
19. Verify checkout works normally without errors

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2f849fd79c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit dcd3bdbf28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:10:03 +02:00
Lucas Gass 342b27c3a4
Bug 40296: Mark booking as completed when issuing to booking patron
This patch adds logic to automatically mark a patron's booking as
'completed' when they check out the item they have booked.

When AddIssue is called, the system now:
- Checks if there's a conflicting booking for the checkout period
- Marks the booking status as 'completed' if found

This ensures booking status accurately reflects when items are
actually checked out to fulfill bookings.

Test plan:
1. Enable bookings system preference
2. Create a bookable item (set bookable = 1 in items table or via item editor)
3. Create a booking for a patron for that item with start date = today,
   end date = 7 days from now
4. Go to circulation and check out the item to the same patron who made
   the booking
5. Check the booking status in the database or via the bookings interface
6. Verify the booking status has changed from 'new' to 'completed'
7. Confirm the checkout was successful and shows normally in patron's
   checkouts list

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a8fd9734c6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit aeb8648326)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:09:54 +02:00
Arthur Suzuki 54cd13659d
Bug 34127: add the "export to CSV link" for baskets which are closed or linked to a groups
Test :
 - create an acquisition basket
 - add at least one record
 - close the basket (the "export as CSV" link is present)
 - attach the basket to a basket group
 - check that the "export as CSV" link, next to "reopen the basket" is
 now gone.
 - apply patch and reload the page (may need reload plack, cache, etc...)
 - "export as CSV" link is now present even though the basket is
 closed and it is attached to a basket group.
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Dominique et Stephanie <stephanie.etallaz@univ-cotedazur.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 174f243fd8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fbb0967331)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 15:07:39 +02:00
Janusz Kaczmarek a5c19ba6d4
Bug 40156: Advanced editor should not create empty fields and subfields
Currently, advanced bibliographic records editor creates empty
subfields (or even empty fields) when no content is placed after
‡<code> (or, in case of control fields, after <tag>).

Test plan:
==========
1. Enable EnableAdvancedCatalogingEditor (have StripWhitespaceChars
   set to "Don't strip" - the default setting).
2. Open a record in the advanced editor, create empty subfield and
   empty fields, e.g.:

007
500 _ _ ‡a
246 3 1 ‡aAdditional title :‡b

3. Save the record. Go to bibliographic record Normal view and in
   modal "MARC preview" notice that the fields / subfields you entered as
   empty exist in the record with no data. This is wrong.
4. Apply the patch ; restart_all.
5. Repeat p. 2 and 3. Note that empty fields/subfields have not been
   created.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Wojciech Baran <wojciech.baran@ignatianum.edu.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d56b15d29c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3a22c2efb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 14:28:57 +02:00
Fridolin Somers 82fec11659
Bug 36155: Improve perfs of suggestion.pl when there are many budgets
Page suggestion/suggestion.pl calls CanUserUseBudget() in a loop,
will must use a uniq Koha::Patron object of the logged in user.
When there are many budgets and funds this takes some time.

Test plan :
Compare performance with and without patch with many budgets and funds
(see test plan of Bug 35921)

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 10c8a373fb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b3704edcac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-23 14:24:16 +02:00
Janusz Kaczmarek 2778a49fb1
Bug 40540: OPAC generates warnings in logs when no results are found
When no results are found, a warning:

[WARN] Argument "" isn't numeric in numeric gt (>) at /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt line 76.

is generated in [plack-]opac-error.log

Test plan:
==========
1. In OPAC, perform a search for a random string of characters to get no
   results.
2. Check plack-opac-error.log. You should see a warning as above.
3. Apply the patch ; restart_all.
4. Repeat the search. Check the log -- there should be no new warning.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ee7fa9f3f6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cd788e34ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 16:26:56 +02:00
Jonathan Druart 709b992059
Bug 39712: Add POD
Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 60b30bc700)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit da1cb5ae0f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 16:10:14 +02:00
Jonathan Druart ec2ad0296b
Bug 39712: Remove warnings
[WARN] Use of uninitialized value $view in exists at /kohadevbox/koha/Koha/Manual.pm line 346.

Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7ca66bf719)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d84d276587)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 16:10:14 +02:00
Jonathan Druart 5ae598c732
Bug 39712: Remove extra '/' from the URL
Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2aeab5ba46)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 781f7e5f9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 16:10:13 +02:00
Jonathan Druart b2c0e3ac60
Bug 39712: Fix links to the manual from VueJS components
Query parameters break the manual mappings in vue modules.

If a url in a vue module contains query parameters the mapping for the manual fails and redirects to the homepage when 'Help' is clicked

To reproduce navigate to the agreements page in ERM and create at least one. On the list page, use the filters so that you have query parameters in the page URL. Click the 'Help' button - you just get the manual home page

Test plan:
Confirm that the original issue is fixed when this patch is applied.

Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0514af0117)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 251c92ebe2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 16:10:13 +02:00
Jonathan Druart e4d384523f
Bug 40121: Fix 'Cannot read properties of undefined'
Same fix as
  commit 7bc3b24827
    Bug 40344: Fix KohaTable_spec.ts
    > Cannot read properties of undefined (reading 'description')

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 15f8acf546)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d8ea7cfe2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:29:38 +02:00
Jonathan Druart f9319468d8
Bug 40121: Add Cypress tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c44171d74f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 2b7d149655)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:29:31 +02:00
Jonathan Druart 484f366c19
Bug 40121: Fix library and category filters on patron search
Test plan:
Go to http://localhost:8081/cgi-bin/koha/members/members-home.pl
Select a value for Library and/or Category filters
Click "Search"
=> Without this patch the dropdown lists do not have the value selected
=> With this patch applied they have the correct values selected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0f4f792c6c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 90aef7ae36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:28:35 +02:00
Jonathan Druart ba074249ea
Bug 40544: Move some bundles related code out of document.ready
On bug 40127 we moved the build_items_table calls outside of document
ready, but createChild is defined in document.ready (and so defined too
late).

This patches fix the following JS error:
"Uncaught ReferenceError: createChild is not defined"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 60b7c238a8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4caa113d62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:16:40 +02:00
Tomas Cohen Arazi 093d3d4030
Bug 40530: Use +strings and simplify JS
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 81e92c5ae0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a0af2fc321)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:06:14 +02:00
David Nind 6d2494d670
Bug 40530: (follow-up) Remove spaces before and after the reason
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0749850851)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cea9f8f639)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:06:14 +02:00
Kyle M Hall ac522ff3b5
Bug 40530: Show hold cancellation reason in patron holds history
Bug 35560 includes a FIXME noting that it does not properly maintain the display of hold cancellation reasons introduced in bug 26281.

Test Plan:
1) Place a hold and cancel it with a reason
2) Browse to the patron's hold history, note the FIXME shown instead of
   the reason
3) Apply this patch
4) Reload the patch
5) You should now see the cancellation reason instead of FIXME!

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 1a26837c74)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6a31993e2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:06:13 +02:00
Tomas Cohen Arazi e21c3427d2
Bug 40542: Add strings embed to holds-related endpoints
This patch makes holds endpoints be allowed to embed strings.

To test:
1. Use your favourite REST tool to hit /api/v1/holds
2. Add the `x-koha-embed: +strings` header.
=> FAIL: The API rejects because it is not equiped with the feature.
3. Apply this patches
4. Run:
   $ ktd --shell
  k$ yarn api:bundle
  k$ koha-plack --restart kohadev
5. Repeat 2
=> SUCCESS: It works!
6. Sign off :-D

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 e90bc50209)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f9db5716c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:02:01 +02:00
Tomas Cohen Arazi 2d2eb49661
Bug 40542: Add cancellation_reason to Koha::Hold->strings_map
This patch adds the mentioned AV to the returned strings structure.

It also adds tests for the method.

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

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 0f533c1ceb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit e991fc4057)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 15:01:53 +02:00
David Flater 9b0b996988
Bug 39427: (follow-up) Adjust number of tests
Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 08525887ca)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 567902f42d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:57:12 +02:00
Laura_Escamilla 15353da272
Bug 39427: Searching lists table by owner can only enter firstname or surname
To test:
1. Ensure that the virtual shelves system preference is enabled
2. Create one or two lists using a patron that has both a first and last name. You don’t have to add items to the list, the list itself is enough.
3. Under the Owner column in the Lists table, search using the patron’s first name. Note that the name is properly filtered.
4. Next, try to search by the last name. It is also properly filtered.
5. Now search using both the first name and the last name together. Note that the results come up empty.
6. Apply the patch.
7. Repeat steps 3–5. Note that the patron shows in the results with just the first name, the last name, and the full name.
7.1. Additionally, try searching with extra spaces (e.g., ' Firstname Surname ' or 'Firstname Surname'). Confirm that results are still correctly shown.
8. Run t/db_dependent/Virtualshelves.t
9. Sign off and have a great day! :D

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9d5d88b0eb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3bcfcfbe0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:56:16 +02:00
Owen Leonard 48e2e0dbe3
Bug 40413: Add "Required" label to patron list input
This patch adds the "Required" label to the patron list name field in
the form for creating a patron list. This makes it consistent with other
forms which has required fields.

To test, apply the patch and go to Tools -> Patron lists -> New patron
list.

The "Name" field should have a red label "Required" after it.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7addabbb12)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 09ff6086c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:54:36 +02:00
Owen Leonard a3851b8dd7
Bug 40451: Link patron restriction types to correct section in manual
The mapping connecting the patron restriction types administration page
to the corresponding page in the manual was incorrect. This patch fixes
it so that clicking the help link from that page will take the user
directly to the correct place on the page.

To test, apply the patch and restart services.

- Go to Administration -> Patron restriction types.
- Click the "Help" link.
- You should be taken directly to the Patron restriction types page in
  the manual: administration.html#patron-restriction-types

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 467fad871a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9104d5e046)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:42:14 +02:00
CJ Lynce 56f439ea9f
Bug 38412: Display warning on biblio level
When no item is available, with AllowHoldPolicyOverride, a triangle appears on
    each item to be forced, but if you choose “next item available” without
    having  any item available, you won't see anything. Additionally, the top
    warning message about "No items are available" does not show when
    'AllowHoldPolicyOverride' is set to allow and no items are available
    (e.g. withdrawn, lost, damanged, depending on settings)

This patch corrects an error in request.pl where no incrementation of
    $num_override happens when an item is forced. This causes the warning
    triangle to appear on the 'Place hold' button on the bib level. The top
    warning message is restored as well.

 Finally, this patch changes the display of the fa-warning-triangle icon on the
    'Place hold' buttons to increase contrast with the button color, making it
    easier to see and increasing accessibility.

Test plan:
1) Set circulations rules for specific category and/or itemtype (for example 1
    hold allowed for staff on books). Set AllowHoldPolicyOverride on "Allow".
2) Search for a book biblio with multiple items, and set each item to a
    non-circulating status (withdrawn, lost, etc.)
3) Place a hold for a staff category patron for this bib record.
4) Normally you will see triangles on each item on specific section but you can
    force it. When you just select the next item available none triangle and
    none alert showing.
5) Apply this patch and restart_all.
6) Refresh your browser page.
7) Normally now there is a triangle into 'Place hold' submit button and an
    alert message appears on the top of the page. The triangle is also more
    visible.
8) Test other hold limits, such as max holds per record, to ensure the
    appropriate top alert message appears and the triangle alert appears on
    the 'Place hold' button.

Co-authored-by: Thibaud Guillot <thibaud.guillot@biblibre.com>
Sponsored-by: BibLibre
Sponsored-by: Westlake Porter Public Library <https://westlakelibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1900effc9b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9827914216)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:40:19 +02:00
Tomas Cohen Arazi 3de53001d4
Bug 40270: Fix uninitialized value warnings in SIP logging
The SIP server generates warnings when logging account information
for failed logins:

Use of uninitialized value $args[0] in sprintf at /kohadevbox/koha/C4/SIP/Sip.pm line 314
Use of uninitialized value $args[1] in sprintf at /kohadevbox/koha/C4/SIP/Sip.pm line 314

This occurs when $self->{account}->{id} or $self->{account}->{institution}
are undefined during failed authentication attempts.

This patch fixes the issue by:
1. Adding a safer sprintf implementation in siplog that handles undefined values
2. Providing default values for undefined account information in logging calls

To test:
1. Start SIP server
2. Attempt to connect with invalid credentials using sip_cli_emulator.pl:
   ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su invaliduser -sp wrongpass -l kohalibrary2 --patron koha -m patron_information
3. Check /var/log/koha/kohadev/sip-output.log
=> FAIL: 'Use of uninitialized value...' warns
4. Apply this patch
5. Repeat 2
=> SUCCESS: No "Use of uninitialized value" warnings appear
=> SUCCESS: Logging shows 'undef/undef' for failed logins instead of empty strings
6. Try a valid login
=> SUCCESS: Still works correctly for valid logins
7. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9cad25967d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4e1cd02932)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:33:55 +02:00
Nick Clemens 9d501229e9
Bug 40549: Silence two warnings in patron import tool
To test:
1 - Tail the logs in a terminal:
    tail -f /var/log/koha/kohadev/*.log
2 - Browse to Tools->IMport patrons
3 - Note warning when loading the page:
    Use of uninitialized value $uploadborrowers in concatenation (.) or string at /kohadevbox/koha/tools/import_borrowers.pl line 105.
4 - Upload a patron file, under: Preserve existing borrowers
    "If matching record is already in the borrowers table:" choose "Ignore..."
5 - Import the file
6 - Note an warning:
    Use of uninitialized value $update_dateexpiry in string eq at /kohadevbox/koha/tools/import_borrowers.pl line 113.
7 - Apply patch, restart all
8 - Reload the tool
9 - Note no warning
10 - Upload the file again, same settings
11 - Note no warning
12 - Sign off!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 58d14eccd0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8c252eaa73)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:31:20 +02:00
Jonathan Druart bc7d2f2f64
Bug 40321: Fix hold history search
The table global search didn't combine correctly with the status filters.

Test plan:
1. Have a patron with holds history
2. Go to members/holdshistory.pl?borrowernumber=x where x is the borrowernumber
3. Try to us the DT seacch to filter
=> Filtering is working as expected

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 088927aac1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 1ef30cc10c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:08:09 +02:00
David Cook 8ef2708c07
Bug 40547: Background jobs should appear even when plugins disabled
This change fixes the background jobs so that the list page loads
even when plugins are disabled.

Test plan:
0. Apply the patch
1. Download https://github.com/HKS3/koha-normalize-marc2db/releases/download/v0.91/Koha.Plugin.HKS3.NormalizeMARC2DB-0.91.kpz
2. Upload plugin into KTD
3. Click "Run tool" for plugin
4. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
5. Note that you see a pretty "Type"
6. Go to /etc/koha/sites/kohadev/koha-conf.xml and turn enable_plugins to 0
7. sudo koha-plack --restart kohadev
8. Go to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl
9. Note it now says "Unknown job type 'plugin_marc2db_normalizeall'
10. Celebrate as this is preferable to a 500 error

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6e3d0b1e48)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit eb862bd552)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:04:43 +02:00
Matt Blenkinsop 023af0ce26
Bug 40516: Restore falsy boolean filter values
Test plan:
1) Navigate to ERM agreements and create an agreement
2) In the agreements table, click on the filter for Is Perpetual
3) Only the option for 'Yes' will be shown
4) Apply patch
5) yarn js:build
6) Hard refresh the browser and repeat step 2
7) Filter options for Yes and No should be available
8) Check the filtering works appropriately

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5594945339)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cf1464d290)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:00:14 +02:00
Andrew Fuerste Henry ddf8ae5a49
Bug 40469: Reword anonymous_refund permission desciption
To test:
1 - apply patch
2 - make sure registers are enabled in system preferences so the permission shows
3 - find a patron, set permissions
4 - confirm the permission reads "Pefform refunds of point of sale transactions."

Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 64702f4320)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3d8a10a53b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 13:54:39 +02:00
Courtney Brown fc5a184ce6
Bug 39279: Update the wording for the overdue notice - branch to library
This patch updates the terminology used in the overdue notice (ODUE)
to change 'branch' to 'library'.

Test plan:
1. Check the wording of the ODUE notice under Tools > Patrons and
   circulation > Notices and slips.
2. Note that it includes this wording that uses 'branch':
   "Please return or renew them at the branch below as soon as possible."
3. Apply the patch.
4. Check that the updated ODUE notice has changed 'branch' to 'library'
   by either:
   4.1 Resetting everything: reset_all
   4.2 Viewing the default notice - click "View default" when viewing
       the email notice
   The updated text is now: "Please return or renew your overdue items
   at the library as soon as possible."
5. Sign off.

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 4bd1bc0a6f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b65e193871)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 13:51:39 +02:00
Marcel de Rooy 0dd5fa0cc2
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>
(cherry picked from commit 129012ff78)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 12:00:58 +02:00
Katrin Fischer b5219beb5a
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>
(cherry picked from commit 717eee0fcf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 11:59:09 +02:00
Fridolin Somers 9742abad4d
Bug 40198: [24.11.x] fix tidy
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 11:48:15 +02:00
Owen Leonard e34ad28842
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>
(cherry picked from commit 739c4fa01c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 11:33:30 +02:00
Owen Leonard 400f0b01ea
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>
(cherry picked from commit 731119a287)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 11:25:37 +02:00
Emily Lamancusa a4449a9f79
Bug 39914: (QA follow-up) Correct the footer colspan on the correct column
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8c814d46d9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 09:32:33 +02:00
Lucas Gass 86c92403d6
Bug 39914: Correct the footer colspan
To test:
1. Have some orders that are late.
2. Go to the late orders page (
   http://localhost:8081/cgi-bin/koha/acqui/lateorders.pl )
3. Try to use the export function, nothing happens.
4. APPLY PATCH
5. Try steps 1 and 3 again, this time the export function should work.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cdf88e0237)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 09:31:59 +02:00
Yvonne Waterman d4b83620f0
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>
(cherry picked from commit 80a1810316)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 17:20:55 +02:00
Owen Leonard ac122de235
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>
(cherry picked from commit f94664313d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 17:19:09 +02:00
Owen Leonard f65ff6a385
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>
(cherry picked from commit 694ff22961)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 17:16:38 +02:00
nina martinez ed337bfa08
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>
(cherry picked from commit 428d787526)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 17:13:41 +02:00
Nick Clemens 1c6e77f8e1
Bug 39180: Unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 17:01:23 +02:00
Nick Clemens 85ecabe2da
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: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 17:01:22 +02:00
Nick Clemens a1f10a1900
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: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 17:01:21 +02:00
Jonathan Druart ecfac4b43f
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>
(cherry picked from commit f3ca238092)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:43:31 +02:00
Jonathan Druart 6520ff3c5f
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>
(cherry picked from commit 3396a46c28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:41:30 +02:00
Jonathan Druart 46c7a66a6d
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>
(cherry picked from commit ddf1b9dfe3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:40:11 +02:00
Imani Thomas 63aa144d9b
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>
(cherry picked from commit bdefe52d46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:36:26 +02:00
Michael Hafen f002931186
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>
(cherry picked from commit 4afb657fe8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:35:32 +02:00
Aman Pilgrim 0cefc3ad2c
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>
(cherry picked from commit 4038fcb6e0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:14:35 +02:00
Janusz Kaczmarek 0dee174da3
Bug 40466: Zebra status misleading in "Server information" tab
After changes to about.pl the checking of the Zebra status has landed
in "sysinfo" section instead of "about". As a result "Zebra status"
always reports "Running" even if Zebra is off.

Test plan:
==========
1. Turn zebra server off (koha-zebra --stop kohadev) and check in
   "Server information" (More > About Koha) the "Zebra status" info.
   You will see "Running".
2. Apply the patch ; restart_all ; koha-zebra --stop kohadev
3. Check "Zebra status" in "Server information". You should see now:
   "Zebra server seems not to be available. Is it started?".

Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1835ced4c0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 35267ecfa8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:04:26 +02:00
Marion Durand cb7080f755
Bug 39896: Add UNIMARC support for AuthorLinkSortBy
This patch add support for AuthorLinkSortBy and AuthorLinkSortOrder in
the default UNIMARC XSLT files.

The description of the syspref is also slighly updated to hint users of
custom XSLT file about the need to update their template.

To test:
0. On a UNIMARC database
1. Set AuthorLinkSortBy to 'title' and AuthorLinkSortORder to
   'descending'
2. On the intranet and OPAC, search for an author you have multiple
   titles from and click on a result
3. Click on a link one a name for an author
4. Note a new search is performed, sorted by field from defaultSortField
   preference and not by title descending
5. Apply the patch
6. restart_all
7. Check that the syspref description now include a note about custom
   XSLT files
8. Repeat step 2 and 3
9. Note a new search is performed, sorted by title descending
10. Test other values - confirm links are updated in both staff and opac

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 4581e399bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fa9279644a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 16:02:26 +02:00
Owen Leonard 1f1fa1f58c
Bug 40222: Bootstrap popover components not updated for BS5
This patch corrects a couple of templates which include a Bootstrap
popover component, updating the data attributes which were missed during
the BS5 upgrade.

The patch also makes a minor change to CSS in order for the popover
heading to not have unwanted margins.

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

- Perform a catalog search in the staff interface.
- Add one or more items to the cart.
- Open the cart and hover your cursor over the "Items" heading. A
  popover should be triggered with a message about item sorting.
- Go to Administration -> Circulation and Fine rules.
- Edit a rule to add content to the "Note" field.
- Save the rule and then hover your cursor over the "View note" text.
  The note you added should appear in a popover.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eb1e00455e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c0f86a7598)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 15:47:11 +02:00
Owen Leonard 6406e0d1ea
Bug 38964: Fix column span in footer of staff interface account payment page
This patch fixes the column span in the table footer rows of the account
payment page (pay.tt). I've also added a couple of lines of CSS to style
the footer rows.

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

- In the staff client, locate a patron with charges.
- If necessary, go to a patrons "Accounting" tab and use the "Create
  manual invoice" page to add one or more charges to the account.
- Under the "Make a payment" tab there should be one or more footer rows
  including "Total due." The "Total due" cell should be aligned right,
  with a grey background.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 92c6516651)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-17 15:30:20 +02:00
Pedro Amorim 13815e483a
Fix 24.11.08 release db revision mode
This causes the following test to pass:
prove xt/find-misplaced-executables.t

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2025-09-02 16:34:22 +01:00
Tomas Cohen Arazi 51d7c30247
Bug 40579: Fix CSV formula injection vulnerabilities
This patch addresses CSV formula injection vulnerabilities by ensuring
all Text::CSV instances use formula protection.

Changes made:
* Add formula => 'empty' to all Text::CSV constructors in:
  - Koha::Patrons::Import
  - Koha::BackgroundJob::ImportKBARTFile
  - Koha::ERM::EUsage::CounterFile

The 'empty' formula mode causes potentially dangerous formulas (starting
with =, +, -, @) to be treated as empty strings rather than executed,
preventing CSV injection attacks while maintaining data integrity.

Security impact:
* Prevents execution of malicious formulas in CSV imports
* Protects against data exfiltration via CSV formula injection
* Maintains backward compatibility for legitimate CSV data

To test:
1. Apply the previous patch (author test)
2. Run:
   $ ktd --shell
  k$ prove xt/author/Text_CSV_Various.t
=> FAIL: Should show 3 files without formula protection
3. Apply this patch
4. Repeat 2
=> SUCCESS: All tests should now pass
5. Try importing CSV with formula content (=cmd|"/c calc",test,data)
=> SUCCESS: Formula content is rejected/emptied, not executed
6. Import normal CSV data
=> SUCCESS: Normal data imports correctly
7. Sign off :-D

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2025-09-02 16:34:19 +01:00
Tomas Cohen Arazi c4f97357c0
Bug 40579: Add author test for CSV formula injection protection
This test ensures all Text::CSV usage in Koha includes proper formula
injection protection to prevent CSV formula injection attacks.

The test scans all Perl modules and verifies that Text::CSV constructors
include the 'formula' parameter set to a safe mode ('empty', 'die',
'croak', 'diag', or numeric 1-5).

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove xt/author/Text_CSV_Various.t
=> FAIL: Test should fail showing files without formula protection:
   - Koha/Patrons/Import.pm
   - Koha/BackgroundJob/ImportKBARTFile.pm
   - Koha/ERM/EUsage/CounterFile.pm
3. Apply the follow-up patch to fix the violations
4. Repeat 2
=> SUCCESS: All tests should pass
5. Sign off :-D

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2025-09-02 16:34:16 +01:00
Pedro Amorim a1494d3c7b
Revert "Bug 40579: Fix CSV formula injection vulnerabilities"
This reverts commit 270271cf50.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2025-09-02 16:34:14 +01:00
Pedro Amorim 3db8386996
Revert "Bug 40579: Add author test for CSV formula injection protection"
This reverts commit 542651ae5c.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2025-09-02 16:34:07 +01:00
Mason James e83065df03
Bug 40731: Fix typo in Koha VERSION string for '24.11.08' release
no test plan attached

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-08-29 11:58:25 +00:00
Baptiste Wojtkowski d16bc1b5d9
Update release notes for 24.11.08 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-26 15:20:18 +00:00
Baptiste Wojtkowski dde48933a4
Increment version for 24.11.08 release
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-26 15:05:14 +00:00
Tomas Cohen Arazi 270271cf50
Bug 40579: Fix CSV formula injection vulnerabilities
This patch addresses CSV formula injection vulnerabilities by ensuring
all Text::CSV instances use formula protection.

Changes made:
* Add formula => 'empty' to all Text::CSV constructors in:
  - Koha::Patrons::Import

The 'empty' formula mode causes potentially dangerous formulas (starting
with =, +, -, @) to be treated as empty strings rather than executed,
preventing CSV injection attacks while maintaining data integrity.

Security impact:
* Prevents execution of malicious formulas in CSV imports
* Protects against data exfiltration via CSV formula injection
* Maintains backward compatibility for legitimate CSV data

To test:
1. Apply the previous patch (author test)
2. Run:
   $ ktd --shell
  k$ prove xt/author/Text_CSV_Various.t
=> FAIL: Should show 1 file without formula protection
3. Apply this patch
4. Repeat 2
=> SUCCESS: All tests should now pass
5. Try importing CSV with formula content (=cmd|"/c calc",test,data)
=> SUCCESS: Formula content is rejected/emptied, not executed
6. Import normal CSV data
=> SUCCESS: Normal data imports correctly
7. Sign off :-D

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
2025-08-26 14:48:21 +00:00
Tomas Cohen Arazi 542651ae5c
Bug 40579: Add author test for CSV formula injection protection
This test ensures all Text::CSV usage in Koha includes proper formula
injection protection to prevent CSV formula injection attacks.

The test scans all Perl modules and verifies that Text::CSV constructors
include the 'formula' parameter set to a safe mode ('empty', 'die',
'croak', 'diag', or numeric 1-5).

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove xt/author/Text_CSV_Various.t
=> FAIL: Test should fail showing files without formula protection:
   - Koha/Patrons/Import.pm
3. Apply the follow-up patch to fix the violations
4. Repeat 2
=> SUCCESS: All tests should pass
5. Sign off :-D

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
2025-08-26 14:48:20 +00:00
David Cook 9c159908d9
Bug 40538: Fix XSS in suspend hold modal
This patch fixes a XSS vulnerability in the
suspend hold modal in the staff interface.

By building our Javascript using Web APIs rather
than with strings and jQuery's html() method,
we're able to securely handle malicious payloads.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumber=29
2. Add a hold for "koha" patron
3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
4. Click "Holds" tab and click "Suspend"
5. Note the modal loads properly
6. Go to http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
7. Click "Holds" tab and click "Suspend"
8. Note the modal loads properly

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 40538: Simplify code

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2025-08-26 14:47:26 +00:00
Marcel de Rooy 326eff31da
Bug 39906: (QA follow-up) Feature needs to be enabled specifically
See also comment33, point 4.

Test plan:
cp debian/templates/apache-shared-opac-antibot.conf /etc/koha/
Test enabling/disabling by toggling the comment of the SetEnvIf line,
restart apache and remove the KOHA_INIT and CGISESSID cookie.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2025-08-26 14:17:01 +00:00
David Cook 79311c1567
Bug 39906: Add a simple quick Apache-level bot challenge
This patch adds a fast simple bot challenge via Apache.

To test:
0. Apply the patch
1. sudo cp debian/templates/apache-shared-opac-antibot.conf /etc/koha/.
2. sudo cp debian/templates/apache-shared-opac-plack.conf /etc/koha/.
3. curl http://localhost:8080/cgi-bin/koha/opac-search.pl
4. Note an instant response with a very simple HTML response
5. Open an incognito browser and go to http://localhost:8080/cgi-bin/koha/opac-search.pl
6. Note a very brief loading animation before the OPAC search page appearing
7. Do a search
8. Note no more loading animation appears
9. Close the incognito browser
10. Open an incognito browser and go to http://localhost:8080/cgi-bin/koha/opac-main.pl
11. Do a search via the "Library catalog" search bar
12. Note no loading animation appears

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Cornelius Hertfelder <cornelius.hertfelder@bsz-bw.de>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
We have tested this in production on at least three live sites for
several weeks, and it has worked as expected. We have not noticed any
negative side effects.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2025-08-26 14:16:52 +00:00
Nick Clemens 63e5e10bde
Bug 39301: pseudonymize_statistics.pl script generates too many background jobs
This patch changes the script to use 'Koha::PseudonymizedTransaction->new_from_statistic' directly
rather than calling 'Koha::Statistic->pseudonymize()' which generates a background job.

Additionally, some of the checks from 'pseudonymnize' and the background job are moved into the search
so we don't fetch any to pseudonymize that should not be.

To test:
 1 - Generate some entries in statistics (checkin, checkout, renew, etc)
 2 - Enable pseudonymization (see bug 28911 if you need bcrypt settings)
 3 - perl misc/maintenance/pseudonymize_statistics.pl -v -c
 4 - Statistics pseudonymized
 5 - Check the background jobs table, note jobs were generated
 6 - Apply patch
 7 - perl misc/maintenance/pseudonymize_statistics.pl -v -c
 8 - You get same count as before, and are warned of existing pseudonymized transactions
 9 - enter 'Y' to continue
10 - Check the pseudonymized_transacations table
11 - Confirm same rows were generated twice
12 - Check the background jobs
13 - Confirm there were no new jobs generated (for pseudonymization)

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 342c1d5993)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:58:29 +02:00
Lukas Koszyk 250c281198
Bug 38760: Add support for database connection encryption parameters in koha-mysql
The koha-mysql didn't work when the instance was set up to use an encrypted
database connection.

Please note: this testplan is for ktd, not for a production environment!

Unfortunately, there are some issues with the database TLS configuration in koha-testing-docker.
This is described comment 14 of bug 36026 (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36026#c14)

As a workaround, you can add "mysql_ssl_optional=1" in Koha/Database.pm.
See point (g) in comment 15 of bug 36026 (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36026#c15)

Testing Database Connection Encryption:
1. Apply the patch.
2. Configure koha-conf.xml to use a TLS connection
(see comment 10 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36026#c10, follow steps 3a-g + 4 )
3. Run:
koha-mysql <koha_instance>
4. Verify that the MySQL console opens successfully.
5. Check the encryption settings in the MySQL console:
- run:
SHOW VARIABLES LIKE '%ssl%';
- run:
STATUS;
Ensure that the following conditions are met:
- have_openssl and have_ssl are set to "YES".
- The SSL cipher in use is displayed.

Testing MySQL Timezone Configuration:
1. Apply the patch.
2. Configure the timezone in koha-conf.xml, for example:
<timezone>Antarctica/South_Pole</timezone>
3. Run:
koha-mysql <koha_instance>
4. Verify that the MySQL console opens successfully.
5. Check the timezone setting in the MySQL console by running:
SELECT @@session.time_zone;
6. Confirm that the output matches the timezone configured in koha-conf.xml.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 42ec5d36c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:30:20 +02:00
Marcel de Rooy 460bf24b3c
Bug 25015: (QA follow-up) Slide together
We do not need 1 or 0 here btw. We just check for true.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 663830d9ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:26:27 +02:00
Emily Lamancusa 1f86c52d55
Bug 25015: Allow staff with edit_items permissions to edit fast add items
To test:
1. Set up a user with only catalogue and edit_items permissions
2. Create a Fast Add record with item
    a. Go to Cataloging
    b. Click on Fast Cataloging
    c. Fill in mandatory fields and save the record
    d. Fill in mandatory item fields and click Add item
3. Log in as the user you set up in step 1
4. Search for the record you created in step 2
5. Click Edit > Manage items in the menu at the top of the record
==> You do not have permission to access this page!
6. Go back to biblio record page
7. Apply patch and restart_all
8. Click Edit > Manage items again
==> Edit items page loads normally
9. Make a few edits and confirm that they save correctly

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6bfcd23bdb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:26:19 +02:00
William Lavoie bd877d97f2
Bug 39596: Adding labels in the staff interface
Test plan:

1. Go to Administration > MARC Bibliographic framework
2. On the right side of the default framework, click on "Actions" >
   "MARC Structure"
3. Search for field 780
4. Click on "Actions" > "Edit subfields"
5. Click on the "t" tab
6. Check "Editor" under the "Visibility" section
7. Click on "Save Changes"
8. Repeat steps 1 to 7 for field 785$t
9. Have or create a record with a value for 780 and 785 with the first
   indicator at 0 and the other left empty
10. Look at the record on the staff interface and the OPAC
11. Notice that in Normal View, the values entered for 780 and 785 do
    not have labels
12. Apply the patch
13. There are now labels in the staff interface and the OPAC

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ba2ec1d202)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:19:02 +02:00
William Lavoie afd412fe3f
Bug 39596: Adding a label when the second indicator of MARC 780/785 is void
Test plan:

1. Go to Administration > MARC Bibliographic framework
2. On the right side of the default framework, click on "Actions" >
   "MARC Structure"
3. Search for field 780
4. Click on "Actions" > "Edit subfields"
5. Click on the "t" tab
6. Check "Editor" under the "Visibility" section
7. Click on "Save Changes"
8. Repeat steps 1 to 7 for field 785$t
9. Have or create a record with a value for 780 and 785 with the first
   indicator at 0 and the other left empty
10. Go see the record on the OPAC
11. Notice that in Normal View, the value entered for 780 and 785 do not
    have labels
12. Apply the patch
13. There are now labels

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a3bfa55919)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:19:01 +02:00
Phil Ringnalda 198be259e7
Bug 39570: Add item form includes itemnumber while adding a new item
Because the template uses the wrong op, add_item rather than cud-additem, to
decide whether to include a hidden input with the itemnumber, if you edit an
item and then add another item you wind up submitting a form that includes the
previous itemnumber when you add a new one. Nothing happens, because the code
for adding an item doesn't look at $input->param('itemnumber'), but since it
doesn't mean anything we shouldn't be submitting it.

Test plan:
1. Without the patch, find any biblio with at least one item attached, and
   in the items table click Edit item on one of them
2. Without needing to making any changes, click Save changes
3. In the page that loads, scroll down to the bottom of the Add item form,
   right-click the Add item button, and choose Inspect
4. A few lines up, above a '<fieldset class="action">,' there will be an
   '<input type="hidden" name="itemnumber" value="633">' with the itemnumber
   of the item you previously edited
5. Apply patch
6. Scroll up, click Actions - Edit on any item, then Save changes
7. Again, right-click the Add item button, Inspect, note that there isn't a
   itemnumber input with the number of the item you previously edited

Sponsored-by: Chetco Community Public Library
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bcc6c2175a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:15:10 +02:00
Janusz Kaczmarek dd7b1a75ad
Bug 39544: New > New record generates warnings in log
When creating a new record starting from Normal records view, by using
New > New record warnings in the log will be generated like:

[2025/04/03 12:45:33] [WARN] Use of uninitialized value $frameworkcode
in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 513.

Test plan:
==========
1. In staff interface, open any record in Normal view.
2. From upper menu chose New > New record.
3. Check the plack-intranet-error.log file, you should see fresh
   warnings with "Use of uninitialized value $frameworkcode".
4. Apply the patch ; restart_all.
5. Repeat p. 1.-3. No new warnings.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 70e43a0553)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 15:41:20 +02:00
Phil Ringnalda e1bf45c2ea
Bug 39409: Duplicate modifybiblio ids in cat-toolbar
The biblio details page Edit menu has three different elements which all
have id="modifybibilio", two of which also have another id. Neither of those
things is allowed.

Test plan:
1. Without the patch, load the details view for any biblio record and View
   source
2. Search for id="modifybiblio"
3. You will get three results, the second and third shown with id in red
4. Apply patch, reload the page, View source and search again
5. You will get one result, without any red

Sponsored-by: Chetco Community Public Library

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8251e854d4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 15:38:04 +02:00
Julian Maurice 9e1b923873
Bug 39298: (QA follow-up) Add missing html filter
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 45f8762c40)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:19:37 +02:00
David Cook 6b1d2440d8
Bug 39298: Add runtime parameter support to report templates
This change makes it so that you can provide runtime parameters
and use "Run with template".

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Create a report template. For example:
<table>
<tr><th>Transformed Biblionumber</th></tr>
[% FOREACH row IN data %]
<tr><td>Biblionumber [% row.biblionumber %]</td></tr>
[% END %]
</table>
2. Create a SQL report with a runtime parameter. For example:
SELECT biblionumber
FROM biblio
WHERE biblionumber > <<biblionumber>>
3. Run the report using "Run with template"
4. Specify a biblionumber of 1
5. Click "Run the report"
6. Note that the output is the template output and not regular
SQL output

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4daf0b7982)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:18:30 +02:00
Marcel de Rooy 714247f592
Bug 39226: (follow-up) Similar change for the cud-update branch
Resolve
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification

Test plan:
Update details for existing borrower.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7fb30a073e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:16:25 +02:00
Marcel de Rooy e9b4a1da3d
Bug 39226: Add borrowernumber 0 when creating patron modification
Test plan:
Test with and without this patch. Verify that you see no warn with Missing
value for primary key column anymore in plack-opac-error.
Enable self registration.
Register a new patron.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c7bdbf937c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:16:24 +02:00
Fridolin Somers 52cef274bd
Bug 39089: [24.11.x] Fix indenting
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:13:35 +02:00
Emily Lamancusa fc1e08119c
Bug 39089: (QA follow-up) Apply the same fix to from address and CC address
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0ab24fd216)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:11:30 +02:00
Lucas Gass e000268121
Bug 39089: Do not show an email address when the tranport type is print
To test:
1. Set a overdue trigger for print notice
2. Set up an overdue to be captured by overdue_notices.pl
3. Make sure the patron has an email address
4. Run overdue_notices.pl
5. Run gather_print_notices.pl
6. Now go to the patron's notice page (members/notices.pl?borrowernumber=x)
7. Find the print row for the overdue just generated.
8. See that under the 'Delivery note' it says "To: test@test.com".
9. APPLY PATCH
10. Try again, you should now see no "To:" field when the transport type is print
11. Make sure that when the transport type is anything but print, you do see it.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fdc7a8eb4a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:11:29 +02:00
Owen Leonard 7103751a10
Bug 38294: Fix layout of checkbox/label when editing search filters
This patch makes a minor markup change in order to improve the alignment
of controls for editing a search filter in the staff interface.

To test, apply the patch and make sure the SavedSearchFilters system
preference is enabled.

- In the staff client catalog, perform a search.
- At the top of the search results, click "Save search as filter".
- Fill out the form and save the search filter.
- Go to Administration -> Search filters.
- Click the "Edit search" button for your filter.
- You should be returned to the advanced search page and there should be
  an "Editing filter" form at the top. The "Show in OPAC" and "Show in
  staff interface" labels and checkboxes should be aligned neatly with
  the buttons in the toolbar.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b390be07fd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 12:05:44 +02:00
Nick Clemens 8fa13778c2
Bug 22458: Don't check for duplicate email on borrower self modification
This patch adds an extra variable to internal function CheckValidBorrower to set the
context as 'create' or 'update'

To test:
1 - Enable PatronSelfRegistrationEmailMustBeUnique
2 - Edit a patron in staff interface and set email to 'a@example.org'
3 - Open an incognito window and go to opac
4 - Self register a patron using email a@example.org
5 - You receive an error
6 - Use b@example.org for email
7 - No problem
8 - Sign in as the new patron
9 - Edit your information
10 - Set email to a@example.org
11 - You receive an error
12 - Apply patch, restart all
13 - Edit patron again
14 - No error!
15 - Register another patron on the opac
16 - Confirm still wanred if using a@example.org as the email

Signed-off-by: Allax Guillen <AGuillen@roseville.ca.us>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5cf5811d01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 11:08:39 +02:00
David Nind 5a8e5cefc4
Bug 31019: Fix broken links to UNIMARC field documentation
IFLA no longer provides field-level documentation pages for the UNIMARC
format (as at December 2024). It only provides:
- updates by year as individual PDFs (there may be multiple PDF updates
  for a field)
- a single consolidated PDF that is not yet endorsed by IFLA.

This patch updates the default UNIMARC field documentation links
to https://www.ifla.org/g/unimarc-rg/unimarc-updates/

It also:
- makes minor formating changes to improve consistency with the
  advanced editor:
  . the help link text is now [?], instead of ?
  . adds hover text for [?] - "Show help for this tag"
  . adds some additional spacing before the indicator fields
  . removes the '-' before the tag title
- updates the MarcFieldDocURL system preference description

Test plan:
1. Start up a Koha instance that uses UNIMARC (if using
   koha-testing-docker, change KOHA_MARC_FLAVOUR=unimarc in
   your .env file).
2. Set the EnableAdvancedCatalogingEditor system preference to "Enable".
3. Search for and edit any bibliographic record using the basic editor.
4. Click on the help text link (?) after any tag.
5. Note that you get an error:
   - Firefox: "The page isn’t redirecting properly"
   - Chrome-based browsers:
      "This page isn’t working
       archive.ifla.org redirected you too many times."
6. Switch to the advanced editor (Settings > Switch to advanced editor).
7. Click on a tag and then click the help link ([?]) at the bottom of
   the page.
   Result: You get the an error for the web page.
8. Switch back to the basic editor (Settings > Switch to basic editor).
9. Apply the patch.
10. Duplicate the tab and refresh the page for the record you
    were editing.
11. Click a help link for the basic editor - it now goes to a
    valid web page (https://www.ifla.org/g/unimarc-rg/unimarc-updates/).
12. Compare the basic editor page to the previously opened tab
    and note these differences:
    - the help link text is now [?], instead of ?
    - there is now hover text for [?]- "Show help for this tag"
    - there is some additional spacing before the indicator fields
    - there is no '-' before the tag title
13. Check that the page looks okay if the Settings > Show MARC
    tag document, and Show tags options are toggled off.
14. Switch to the advanced editor (Settings > Switch to advanced editor).
    If you click on the help link you now go to a valid web page.
15. View the updated description for updated MarcFieldDocURL system
    preference and check that it makes sense.
16. Enter a URL for the MarcFieldDocURL system preference, for
    example, https://example.com
17. Edit another record (using either the basic or advanced editor) and
    click the help link - it should take you to the web page you set for
    MarcFieldDocURL.
18. [Optional] Enter a custom URL pattern for the help documentation
    using {FIELD} (I don't know of any UNIMARC custom URL patterns).
19. Repeat the steps as appropriate for a MARC21 instance:
    19.1 Start up a MARC21 instance (change KOHA_MARC_FLAVOUR=unimarc
         on your .env file).
    19.2 The help links should take you to the Library of Congress MARC
         pages.
    19.3 Check that custom URL patterns continue to work, for example,
         use the Canadian custom URL pattern
         http://www.marc21.ca/MaJ/BIB/B{FIELD}.pdf
20. Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Mathieu Saby <mathsabypro@gmail.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9cebd54ab1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 11:03:05 +02:00
Jonathan Druart 906f743a17
Bug 39346: Display all additional fields
getAll should call getAll, not get, or we lose the _per_page=-1
parameter.

Test plan:
Have more than 20 additional fields for agreements
Create and agreement:
=> Notice that with this patch, all the fields are displayed.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 10:57:17 +02:00
Jonathan Druart fba6b70a67
Bug 39300: Fix quick edit of subfields
Searching tag$subfield in the framework should redirect to the edition
of the tag with the subfield tab selected.
This has been broken when we used the wrapper for tabs on bug 33178.

Test plan:
Edit a framework
http://localhost:8081/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=
Search for 952$c
=> You are redirected to the edition of 952 and the "c" tab is selected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b1efa3d71d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 10:52:23 +02:00
Martin Renvoize 83ae6fce2e
Bug 39209: Set cookie consent bar as first focus
This patch updates the cookie consent javascript, when the feature is
enabled, to ensure that the cookie consent bar gets focused when it
displays.

Test plan
1) Enable the CookieConsent preference
2) Open any OPAC page
3) Hit 'tab' and note the display of 'Skip to main content'
4) Confirm that the cookie consent bar is displayed and continued 'tabs'
   eventually navigate to it
5) Apply this patch
6) Navigate to any OPAC page
7) Hit 'tab' and note that the 'Cookie consent' bar is focused, your
   keyboard navigation starts with the cookie consent buttons
8) Accept the essential cookies
9) Hit tab and note the focus is back to normal and shows the 'Skip to
   main content' button on first keyboard navigation.

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

Amended-by: Jonathan Druart
Run tidy.pl

Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5426ae5bfd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 10:47:29 +02:00
Owen Leonard 85fc58e0f3
Bug 31167: Only mark due dates in the past red on overdues report
This patch adds information about whether an entry in the overdue report
is overdue so we can style dates accordingly. We can't assume that each
result is overdue because the report can be changed to include all
checked out items.

To test, apply the patch and go to Circulation.

- Check out to a patron.
- Use the "Specify due date" option to check out some items with due
  dates in the past, due dates today, and due dates in the future.
- Go to Circulation -> Overdues.
- You should see the items which have due dates in the past. The date in
  the "Due date" column should be red text. The "Checked out on" date
  should be regular text.
- In the sidebar, check the "Show any items currently checked out"
  checkbox and submit the form.
- You should now see all the items you just checked out. Only the
  overdue items should show their due date in red.

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: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 207cb59241)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 10:44:15 +02:00
phette23 d31c063d84
Bug 39260: Fix typo in acquisitions baskets API docs
To test:
- Go to /api/v1/.html#op-get--acquisitions-baskets-managers
- See 'possibe' misspelling
- Apply patch and revisit
- Spelling is fixed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8bf9368d75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 10:08:32 +02:00
Marcel de Rooy 40daccb7ae
Bug 39250: Add archive_purchase_suggestions.pl to cron.daily commented
It will be a commented line in the debian template and added also
in the crontab.example file.
As mentioned on BZ, the comment can easily be removed automatically
during Docker builds or startups etc.

Test plan:
Just read the patch. Nothing changes here actually.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2d93ec69bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 10:03:06 +02:00
Marcel de Rooy f6ec642559
Bug 39213: Force scalar on query param barcode
Test plan:
Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b816c790c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 10:00:06 +02:00
Fridolin Somers 453a8d5951
Bug 38149: [24.11.x] Fix tidy of ERM/Main.vue and place_booking.js 2025-08-08 09:59:20 +02:00
Fridolin Somers fa8575c33c
Bug 38149: [24.11.x] Update yarn.lock
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 07:56:06 +02:00
Stefan Berndtsson 18ccd7dc07
Bug 39467: Fix patron "View restrictions" link in messages
Currently nothing happens when clicking the "View restrictions" link
in patron messages. Using the bootstrap api to open it resolves the
issue.

To test:
1) Go to a patrons details page, click "Restrictions" and add amanual
   restriction.
2) A message with a "View restrictions" link should appear.
3) Clicking this link does not open the "Restrictions" tab as it should.
4) Apply patch
5) Now this "View restrictions" link should open the "Restrictions" tab

Sponsored-by: Gothenburg University Library
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1c3bc68e9c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-07 15:04:11 +02:00
Andrew Fuerste Henry cd11bd3e52
Bug 39258: Remove extra nonfunctional Delete button from report preview modal
To test:
1 - save a report
2 - click Preview SQL for that report from the Saved Reports page
3 - see there are two delete buttons
4 - apply patch, reload page
5 - now there is one delete button
6 - confirm that delete button gives a confirmation message and then deletes the report

7 - Install a second language for the intranet
8 - switch to that language and confirm you have just 1 delete button, it is translated, and it works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47647a687e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 17:16:34 +02:00
David Cook bcf215eb46
Bug 39392: Fix typos in atomicupdate README
This just fixes some typos in the automicupdate README.
There's nothing to test. Just need to review it.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Makes sense as far as I can tell.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 18ec3f5c86)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 17:14:22 +02:00
Petro Vashchuk a5d485a5ed
Bug 37832: Fix Rental discount to be decimal like other similar fields
Added decimal input_mode and pattern for "Rental discount (%)" so it functions same way as "Fine amount" or "Overdue fines cap (amount)" rules, allowing user to save decimals only.

1. Go to Circulation and fine rules page and save some gibberish into "Rental discount (%)", see that it allows you to do that.
2. Apply the patch, and try same thing again, this time it should only allow you to save decimal numbers.

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 143220d0c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 17:14:22 +02:00
Marcel de Rooy 6b1902b0b3
Bug 29410: Resolve warn on numeric ne for two dates
Simply, remove the !=0 test. Test for true.

Test plan:
Restart SIP.
Ask item info (SIP 17) on a waiting hold. It must have a
hold pickup date.
Check that warn disappears with this patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f63feea8c6)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 15:07:37 +00:00
Kyle M Hall 722d2457f6
Bug 39214: Mock preferences in t/db_dependent/Koha/Session.t for subtest 'test session driver'
The "test session driver" unit test assume SessionStorage is set to MySQL and will fail if it is set to anything else. We should mock the values, and test the other supported values.

Test Plan:
1) Set SessionStorage to File
2) prove t/db_dependent/Koha/Session.t
3) Note test failure
4) prove t/db_dependent/Koha/Session.t
5) Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b66ccc1258)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 15:07:37 +00:00
Emily Lamancusa 0f2bb78f66
Bug 39185: Don't add select option if priority is 0
To test:
1. Place several holds on a biblio record
2. Check in items from that record and confirm some (but not all) of the
    holds
3. View the current holds on that record
4. Click on the drop-down to change the priority of a hold
--> Note that the drop-down contains one or more "0" options - one for
    each in-transit or waiting hold
5. Apply patch and refresh the page
6. Click on the drop-down again
--> The drop-down now contains the correct options
7. Use the drop-down and the "Update holds" button to change hold
    hold priorities a few times
--> Confirm that the priority is updated correctly

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6dee4899d6)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 15:07:36 +00:00
Baptiste Wojtkowski db864c5ac5
Revert "Bug 38770: Remove @vue/cli-service and babel"
This reverts commit 7d455fac3d.
2025-08-06 15:07:36 +00:00
Baptiste Wojtkowski 9e1e15d111
Revert "Bug 38770: Update yarn.lock"
This reverts commit 5d8a100f64.
2025-08-06 15:07:35 +00:00
Katrin Fischer 583af18e71
Bug 39374: DBRev 24.11.07.002
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 59ced52d8b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 16:37:42 +02:00
David Cook 8dc32074ac
Bug 39374: Database changes
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d53f82ce88)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 16:32:59 +02:00
David Cook 0dd9e87ec9
Bug 39374: Add feature to block sending of lists from OPAC
This change adds a system preference OPACDisableSendList which
disables the ability to send lists from the OPAC, and hides the
"Send list" link on the opac-shelves.pl page.

This is useful in situations where you do not want OPAC users to be
able to generate emails to arbitrary addresses with arbitrary comments.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Create a public list with at least one record and view it in the OPAC
2. Click "Send list" and note you can fill out boxes for "Email address"
and "Comment"
3. Change syspref OPACDisableSendList to "Don't allow" and click "Send list"
again
4. Note the popup window now says "You do not have permission to send this list."
5. Reload the list web page and notice "Send list" no longer appears on the toolbar
next to "Print list"

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8e9a3d851d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 16:32:58 +02:00
Martin Renvoize 1c86e7ed91
Bug 39447: Update mailmap to reflect PTFS-Europes rename
PTFS Europe is now officially Open Fifth

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>

Bug 39447: (follow-up) Corrections to existing mappings

I thought it worked through from top to bottom and thus the lower down
mappings would correct the higher up ones.. I was mistaken, thanks
Jonathan for pointing that out

Test with:

1. `git shortlog --summary --numbered --email | grep ptfs-e`
2. `git shortlog --summary --numbered --email | grep openfifth`

Amended-by: Jonathan Druart
Space adjustements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 38d9b0d110)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 16:32:58 +02:00
Katrin Fischer 1ff8bba972
Bug 39508: Add newly supported source codes to system preference description
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 807ba16eb1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 16:32:57 +02:00
Janusz Kaczmarek f3fe5adbcd
Bug 39508: With OPACAuthorIdentifiersAndInformation, make ISNI and Wikidata identifiers be displayed correctly
At the current, when OPACAuthorIdentifiersAndInformation is on, ISNI
and Wikidata entries in authority 024 field generate empty bullets.

Test plan:
==========
1. Turn OPACAuthorIdentifiersAndInformation on for Identifiers.
2. Edit an authority record adding 024 field(s) for wikidata / ISNI,
   e.g.:
   024 7_ $a 0000000120967858 $1 https://isni.org/isni/0000000120967858 $2 isni
   024 7_ $a Q859 $1 http://www.wikidata.org/entity/Q859 $2 wikidata
3. Go to a linked bibliograohic record in OPAC and see the 'Author
   information' tab. There should be empty bullets under author's
   name.
4. Apply the patch ; restart_all
5. Repeat p. 3. The bullets should be followed by a description and
   link.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 658d2fe0d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-06 16:32:57 +02:00
Katrin Fischer 4ee083b3c2
Bug 38794: DBRev 24.11.07.001
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-08-06 14:19:53 +00:00
Nick Clemens 658826f67c
Bug 39186: Update styling of Cancel marked holds button
This patch adds btn and btn-primary classes

To test:
1 - Place a hold for a patron
2 - View the patron's record in staff interface
3 - CLick the holds tab
4 - Note 'Cancel marked holds' is gray, other buttons are yellow
5 - Apply patch
6 - Reload, button is yellow

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 70cb30ee6e)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 14:06:44 +00:00
William Lavoie 068fc6dfb5
Bug 39035: Adding print media query to hide cookie permissions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 20587212a3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 14:06:26 +00:00
Matthias Meusburger 3f33506873
Bug 38658: Display message for expired patrons in SIP when NotifyBorrowerDeparture is disabled
This patch restores the behavior that existed in SIP before Bug 25813 - Enhance patron expiration in SIP display:
Always consider an expired patron as expired, even if NotifyBorrowerDeparture is set to 0 (disabled) or unset.

Test plan:

 - Set NotifyBorrowerDeparture to 0

 - Set a patron's expiry date to be in the past

 - Use misc/sip_cli_emulator.pl to display patron information:
   perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR --patron <cardnumber> -m patron_information

 - Check that you have the following message (AF field):
 "Greetings from Koha. Your account has expired as of <expired date>"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47c3527af3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 14:06:00 +00:00
David Cook 379ff3a443
Bug 39144: Remove second call to opac.css
This change removes an unnecessary second call to opac.css on
the opac-virtual-card.pl page.

Test plan:
1. Set OPACVirtualCard syspref to Allow
2. Add an obvious change to OPACUserCSS syspref ( body {background-color: pink;} )
3. Switch to the OPAC, notice the CSS is in effect
4. Log in and go to 'Your account' then 'My virtual card' from the menu on the left
5. Notice the custom CSS affects the virtual card page too

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c217ad2f25)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:46:31 +00:00
Katrin Fischer 5d8a100f64
Bug 38770: Update yarn.lock
Also includes changes from bug 38149.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7469403a01)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:45:50 +00:00
Victor Grousset/tuxayo 7d455fac3d
Bug 38770: Remove @vue/cli-service and babel
And the webpack related dead config.

Test plan:
1. Do not apply
2. Switch to node 22
     sudo sed 's/18.x/22.x/g' -i /etc/apt/sources.list.d/nodesource.list
     sudo apt update ; sudo apt install nodejs
3. Try to install node deps
     sudo yarn install --modules-folder /kohadevbox/node_modules
4. It fails
     error @achrinza/node-ipc@9.2.5: The engine "node" is incompatible with this module.
     Expected version "8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 || 18". Got "22.12.0"
5. Apply patches
6. Try to install node deps
     sudo yarn install --modules-folder /kohadevbox/node_modules
7. It works! :)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4dbe67f6f2)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:45:50 +00:00
Baptiste Wojtkowski 50d8168ac1
Bug 39148: Correct sort by publicationdate in OPAC lists
Test plan (UNIMARC):
1 - Create a list with different publicationdates, chose to sort it by
  copyright gate
2 - Go to the list in the OPAC -> it is not correctly sorted
3 - Pick sort order: copyright date -> not correctly sorted
4 - Apply patch
5 - Retry 2&3 and see it works

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e398743e06)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:38:38 +00:00
Baptiste Wojtkowski bd41df01a0
Bug 39124: In lists dropdown, the option "view all" is always displayed
In the code of the OPAC, the "Lists" dropdown menu is supposed to
display max. 10 lists and display a button "view all" if there are more
than 10 lists.

The button "view all" is always displayed and it is weird when there
are few lists because "Public lists" and "Your lists" do the same.

Test plan:
1 - On an OPAC with less than 10 public lists and 10 private lists,
    navigate to /cgi-bin/koha/opac-shelves.pl, click on the dropdown see
    there is a view all button for both types of lists
2 - APPLY PATCH
3 - Repeat 1, notice the buttons disappeared
4 - Create lists so there are >10 public and >10 private lists
5 - Repeat 1, notice the buttons reappeared

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 88a292af36)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:36:51 +00:00
Owen Leonard e46b444ac0
Bug 39078: Fix incorrect variable checks in course reserve details template
This patch adds some variable checks and corrects some others so that
the course reserve detail template doesn't show empty parentheses.

To test, apply the patch and create a course if necessary.

- Add an item to the course.
- After submitting a barcode, check the checkbox next to each option and
  select a different value (item type, collection, etc.).
- View the course details and check the columns for the fields you
  changed. They should display the correct information:
  "Updated field value (Original field value)"
- Add another item but this time don't change any options. The
  information should be display as:
  "Unchanged (Original field value)"
- There should be no instances where it looks like:
  "Field value ()"

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 753659589a)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:36:13 +00:00
Nick Clemens a098e0079a
Bug 39038: Grep for exact matches for collapsed fields
This patch splits the CollapseFieldsPatronAddForm system preference
into a list in the template and then uses grep to find exact matches
for each field.

Test plan:
1. Edit CollapseFieldsPatronAddForm system preference and
   check the Non-patron guarantor and a few other fields, but
   not Guarantor.
2. Go to add a patron that can have a guarantor.
3. Note both guarantor fields are collapsed.
4. Apply patch, reload/
5. Note only expected fields are collapsed.
6. Confirm other fields continue to work as expected.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c6c36aa870)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:31:20 +00:00
Janusz Kaczmarek 6b17dd001d
Bug 39012: Koha fails to import default MARC bibliographic framework
Test plan:
==========
1. In Administration > MARC bibliographic, from framework  menu on the
   right, prepare a csv file with framework export.
2. Try to import the fili into Default framework.
3. This should fail, with a redirect to a strange looking page, and
   with lots of errors in the logs.
4. Apply the patch ; restart all.
5. Repeat p. 2. You should succeed and you should be able to see the
   differences in the framework (if you exported from a different
   framework).

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 82707f469e)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:27:58 +00:00
Owen Leonard ffcc2a5a9f
Bug 39053: Add page-section div to reports results pages
This patch adds a "page-section" wrapping div around reports results
pages where it is missing.

Note: This patch contains indentation changes.

To test, apply the patch and test the following reports, confirming that
the results page looks correct:

- Patrons with the most checkouts
- Acquisitions statistics
- Patrons with no checkouts
- Patrons statistics
- Most-circulated items
- Catalog statistics
- Average loan time
- Circulation statistics
- Lost items
- Catalog by item types
- Holds statistics

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bf1e45e490)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:27:22 +00:00
Tomas Cohen Arazi 38460cbd40
Bug 35246: Make Koha::Biblio->to_api throw relevant exception if no biblioitem row
This patch makes the `to_api()` method return an proper exception when
the `$self->biblioitem` accessor returns `undef`. This is a bad data
scenario and we could do better in terms of logging the situation.

The new exception will be correctly rendered in the logs by the
`unhandled_exception` Mojolicious helper and no behavior change on the
API.

I wasn't sure to keep the api tests I wrote. I originally added handling
for the specific exception in the controller, but it become obvious it
was not worth: too much code, the `GET /biblios` endpoint would need the
same treatment, etc. And the current `500 Internal server error` is good
enough as a response, and the logs explain the situation correctly.

To test:
1. On a fresh `KTD` pick a biblio (say biblionumber=1)
2. Use your favourite REST tool (Postman?) to access the record with
   `Accept: application/json`. i.e.

```
GET kohadev.localhost/api/v1/biblios/1
Accept: application/json
```

=> SUCCESS: All good
3. Delete the related `biblioitems` row:
   $ ktd --shell
  k$ koha-mysql kohadev
   > DELETE FROM biblioitems WHERE biblionumber=1; \q
4. Repeat 2
=> SUCCESS: You get a 500 error
5. Check the logs
=> FAIL: You get a cryptic message about accessing a method on an
undefined object:

```
2025/02/13 13:15:00] [ERROR] GET /api/v1/biblios: unhandled exception (Mojo::Exception)<<Can't call method "to_api" on an undefined value at /usr/share/koha/Koha/Biblio.pm line 1433.>>
```

6. Apply this patch
7. Restart things:
  k$ restart_all
8. Repeat 2
=> SUCCESS: You get a 500 error
9. Check the logs
=> SUCCESS: You get a more meaningful exception:

```
[2025/02/13 13:20:00] [ERROR] GET /api/v1/biblios/1: unhandled exception (Koha::Exceptions::RelatedObjectNotFound)<<Exception 'Koha::Exceptions::RelatedObjectNotFound' thrown 'The requested related object does not exist' with accessor => biblioitem, class => Koha::Biblioitem>>
```

10. Run the tests:
  k$ prove t/db_dependent/Koha/Biblio.t \
           t/db_dependent/api/v1/biblios.t
=> SUCCESS: They pass!
11. Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 03ae61e9f8)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:25:37 +00:00
Tomas Cohen Arazi c2b6c757e6
Bug 35246: Unit tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2215edce1)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:25:36 +00:00
Jonathan Druart fa24ffce09
Bug 39088: Correctly prefix url with protocol when OPACURLOpenInNewWindow on the OPAC result page
There is certainly something better to do as the xsl for the OPACDetail
is calling it only once, but it needs more work.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ccc66e682b)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:23:48 +00:00
Lucas Gass 00cc5c02a8
Bug 39040: Add CSS back via _tables.scss
To test:

1/ Turn on POS
2/ Enable Cash registers
3/ Configure some items for sale
4/ Make some POS transactions
5/ Visit pos/register.pl?registerid=x
6/ Notice the problem described
7/ APPLY PATCH and regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface )
8/ Look at the table again. The rows should now be correctly highlighted.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3cc9282e7b)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:23:18 +00:00
caroline 20b794916e
Bug 39032: "Items selected" in item search untranslatable
This patch corrects a syntax error that prevented the string
"Items selected" from being picked up by the translation tool.

To recreate:

1. Go to Item search

2. Click 'Search'

3. Select one or more results
   --> In the bar at the top of the results there is a rectangle with "Items selected: N XClear"

4. Install another language (e.g. fr-CA)
   4.1. For ktd, do the following commands

        ktd --shell
        gulp po:update --lang fr-CA

        Ctrl+D (exit shell)

        ktd --root --shell
        koha-translate --install fr-CA --dev kohadev
        koha-translate --update fr-CA --dev kohadev

   4.2. Go to Administration > System preferences
   4.3. Search for StaffInterfaceLanguages
   4.4. Check fr-CA
   4.5. Click 'Save all I18N/L10N preferences'

5. Redo steps 1-3 in French
   --> "Items selected" is not translated

6. Apply patch

7. Update translations
   (for ktd)
   ktd --shell
   gulp po:update --lang fr-CA

8. Open misc/translator/po/fr-CA-staff-prog.po

9. Search for "Items selected"
   --> It should be there, with a fuzzy flag

10. Translate the phrase in msgstr and remove the line with the fuzzy flag

11. Apply translations
    (for ktd)
    ktd --root --shell
    koha-translate --update fr-CA --dev kohadev

12. Redo steps 1-3 in French
    --> "Items selected" is now translated!

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8ef667a0b4)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:22:52 +00:00
Owen Leonard 7d8b013c9c
Bug 39051: Fix submit button class on cash register statistics page
This patch corrects the class of the submit button on the cash register
statistics page. Bug 32091 added the "btn btn-default" class but it
should have been "btn-default."

To test, apply the patch and go to Reports -> Cash register statistics.

The submit button should have the yellow "primary" button color.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Button is now yellow.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ab3e951c9c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:10:32 +00:00
Owen Leonard 06dd1b11f9
Bug 39050: Duplicate "type" attributes in ill-batch-modal.inc
This patch removes duplicate "type" attributes from two inputs in
ill-batch-modal.inc.

I don't know how to test this, but a visual inspection of the changes
should be enough.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Makes sense
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8d162ec366)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:09:44 +00:00
Owen Leonard f836b03d2c
Bug 39021: Fix badly formatted dropdown on patron account transactions page
This patch makes minor markup changes in order for the "Email" menu item
to be styled correctly after the Bootstrap upgrade. The patch also
simplifies the submission of the form by removing unnecessary JS event
handling.

To test, apply the patch and locate a patron record to view.

- Open the "Accounting" tab
- Click "Create manual invoice"
- Put a charge on the patron's account and click "Save and pay"
- Pay the charge
- Click "Transactions"
  - In the "Actions" column there should be a "Receipt" menu.
  - The "Email" item should be correctly formatted, matching the "Print"
    entry.
  - Clicking "Email" should result in the page refreshing, with the
    message "Receipt sent" at the top.
  - If you don't have email set up you can confirm that the message was
    queued by creating an SQL report: "SELECT * FROM `message_queue`"
  - The report should show the message with the receipt you emailed.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fbec80904f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 13:06:18 +00:00
Jonathan Druart df2c94173e
Bug 38823: Fix translatability for 'Reports' in ERM menu
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Confirmed that "Reports" is now treated the same way as every
other "title" in the file.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3b207c44cc)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 12:56:56 +00:00
Marcel de Rooy 2a0b5d6b7a
Bug 37650: (follow-up) Remove FIXME around CheckReserves call
The FIXME correctly stated that the CheckReserves call and follow-up
only should be executed within the cancel hold scope.

NOTE: Actually, I do not see how to trigger it in current code. Since
checking in a waiting hold triggers the NotIssued error. And the
cancel hold button is not available for holds in queue.

Test plan:
Place a hold on an item.
Checkin at pickup location. Confirm. Hold waiting now?
Try again but checkin at another branch. Transfer triggered?

The hard part (see my note). Try to get at the form where you can
cancel the hold (waiting or first in queue).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 99b7f5635c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 12:55:16 +00:00
Marcel de Rooy 03ca11061b
Bug 37650: Add lookahead days in CheckReserves call in returns.pl
Test plan:
Enable future holds. Put a positive value in ConfirmFutureHolds.
Add a hold for tomorrow and pickup at B. Check item in at A.
Confirm hold.

Without this patch you should see a warn on L186:
  [WARN] Use of uninitialized value in string ne at /usr/share/koha/circ/returns.pl line 186.
With this patch, you should not see it anymore.

NOTE: Before bug 34972 no transfer was created for future holds.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2f0659b1b2)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 12:54:14 +00:00
Petro Vashchuk dbdd068de6
Bug 32949: Fix wrong input id
The input id was wrong, so instead "else" was handling the flatpickr data
as plain text, which prefilled junk data and therefore resetting value of
"Hard due date" field to "None defined".

To reproduce:
1. Head over to the smart rules admin page and create/use existing rule
for certain item type/category.
2. Set "hard due date" that rule to a certain date and save.
3. Edit that same rule again, but this time save it without any
changes. Do not click or interact with flatpickr field.
Date for hard due date will get lost and will be set as "None defined".
4. Apply the patch.
5. Repeat steps 2 and 3. Ensure that the data loss is not happening
anymore.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed test plan, works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9d63fa8130)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 12:53:28 +00:00
Nick Clemens 5c19a6ec46
Bug 39022: Display the current previous patron list before updating stored values
This patch just reverses the order so we display the list, then update it.

To test:
 1 - Enable showLastPatron system preference and set showLastPatronCount to 1
 2 - Go to a patron, say Ronnie Ballard
 3 - Note you have a link to 'Last patron' - hover or click split dropdown and see it is the patron you are viewing
 4 - Search for another patron, Edna Acosta
 5 - Note the 'Last patron' links point to Edna, and not Ronnie
 6 - Apply patch
 7 - Reload Edna, note last patron lists Edna
 8 - Search for Ronnie
 9 - Confirm previous patron is linked to Edna
10 - Click the link to go to Edna
11 - Confirm last patron now links to Ronnie
12 - Instead of following link, click on another tab for patron
13 - Now the link is updated to current patron, this was behaviour before 21246 as well
14 - Sign off.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 58ec1ed304)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 12:50:56 +00:00
Tomas Cohen Arazi 239bf27934
Bug 38988: Make the polling use case be normal in about page
This patch makes choosing `polling` for the `JobsNotificationMethod`
system preference not be considered problematic or different than
`STOMP`.

To test:
1. In `KTD` make sure you have `STOMP` selected
2. Make sure rabbitmq is running:
   $ ktd --shell
  k$ sudo -s
   $ service rabbitmq-server start
3. Go to the about page, 'Server information'
=> SUCCESS: 'Using RabbitMQ' displayed
4. Stop rabbit
   $ service rabbitmq-server stop
5. Repeat 3
=> SUCCESS: Using Rabbit but fallback to polling
6. Go to the 'System information' tab
=> SUCCESS: Error message about the broker not functional
7. Choose 'polling'
8. Repeat 3
=> FAIL: It says 'Using SQL polling' but in bold face <.<
9. Repeat 6
=> FAIL: There's an error about the broker, which we explicitly asked
not to use <.<
10. Apply this patch
11. Repeat 3
=> SUCCESS: Nothing weird, 'Using SQL polling' displayed.
12. Repeat 6
=> SUCCESS: No weird error about the broker.
13. Switch to 'STOMP'
=> SUCCESS: Behavior is the same with/without rabbit running
14. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9cbc606697)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 12:48:52 +00:00
Jonathan Druart 5f5d0064aa
Bug 39000: Restore bg-danger color
In ktd 369 will show the "Encoding error" block:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=369

The background color has changed this the bootstrap update and now looks
ugly.

This patch reuse the same color (#f2dede) we had before the upgrade

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a24b67031)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 10:17:55 +00:00
Nick Clemens 6a56911595
Bug 34971: (QA follow-up) Op is now cud-reopen
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9a1e7654e5)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 10:16:37 +00:00
Baptiste Wojtkowski 734f64dc35
Bug 34971: Fix permission to close a serial subscription (edit)
Note: there is a minor bug I had to correct, I don't split into two
patches since it is very minor and necessary to test that one.

Patch 1 - (this one) When a user is on serial collection information, the subscription is
not passed to the template, and therefore not passed to serials-toolbar.inc.
This makes sense if collection information is called with a biblionumber
but not if collection information is called with a subscription id.
Consequently, subscription.closed is always false and it is not possible
to reopen a basket.

Patch 2 - User with incorrect permission can close serials, they just
need to access to the page. This is due to serials-toolbar.inc expecting
a variable named "cannotedit", which is provided by
"subscription-details.pl" and not by "serials-collection.pl"

TEST PLAN:
Before applying patches :
1 - log in as a user with only receive_serial permission
2 - Open two pages one on
  /serials-collection.pl?subscriptionid=ID_A, another on
  /serials-collection.pl?subscriptionid=ID_B
3 - On serial A's collection page, check you can close the serial (wrong
  behaviour), note you can close it again but not reopen it
4 - Apply first patch
5 - Check you can reopen the serial (wrong behaviour) keep the page open
6 - On serial B's collection page, close the serial, keep the page open
7 - Apply second patch
8 - On page left open on 3 -, click on close, you are redirected to a
  login page.
8 - Go back to serial A's collection page -> there is no close button
  anymore
9 - On page left open on 4 -, click on reopen, you are redirected to a
  login page
10 - Go back to serial B's collection page -> there is no close button
  anymore

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7298dc064f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 10:16:37 +00:00
Baptiste Wojtkowski 540c239e49
Bug 34971: Fix reopen button display on serial-collection
Patch 1 - (this one) When a user is on serial collection information, the subscription is
not passed to the template, and therefore not passed to serials-toolbar.inc.
This makes sense if collection information is called with a biblionumber
but not if collection information is called with a subscription id.
Consequently, subscription.closed is always false and it is not possible
to reopen a basket.

Patch 2 - User with incorrect permission can close serials, they just
need to access to the page. This is due to serials-toolbar.inc expecting
a variable named "cannotedit", which is provided by
"subscription-details.pl" and not by "serials-collection.pl"

TEST PLAN:
Before applying patches :
1 - log in as a user with only receive_serial permission
2 - Open two pages one on
  /serials-collection.pl?subscriptionid=ID_A, another on
  /serials-collection.pl?subscriptionid=ID_B
3 - On serial A's collection page, check you can close the serial (wrong
  behaviour), note you can close it again but not reopen it
4 - Apply first patch
5 - Check you can reopen the serial (wrong behaviour) keep the page open
6 - On serial B's collection page, close the serial, keep the page open
7 - Apply second patch
8 - On page left open on 3 -, click on close, you are redirected to a
  login page.
8 - Go back to serial A's collection page -> there is no close button
  anymore
9 - On page left open on 4 -, click on reopen, you are redirected to a
  login page
10 - Go back to serial B's collection page -> there is no close button
  anymore

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 268d725eab)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 10:16:36 +00:00
Paul Derscheid 02c12af332
Bug 38167: (QA follow-up) Remove old, add new eslint config to Makefile.PL
To test:
1) Run t/Makefile.t, observe failure
2) Apply patch
3) Run t/Makefile.t, observe success

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f82919adb3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:05 +00:00
Victor Grousset/tuxayo 802550555b
Bug 38167: Migrate ESLint config to new flat format
Test:
1. Do not apply
2. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js
3. It should fail
4. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js
5. It should work
6. Apply patches
     BZ38700 will conflict with BZ38149 on yarn.lock
     solve conflict with
     sudo yarn install --modules-folder /kohadevbox/node_modules
     git bz apply --continue
     git will only continue for 38700 and don't actually apply this (38167)
     So retry
     git bz apply 38167
     Don't apply the dependecies are they are already there.
     This time you're good :)
     (the conflict can't be durably solved because 38770 need to be
     applied independently or with BZ38149 depending on what other bug
     needs to be tested :/ )
7. Restart KTD to have a clean state of dependencies and check that
   provisionning still works.
8. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js
9. It should fail
10. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js
11. It should work

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e83a605f25)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:04 +00:00
Jonathan Druart a6fb64dd0f
Bug 38149: Adjust tidy of some vue and js files after prettier upgrade
Fix xt/js_tidy.t and xt/vue_tidy.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 04aa82aa23)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:04 +00:00
Victor Grousset/tuxayo cf56237f6a
Bug 38149: Add ESLint & prettier to package.json
And upgrade eslint-plugin-prettier

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3961a3fa55)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:03 +00:00
Victor Grousset/tuxayo 3496beb29e
Bug 38149: Make ESLint config compatible with version 9
Test plan
1. Apply patch
2. Start KTD (to check that stuff is installed automatically)
3. Run this:
   ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js
4. You should see errors from prettier in addition to others

QA notes:
1. Run this:
   yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier
2. See that the version are the latest from NPM website
3. See that they are in devDependencies

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9a40d4418c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:03 +00:00
Owen Leonard 4657512d20
Bug 38773: SMTP server is not showing on the library detail page
This patch fixes and incorrect template variable name, making it
possible to see a library's SMTP server when viewing the details of an
individual library.

Test plan copied from the original bug report:

1. Create an SMTP server in Koha (it doesn't need to be valid)
   a. Go to Administration -> Additional parameters -> SMTP servers
   b. Click "New STP server"
   c. Fill all mandatory fields (it doesn't need to be valid
      information)
   d. Click "Submit"

2. Add the created SMTP server to a library
   a. Go to Administration -> Basic parameters -> Libraries
   b. Choose a library and click on Edit (in column "Actions")
   c. On the line "SMTP server" select the server created
   d. Click "Submit"

3. Check the display
   a. Go to Administration -> Basic parameters -> Libraries
   b. Check that the name of the SMTP server you just selected is
      displayed in the column SMTP server
   c. Click on the name of the library you modified
   d. Check that the line "SMTP server" shows the correct information.

4. Test with different permissions
   a. If the logged-in user has both 'manage_libraries' and
      'manage_smtp_servers' permissions the SMTP server name should be
      liked to the edit form for that server.
   b. If the logged-in user has only 'manage_libraries' permission there
      should be no link.

Signed-off-by: Bo Gustavsson <bosse@gustavsson.one>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1a71b5f70e)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:03 +00:00
David Cook b187f281b6
Bug 38998: Only show Edit link for DB default SMTP server
This change only shows the "Edit" on the smtp_servers.pl page
for the "Current default configuratio" if the default
configuration can be edited. That is, don't show it when
config comes from the code, and do show it when the config
comes from the database.

Test plan:
0. Apply the patch
1. Go to /cgi-bin/koha/admin/smtp_servers.pl
2. Ensure you delete any SMTP servers you've defined
3. Note that there is no "Edit" button at the bottom of
"Current default configuration"
4. Click "New SMTP server" and create a new default server
5. Go to /cgi-bin/koha/admin/smtp_servers.pl
6. Notice how now there is an "Edit" link at the bottom of
"Current default configuration"

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan, works as advertised.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 322072a4bb)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:02 +00:00
Adolfo Rodríguez 7833a89b83
Bug 38515: Keep serial notes when generating next serial.
This patch prevents the loss of notes in serials when generating next serial

Test plan:
1 Create a subscription, fill the notes field for the serial with Expected status and activate the system preference PreserveSerialNotes
2 Click Generate next
3 Check that the notes from the now Late serial are gone and that the new serial doesn't have notes.
4 Apply patch, restart services
5 Edit the serial with Expected status to fill the notes field.
6 Click Generate next
7 Check that the notes from the now Late serial are kepts and that they have been copied to the new serial.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 117b7eb0eb)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:02 +00:00
Jonathan Druart 311ba8e039
Bug 38900: Provide info about the problematic strings
The translation script explodes without meaningful error when
"incorrect" structure is found (edit)

Found when working on bug 38714, the translation script can break with
an error that does not directly point to the problematic string

[13:00:23] Error: Command failed: misc/translator/xgettext.pl --charset=UTF-8 -F -o /tmp/koha-2rwDEm/Koha-opac-bootstrap.pot -f /tmp/koha-2rwDEm/files
Can't use an undefined value as a HASH reference at misc/translator/xgettext.pl line 131.

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:552:15)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5)
    at Process.callbackTrampoline (node:internal/async_hooks:128:17)
[13:00:23] 'po:update' errored after 992 ms

Test plan:
0. Use main and confirm that `gulp po:update --lang LANG` returns
   successfully
1. Apply the first patch
=> The error is
Can't use an undefined value as a HASH reference at misc/translator/xgettext.pl line 131, <$INPUT> line 80.
2. Apply this patch
=> The error is now:
Incorrect structure found at ./koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt:230: '<option value="*" ' at misc/translator/xgettext.pl line 124, <$INPUT> line 100.

Which is way more interesting to fix the problem as we know exactly
where the problem comes from

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3a5d8d51ca)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:02 +00:00
Andreas Roussos 02ecbcb408
Bug 38987: Use the correct HTML id attribute
Starting with Koha 24.11.01, we can no longer link authorities with
other authorities (linking a bibliographic record with an authority
still works fine). This affects both MARC21 and UNIMARC instances,
and is valid on the main branch, too.

This patch fixes that.

Test plan:

1) Navigate to Koha's Authorities module and create a new authority
   (using the 'Default' authority type). In tab 5, expand field 500
   by clicking on its description.

2) Launch the Authority finder form by clicking on the small 'Tag
   editor' button on the far right of subfield 500$a.

3) Click the yellow 'Search' button at the bottom of the page.
   When the results appear, click on the '+ Choose' button for
   one of the authorities (any authority will do).

   Notice that nothing happens and the Authority finder stays open,
   whereas normally it should close automatically at this point and
   transfer you back to the authority editor, copying the info from
   the authority you selected into the subfields of field 500.

   Press F12 (works in Chrome and Firefox) to launch the Developer
   Tools of your browser and notice that in the JavaScript console
   the following error message has been registered:

   "Uncaught TypeError: e is null"

4) Apply this patch (and restart_all for good measure), then press
   CTRL-F5 to reload all JS assets.

5) Repeat step 3) above; this time, when you click on the '+ Choose'
   button the authority finder window will close and the contents of
   the authority you selected will be copied into the subfields of
   field 500.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 48aad541cc)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:01 +00:00
Fridolin Somers fcca81ad77
Bug 38963: Check for existence of biblio object before fetching cover images in the OPAC
This patch adds a conditional to ensure the biblio object has been retrieved
and assumes no cover images otherwise. This is similar to bug 37425 that
fixed the issue for the staff interface.

Test plan:
 1. Enable the OPACLocalCoverImages system preference.
 2. Search in the OPAC (for example, attic).
 3. Find the biblionumber for one of the results and delete it
    from the database using SQL:
     DELETE FROM biblio WHERE biblionumber=3;
 4. Search again.
    NOTE: Steps 3 and 4 need to be done very quickly to generate the error.
    I had the terminal open with the SQL already loaded, and the browser
    also open.
 5. Error trace generated:
     Can't call method "cover_images" on an undefined value at /kohadevbox/koha/opac/opac-search.pl line 702.
 at /kohadevbox/koha/opac/opac-search.pl line 701
 6. Reindex, confirm error is gone: koha-rebuild-zebra -d -f -v kohadev
 7. Apply the patch.
 8. Repeat steps 2 to 4 - I searched for perl and used biblionumber 13.
 9. No error generated
10. Reindex and repeat search and confirm no error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ed3481786f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:01 +00:00
Pedro Amorim 1126f6f0f3
Bug 38528: (QA follow-up) Add tests for set_additional_fields with marcfield_mode = 'get'
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 05ea8ec61c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:01 +00:00
Baptiste Wojtkowski 615f306793
Bug 38528: (follow-up) add test for prepare_cgi_additional_field_values
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 30d0a31767)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:00 +00:00
Pedro Amorim 0effa890dd
Bug 38528: Update empty field value logic
prepare_cgi_additional_field_values needs to consider a field value as empty, because a MARC get field will always be submitted empty, and then picked up and handled by set_additional_fields accordingly.
But because we don't want to polute the database with tons of empty additional fields if many empty repeatable fields were submitted in the UI, the check for empty value still happens, but only after the MARC get check has happen, not before.

Signed-off-by: Baptiste <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f9561c59c2)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:00 +00:00
Nicolas Hunstein 6ea6ebdf11
Bug 38874: update descriptions of "UpdateItemLocationOnCheckout" and "UpdateItemLocationOnCheckin"
updates description "PROC: _PERM_ - causes an item that is in the Processing center to be updated to it's permanent location." to "PROC: _PERM_ - causes an item that is in the Processing center to be updated to its permanent location."

to test:
- go to Administration/System preferences
- check descriptionss for system preferences UpdateItemLocationOnCheckout and UpdateItemLocationOnCheckin
- verify descriptions contain "it's" instead of "its" in the place "PROC: _PERM_ ..."

- apply patch
- verify descriptions have changed to "its"

Signed-off-by: Aude <aude.charillon@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 489d8a47a3)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:57:00 +00:00
David Cook 52273f7870
Bug 36008: Use notice_email_address instead of email for SendAlerts issue type
This change makes Koha use "notice_email_address" instead of "email" for
SendAlerts with a type of "issue". This brings SendAlerts more in line with
the rest of Koha

Test plan:
0. Apply the patch
1. Create a subscription
- Go to http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
- Click "New subscription" and follow the prompts / fill out
required fields
- On the first screen, ensure "Patron notification" says "New serial issue"
(You can edit this after creating the subscription if necessary)
2. Click "subscribers" next to "Patron notification: SERIAL_ALERT"
3. Log into the OPAC, go to the bib record for that subscription, click "Subscriptions",
and click "Subscribe to email notification on new issues" and click "Yes" on the subsequent
screen
4. Edit your patron record and make sure you have an email in "Secondary email" and not "Primary email"
5. Set up a SMTP server for your Koha or some other email delivery mechanism
6. Go to the "Serial collection" for your subscription
e.g. http://localhost:8081/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1
7. Click "Receive"
8. Mark the serial as "Arrived"
9. Click "Save"
10. Note that you receive an email using your Koha user's "Secondary Email" address

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e72ee54eb5)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:59 +00:00
Owen Leonard e0b01daef3
Bug 38968: Identity providers "More" controls broken after Bootstrap 5 upgrade
This patch corrects the data attribute on "More" buttons which were
incorrectly updated during the Bootstrap 5 upgrade. "data-bs-target" is
corrected to "data-target."

Also fixed are instances of a misspelled class, "ligth" -> "light"

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

- Click "New identity provider."
  - In the "Advanced configuration" section, test the "More" buttons
    underneath the textareas. Clicking them should expand the hidden
    help text and hide the button.
- Perform the same test when updating an identity provider.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b138eb0e83)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:59 +00:00
Magnus Enger be7347f507
Bug 34681: (follow-up) Fix typo
Change from: [% last_retruned_by | html %]
To: [% last_returned_by | html %]

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e284f9ddb5)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:58 +00:00
Lucas Gass 9e6b1ac355
Bug 34681: Fallback to borrowernumber when there is no cardnumber
To test:
1. Have StoreLastBorrower enabled to store Last Returned By.
2. Create account and leave cardnumber empty.
3. Check out and return item with that account.
4. Go to items detail page.
5. See that Last Returned By and, if return is not anonymized, Last Borrower appears blank (you can inspect the fields and see that borrower information is there but not visible). Previous borrower will similarly be blank if it is from an account with no cardnumber.
6. APPLY PATCH
7. Try the items detail page again. You should see the link for 'Last borrower' and/or 'Previous borrower' now as the borrowernumber.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised, with the tiny followup I am providing.
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 90dce0f0f1)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:58 +00:00
Jonathan Druart 485aeff5d5
Bug 38794: say_success only if updated
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 74c000763c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:58 +00:00
Nicolas Hunstein 6094cf1b05
Bug 38794: (follow-up) Add database update
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 40c45a3905)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:57 +00:00
Nicolas Hunstein 6c8fe86c30
Bug 38794: Update authorized value description for AggregatedFullText
Update the authorized value description for AggregatedFullText in
the ERM_PACKAGE_CONTENT_TYPE category from "Aggregated full" to
"Aggregated full text".

Test plan:
1. Go to Administration > Authorized values.
2. Check the authorized values for the ERM_PACKAGE_CONTENT_TYPE
   category.
3. Note that the description for AggregatedFullText is
   "Aggregated full".
4. Apply the patch.
5. Update the database: updatedatabase
   (Bonus: To check for new installations: reset_all)
6. Refresh the page and note that the description is
   now "Aggregated full text".

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3fb75be0fb)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:57 +00:00
Jonathan Druart 694870248f
Bug 38546: Set tabWidth and useTabs in prettierrc
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2025-08-06 09:56:52 +00:00
Janusz Kaczmarek 1100be5167
Bug 38895: In advanced editor, the fixed data helpers put '#' instead of space in record content
When editing a bibliographic record in advanced editor, there are
helpers for fixed data coded fields (like 008).  Like in the standard
editor, empty value (space) is represented by a hash sign.  But unlike
in the standard editor, the hash sign is not converted into a space but
remains as '#' in the saved record.  This is obviously wrong.

Test plan:
==========
1. Ensure to have EnableAdvancedCatalogingEditor set to 'enable'.
2. Create of edit a record, choosing for one of one-letter codes
   an empty value (represented by '#' in the helper).
3. Save the record, control in 'MARC preview' that you got a hash sign
   in the 008 field instead of a space.
4. Apply the patch ; restart all.
5. Open a record in advanced editor, refresh the page to reload the java
   script (Shift+Ctrl+R or another appropriate shortcut).  Edit the 008
   field again choosing for one of one-letter codes an empty value.
6. Save the record, control in 'MARC preview' that there is a space
   and not the hash sign.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Esther Melander <esther@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37a7222de0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 17:21:35 +02:00
Pedro Amorim 847e199460
Bug 39446: Show both status and status_alias
If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column is empty. Click the 'View', notice the 'status' entry is empty.
12) Apply patch. Repeat
2025-08-04 16:46:08 +02:00
Caroline Cyr La Rose 870613f604
Bug 39565: Move OPACVirtualCard system preferences to features section
This patch moves the OPACVirtualCard and OPACVirtualCardBarcode system
preferences from the Suggestions subsection of the OPAC preferences to the
Features subsection.

To test:
1. Apply patch
2. Go to Administration > System preferences > OPAC
3. Search the page (Ctrl + F) for OPACVirtualCard
   --> The two preferences (OPACVirtualCard and OPACVirtualCardBarcode)
       should be in the Features section

Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 68325b37e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 15:11:18 +02:00
Nick Clemens e35423d666
Bug 39303: Add audience index to SRU
This patch adds a 'koha.audience' entry to the pqf properties for searching

To test:
1 - curl -XGET "http://localhost:2100/biblios?version=1.1&operation=searchRetrieve&query=ta=a&maximumRecords=60&recordSchema=marcxml"
2 - Unsupported index
3 - Apply patch
4 - cp etc/z3950/pqf.properties /etc/koha/sites/kohadev/z3950/pqf.properties
5 - sudo koha-z3950-responder --restart kohadev (or restart_all)
6 - Test a search:
    curl -XGET "http://localhost:2100/biblios?version=1.1&operation=searchRetrieve&query=koha.audience=a&maximumRecords=60&recordSchema=marcxml"
7 - Results!

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d8f6cf398c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 15:02:17 +02:00
Owen Leonard d15364b49c
Bug 25947: (follow-up) Tidiness fix
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 18d9297bda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 14:44:05 +02:00
Baptiste Wojtkowski 2f6eb09ecc
Bug 25947: (follow-up) Improve locked account message
Test plan:

To test:
1. Change system preference 'FailedLoginAttempts' to a small number,
   like 2
2. Go to a patron's account and copy their username (while you're there,
   change the password and add some fines, too)
3. In the OPAC, try to log in with the username and a wrong password 3
   times
4. Go back to the patron's account in the staff interface
5. Note that there is a message : "Patron's account has been locked (due
   to 3 failed login attempts)". Note there is a tooltip at the right
6. Click on "Change password", you go to change password page

Note: the follow-up might be unclear to understand:
1 - it moves the button outside the IF patron.login_attempt < 0
2 - Hence it requires the </li> to be moved out so button remains on the
    lane
3 - Finally the <li> must be put before the if and changed a bit

Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 20a87564f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 14:40:04 +02:00
Fridolin Somers a3284990f8
Bug 25947: Improve locked account message
When using system preference 'FailedLoginAttempts', a patron's account
is blocked after X many failed login attempts on the OPAC.

This patch adds, like for "Patron's card has expired" message :
  * a message "Patron's account has been locked (due to X failed login
    attempts)" on the patron details and circulation pages
  * a link to change password
Links are only displayed if libarian has permission to edit patrons.

For administrative lock, only a message is displayed :
"Patron's account has been administratively locked"

To test:
1. Change system preference 'FailedLoginAttempts' to a small number,
   like 2
2. Go to a patron's account and copy their username (while you're there,
   change the password and add some fines, too)
3. In the OPAC, try to log in with the username and a wrong password 3
   times
4. Go back to the patron's account in the staff interface
5. Note that there is a message : "Patron's account has been locked (due
   to 3 failed login attempts)"
6. Click on "Change password", you go to change password page

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54bf6c815c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 14:40:03 +02:00
Tomas Cohen Arazi c7517371a8
Bug 36433: (follow-up) Include required library
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a07368e5ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:27:01 +02:00
Frédéric Demians 6cc6dabe66
Bug 36433: fix test failing on Jenkins
Transaction rollback not called.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a8b41c344)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:27:01 +02:00
Frédéric Demians 864550dbaf
Bug 36433: Plugin hook elasticsearch_to_document
Add a new hook elasticsearch_to_document in order to allow completing
the 'document' to be sent to Elasticsearch. Usage example: (1) add new
search fields, (2) normalize/sanitize existing fields, (3) use id fields
to retrieve info via web services in other repositories (say VIAF), (4)
download file referenced in a field, and index its content.

To test:

1. Apply the unit tests patch, and run it:

   prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

   => FAIL: Tests fail! The hook is not implemented so the desired

2. Apply this patch, and then repeat 1:

   => SUCCESS: It works!

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e0b829bd66)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:27:00 +02:00
Frédéric Demians 3df9218a88
Bug 36433: UT
Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 359fa68458)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:26:59 +02:00
Jake Deery 9b60397705
Bug 38313: Remove confusing string from RESTOAuth2ClientCredentials
This patch removes a once necessary and now confusing warning
from the RESTOAuth2ClientCredentials syspref.

TO TEST:
a)  Notice how the RESTOAuth2ClientCredentials syspref references
    installing Net::OAuth2::AuthorizationServer, even though this
    module is in the cpanfile and koha-perldeps and has been since
    22.11
b)  APPLY PATCH
c)  Run reset_all in k.t.d
d)  Notice how the message is now gone

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7f48902403)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:11:06 +02:00
Emily Lamancusa a963246d1c
Bug 38095: Include logged-in branch in custom patron message
To test:
1. Create a new notice template for a custom patron message
    i. Go to Tools > Notices and Slips
    ii. Create a new notice and choose Patrons (custom message) module
    iii. Add the following text to the email notice:
    You have a new notification from  [% branches.branchname %]
    iv. Fill in other fields and save
2. Find a patron and go to their details page
3. Send the custom notice you just created
    i. Click Add message
    ii. Under "add a message for", select the email option
    iii. Under "Patron notice", select the notice you just created
    iv. Click "Save"
4. Open the patron's notices tab and look at the notice that was sent
--> The branch name is left blank
5. Apply patch and refresh the patron page
6. Repeat steps 3-4
--> The branch code is now included in the notice

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6c7ebf28e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:56:29 +02:00
Caroline Cyr La Rose 41ebf1901b
Bug 38873: Update MARC21 default framework to Update 39 (December 2024)
This patch updates the MARC21 default bibliographic framework to include
changes brought by Update 39 to the MARC21 format.

See https://www.loc.gov/marc/bibliographic/bdapndxg.html for the list of
changes.

Changes to field 506
- Added subfield $0 Authority record control number or standard number (R)
- Added subfield $1 Real World Object URI (R)

Changes to field 508
- Added subfield $3 Materials specified (NR)

Changes to field 511
- Added subfield $3 Materials specified (NR)

Changes to field 540
- Added subfield $0 Authority record control number or standard number (R)
- Added subfield $1 Real World Object URI (R)
- Renamed subfield $f to Standardized terminology for use and reproduction rights

To test:
1. Apply patch and reset_all
2. Go to Administration > MARC bibliographic framework > Default
   framework
3. Check that the additions/modifications are correct as per the list
   above
4. Optionally, run the MARC bibliographic framework test, and make sure
   there are no errors

NOTE: This change only applies to NEW installations. For existing
installations, you must make the changes yourself in Administration >
MARC bibliographic framework. This is to avoid overwriting
customizations libraries might have made to their cataloging frameworks.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d5c533e6f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:54:15 +02:00
Tomas Cohen Arazi 363383eee7
Bug 38762: Make compare_es_to_db.pl provide links to staff interface
This patch makes the script provide links to the staff interface instead
of the OPAC. This way, the links can just be picked to access the
problematic records for fixing them.

To test:
1. Run:
   $ ktd --shell
  k$ perl misc/maintenance/compare_es_to_db.pl
=> FAIL: Generated links point to the OPAC
2. Apply this patch
3. Repeat 1
=> SUCCESS: Generated links are useful as they point to the staff
interface
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cc0aa072dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:42:46 +02:00
Lucas Gass 180e54a871
Bug 39848: Restrict record deletion to staff who have edit_catalogue permission
To test,
1. Create a user with the following permissions: edit_any_item, edit_items, items_batchdel, items_batchmod.
2. When logged in as that user, use the batch item deletion tool to delete a few items.
3. Select “Delete records if no items remain” and “Delete selected items.”
When the job has processed, notice that X item(s) deleted. X record(s) deleted.
4. APPLY PATCH
5. With the same user repeat step 2.
6. This time there should be no option to 'Delete records if no items remain'.
7. Give the same use the Edit catalog (Modify bibliographic/holdings data) (edit_catalogue) permission.
8. Make sure you can successfully delete a record using the 'Delete records if no items remain'.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f70ec68c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:04:14 +02:00
Owen Leonard ebf2ec8553
Bug 39680: "Clear" menu item doesn't delete search history
This patch fixes the behavior of the OPAC's "Clear" link, which was not
updated to work with CSRF protection.

To test:

- If necessary, go to Administration -> System preferences in the staff
  interface and set the EnableOpacSearchHistory preference to "Keep."
- Log in to the OPAC.
- If necessary, perform several catalog searches in order to populate
  your search history.
- Expand the user menu in the upper right-hand corner and click the
  "Clear" link next to "Search history."
  - You should be prompted to confirm.
  - After confirming your search history should be empty.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fa557624e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:55:35 +02:00
David Cook a885752801
Bug 39567: Run JS change in separate file ESM as per JS1
As per JS1 in the coding guidelines, I've moved the inline JS from
the template into a separate file.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eeb86254da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:55:13 +02:00
Emily Lamancusa ae3fb6470d
Bug 39567: Remove form-submit includes from tt files
Now that the form-submit code has been added to the global js-includes
files for both the staff interface and OPAC, it no longer needs to be
included directly in each template file.

To test:
1. Apply patch
2. Clear browser cache
3. git grep "form-submit.js"
--> Confirm that all imports of the form-submit.js asset have been
    removed, and the only results are the comment in global.js and
    staff-global.js

4. Test OPAC > Account page > Renew a checkout to confirm the link
    submission still works as expected in the OPAC
    i. Check out an item to a patron
    ii. Set a known password for that patron
    iii. Log into that patron's account in the OPAC
    iv. Click the "Renew" link next to that checkout in the checkouts
        table on the patron's OPAC account page
    --> Confirm the item is renewed as expected

5. Test some of the following buttons to confirm the link submission
   still works as expected in the staff interface:
    - Bib record > Holds > Revert transit/waiting status on a hold
    - Acquisitions > Basket > Create EDIFACT order
    - Acquisitions > Invoices > detail for a specific invoice > Delete
    - Acquisitions > Invoices > perform actions on invoices using the
                                action drop-down
    - Acquisitions > Invoices > open/close invoices by selecting the
                                checkboxes
    - Administration > Additional fields > Delete an additional field
    - Administration > Background jobs > Cancel a background job
    - Edit an item > scroll up > Actions drop-down > Print label
    - Cataloging > Label creator > Manage label batches > Edit a batch
        > Delete batch
    - Cataloging > Label creator > Manage label batches > Delete a batch
    - Patron account > holds > delete a hold
    - Tools > Patron lists > delete a list from the Actions drop-down
    - Reports > Saved reports > Preview SQL on a report > Delete
    - Reports > Saved reports > Delete a report from the actions drop-down
    - Rotating collections > Delete a collection from the actions drop-down
    - Stock rotations > move item to the next stage
    - Stock rotations > remove item from a rota
    - Stock rotations > Add/remove "In demand"
    - More > Lists > edit a specific list > Edit drop-down > Delete

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3478e09d41)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:55:13 +02:00
Emily Lamancusa 8f4dff799d
Bug 39567: Include form-submit code from opac-bottom.inc (OPAC)
Import the form-submit.js script in the global includes file for the
OPAC, so that all pages have access to it without needing to
import it directly.

This patch also aligns the OPAC copy of form-submit.js to the staff
interface copy, as the OPAC copy is missing 3 lines to support opening
the link in a new tab (added to the staff interface copy in bug 37192).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 984cf190a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:54:09 +02:00
Jonathan Druart 6866a02948
Bug 39567: Include form-submit code from js_includes.inc (staff interface)
Import the form-submit.js script in the global includes file for the
staff interface, so that all pages have access to it without needing to
import it directly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9f44cb8a88)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:53:11 +02:00
Martin Renvoize a649160b0a
Bug 39754: Enable fixed height and overflow on EDIFACT dropdown
This patch updates the 'Create EDIFACT order' menu dropdown for cases
where multiple EANs are available for the library.

We set the dropdown to a max-height of 75% of the window height and then
we enable y scrolling and hide the x scrollbar.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4564ed5ef1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:33:38 +02:00
Jonathan Druart bc6548c5e1
Bug 34070: Display the 'jobs will be processed anyway' message from worker
->connect does not raise an exception, so we didn't reached the catch
block.

Adjusting the code but I am not really happy with it, but more changes
will derail the original bug

Now we log:
Cannot connect to broker (Access refused for user 'guest') at /kohadevbox/koha/Koha/BackgroundJob.pm line 96.
Cannot connect to the message broker, the jobs will be processed anyway at /kohadevbox/koha/misc/workers/background_jobs_worker.pl line 100.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8dfb19a45a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:33 +02:00
Jonathan Druart 12b5981e3b
Bug 34070: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6ee689c7c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:32 +02:00
Jonathan Druart e8de06a0de
Bug 34070: Deal with broker connection issues
This patch suggests to deal with connection issues at
Koha::BackgroundJob->connect level.
It incorrectly returned a Net::Stomp object when the connection failed.
With this patch, if the CONNECT does not return a CONNECTED frame then
Koha::BackgroundJob->connect returns nothing and the caller is not
fooled.

It also fixes the about page, we now have:
 "Using SQL polling (Fallback, Error connecting to RabbitMQ)"
instead of
 "Using RabbitMQ"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c407ce021e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:32 +02:00
David Cook ad35b19273
Bug 34070: Add error handling for ERROR frames for background worker
This change adds error handling for ERROR frames to background_jobs_worker.pl.
A previous patch added it to es_indexer_daemon.pl which is a different
background jobs worker.

To test ERROR handling for background_jobs_worker.pl:
1. Change your RabbitMQ connection details in koha-conf.xml or the hard-coded ones in Koha/BackgroundJob.pm
to include an invalid password. For example, if you don't have a message_broker already defined, use the following:
<message_broker>
 <password>bad</password>
</message_broker>
2. sudo koha-worker --restart --quiet kohadev
3. View the errors in the logs:
tail -f /var/log/koha/kohadev/worker-output.log
tail -f /var/log/koha/kohadev/worker-error.log

To test MESSAGE handling for background_jobs_worker.pl:
1. Ensure RabbitMQ connection details are correct
2. Go to Batch item modification and add the following barcodes:
39999000001310
39999000004571
3. Add a z - Public Note of the following and click Save:
THEBACKGROUNDWORKERWORKED
4. Search the catalogue using THEBACKGROUNDWORKERWORKED in the top
catalogue search
5. Note that you get 2 results in your search
6. Look in the logs just to make sure there are no new messages there

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4dc4a232c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:31 +02:00
David Cook 0927850a43
Bug 34070: Add error handling for ERROR frames
This change causes es_indexer_daemon.pl to die on ERROR frames instead
of spinning in an infinite loop. It also adds a content-type STOMP frame header
to help consumers know what data type is in the MESSAGE frame body.

To test ERROR handling for es_indexer_daemon.pl:
1. Switch to using Elasticsearch
2. Change your RabbitMQ connection details in koha-conf.xml or the hard-coded ones in Koha/BackgroundJob.pm
to include an invalid password. For example, if you don't have a message_broker already defined, use the following:
<message_broker>
 <password>bad</password>
</message_broker>
3. sudo koha-es-indexer --restart kohadev
4. View the errors in the logs:
tail -f /var/log/koha/kohadev/es-indexer-output.log
tail -f /var/log/koha/kohadev/es-indexer-error.log

To test MESSAGE handling for es_indexer_daemon.pl:
1. Switch to using Elasticsearch (and ensure RabbitMQ connection details are correct)
2. Change the title of a bib record to something new and unique
3. Try to search for the bib using the new title
4. Note you can find it
5. Look in the logs just to make sure there are no messages there

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2c1314ead6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:31 +02:00
Jonathan Druart bb697a165d
Bug 39286: Use mock_config instead of env vars
Bug 35655 needed to mock the config, but instead introduced new env variables.

Test plan:
  prove t/db_dependent/Koha/BackgroundJob.t
should still return green

Bonus 1: no more warning
t/db_dependent/Koha/BackgroundJob.t .. 1/6 Cannot connect to broker Failed to connect: Error connecting to not_localhost:99999: Invalid argument at /usr/share/perl5/Net/Stomp.pm line 27.; giving up at /usr/share/perl5/Net/Stomp.pm line 27.

Bonus 2: tests are passing even if you have 'message_broker' in the
config
To test this, add the following entry to $KOHA_CONf then prove again
 <message_broker>
    <hostname>localhost</hostname>
    <port>61613</port>
    <username>guest</username>
    <password>guest</password>
    <vhost></vhost>
 </message_broker>
=> Without this patch the tests fail because the config will overwrite
the env vars.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Warning goes away and prove works even with the message_broker config.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 15a272e1e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:26:45 +02:00
David Nind 673306f563
Bug 39878: (follow-up) Update hints for default FTP and SFTP ports
Hint now covers the default ports for FTP (21) and
SFTP (22), instead of "will default to 22".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ef8329bd37)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:21:58 +02:00
Kyle M Hall 2d6824c287
Bug 39878: EDIFACT vendor account records sets default port incorrectly for FTP
When creating or editing an EDI (EDIFACT vendor record) if the port is left empty it will be set to port 22. This is fine then the service is SFTP, but if FTP is selected the default to 21.

Test plan:
1) Enable EDIFACT
2) Create a new EDI Vendor account with the FTP transport selected. Pleave the ports unpopulated
3) Note the saved record has port 22 set
4) Apply this patch
5) Restart all the things!
6) Repeat stepts 1 and 2
7) The port should now be 21 for new ftp site and 22 for new stp sites!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fb9722a128)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:21:57 +02:00
Martin Renvoize b494793ce8
Bug 33284: (follow-up) Fix unit tests
We have a case here where we have checkout_id pointing at issues and
old_issues tables. We need to trick TestBuilder to NOT automagically
build our related checkout.. This patch passes 'undef' to the foreign
key field and then sets it after the fact to the related Old::Checkouts
objects we've already built above.

This patch should prevent the random failures we were seeing before

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d6af10d881)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:13:04 +02:00
Martin Renvoize bf1680c913
Bug 33284: Set renewer_id for sets of checkouts
This patch adds a trigger into the anonymize function of
Koha::Old::Checkouts such that we pass along the anonymize action to
the renewals record.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4f77ec8387)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:13:03 +02:00
Martin Renvoize 05f18896f7
Bug 33284: Set renewer_id appropriately for anonymize settings
This patch adds a trigger into the anonymize function of
Koha::Old::Checkout such that we pass along the anonymize action to the
renewals record.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e6d0df1156)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:13:03 +02:00
Martin Renvoize 9054bb131e
Bug 33284: Unit test
This patch adds unit tests to ensure renewals properly respect the
patron privacy settings.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d82abae1da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:12:58 +02:00
Tomas Cohen Arazi 23ff8a7b1d
Bug 39694: Make `es_indexer_daemon.pl` use batch_size to limit DB poll size
This patch makes the indexer poll the DB in configurable batches. Pretty
much like Rabbit does.

The only change is that it will now pass a LIMIT <batch_size> to the
query.

To test:
0. Have KTD started with ES (skip if you have an instance running):
   $ ktd --es7 up -d
1. Stop the indexer and rabbit:
   $ ktd --shell
  k$ sudo koha-es-indexer --stop kohadev
  k$ sudo service rabbitmq-server stop
2. On a separate terminal, watch the queue:
  k$ watch -n 0.5 'echo "SELECT COUNT(*) FROM background_jobs WHERE status=\"new\"" | koha-mysql kohadev'
=> SUCCESS: It should be empty
3. Add a bunch of things to index (this works with default KTD data):
  k$ for i in $(seq 1 438; seq 1 438) ; do echo "INSERT INTO background_jobs (status,queue,data) VALUES ('new','elastic_index','{\"record_server\":\"biblioserver\",\"record_ids\":[$i]}')" | koha-mysql kohadev ; done
4. Start the ES indexer:
  k$ sudo koha-es-indexer --start kohadev
5. Look at the queue size
=> FAIL: It shrinks too fast [1]
6. Apply this patch
7. Restart the indexer
  k$ perl misc/workers/es_indexer_daemon.pl &
8. Repeat 3
9. Look at the queue size:
=> SUCCESS: It shrinks 'slowly'
10. Sign off :-D

[1] This is a problem in certain scenarios, not in all of them. This is
the best I come up with in order to test the behavior change. Anyone can
set a new size of their taste.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 20b600d450)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 16:45:16 +02:00
Baptiste Wojtkowski 82d2b6a2e5
Bug 40458: add pod coverage to Discharge.pm
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Replaced borrowers in the ->request POD by borrower
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ff2fda90d4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f5f5fded2d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:52:50 +02:00
Jonathan Druart 2f6cff5899
Bug 18772: Remove warnings from t/ImportBatch.t
Use of uninitialized value in concatenation (.) or string at /usr/local/share/perl/5.20.2/MARC/File/XML.pm line 399, <__ANONIO__> chunk 1.

Those are 2 warnings coming from MARC::File::XML when called with
invalid XML.
We should not use Test::Warn as they are not expected and that may be
fixed upstream.

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 b696642df7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 0af79e24cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:50:08 +02:00
Jonathan Druart 7eb5b8fcae
Bug 40407: Remove legacy "pre-wrap" versions
From https://css-tricks.com/snippets/css/make-pre-text-wrap/

/* Browser specific (not valid) styles to make preformatted text wrap */

pre {
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

... I think it's now safe to remove the backward compatibility versions and simply keep pre-wrap.

Test plan (from bug 921)0:
  * place a hold on a title with a very very long title or author
  * mark it as "waiting for pickup" by doing a checkin
  * go to command line interface, and run
  * misc/cronjobs/gather_print_notices.pl /tmp
  * misc/cronjobs/printoverdues.sh /tmp
  * if your title/author is long enough, it's splitted on 2 lines
    with this patch (it is not before this patch)

It will also remove the warnings from t/db_dependent/Patron/Borrower_Discharge.t
WARNING: Ignored `white-space: -moz-pre-wrap` at 6:14, invalid value.
WARNING: Ignored `white-space: -o-pre-wrap` at 7:14, invalid value.
WARNING: Ignored `word-wrap: break-work` at 8:14, invalid value.

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 03cf21fd92)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7f05cfc408)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:47:58 +02:00
Jonathan Druart b81c5d6dee
Bug 40372: Remove warning from api/v1/holds.t
t/db_dependent/api/v1/holds.t .. 1/16 No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 602.

We do not test the notification here, we can simply ignore the letters
code

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 c14e72e782)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 98b97ea075)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:35:37 +02:00
Jonathan Druart 288aa52ad1
Bug 40374: Remove warnings from Koha/Booking.t
t/db_dependent/Koha/Booking.t .. 1/2 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry '7' for key 'PRIMARY' at /kohadevbox/koha/Koha/Object.pm line 174
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'status' at row 1 at /kohadevbox/koha/Koha/Object.pm line 174

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 da423a717e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7566ed0d99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:29:59 +02:00
Jonathan Druart 08cd0737c8
Bug 40376: Remove warning from AuthorisedValues.t
t/db_dependent/AuthorisedValues.t .. 1/17 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'tagsubfield' on MarcSubfieldStructure - perhaps you forgot to set its 'is_auto_increment' attrib
ute during add_columns()? Treating 'tagsubfield' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174

It is a bit scary but it's only that we forgot to pass a value for
tagsubfield (that is NOT NULL and part of the PK)

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 50b9abfe4f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4091d99c0c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:28:51 +02:00
Jonathan Druart d9eeb0c341
Bug 40377: Remove warnings from HoldsQueue/TransportCostOptimizations.t
UseTransportCostMatrix set to yes, but matrix not populated at /kohadevbox/koha/C4/HoldsQueue.pm line 188.
UseTransportCostMatrix set to yes, but matrix not populated at /kohadevbox/koha/C4/HoldsQueue.pm line 188.

It seems that they are expected, we simply need to catch them.

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 364b78e653)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 66c969e037)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:25:55 +02:00
Jonathan Druart c29a9e67a8
Bug 40381: Remove warning from Koha/SearchEngine/Elasticsearch/ExportConfig.t
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'filter' on SearchMarcToField - perhaps you forgot to set its 'is_auto_increment' attribute during add_columns()? Treating 'filter' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/SearchField.pm line 42
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 c2df4af991)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c19ce68db1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:24:58 +02:00
Jonathan Druart e097d35a95
Bug 40404: Remove diag from t/Test/Mock/Logger.t
t/Test/Mock/Logger.t .. 1/10     # trace:
    #    (No trace messages)
    # debug:
    #     "Debug message" at /usr/share/perl/5.36/Test/Builder.pm line 374
    # info:
    #    (No info messages)
    # warn:
    #    (No warn messages)
    # error:
    #    (No error messages)
    # fatal:
    #    (No fatal messages)
t/Test/Mock/Logger.t .. ok
All tests successful.
Files=1, Tests=10,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.40 cusr  0.07 csys =  0.50 CPU)
Result: PASS

This one is a bit tricky: we cannot use Test::Warn to capture the output because Test::Builder->diag does not write directly to STDERR.
It has its own failure_output handle (which defaults to STDERR) but bypasses Perl’s standard layers.

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 9d17ce951d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 03beed51c5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:22:48 +02:00
Martin Renvoize 9bc31b33da
Bug 38818: Unit tests
Add unit tests for the updated mock module

Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7597d8f0d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:20:44 +02:00
Martin Renvoize 6d18f120de
Bug 38818: Add diag option to t::lib::Mocks::Logger
This patch adds a diag method to the Mocks::Logger object. This aids in
debugging logging errors by simply outputting all log lines to screen in
a diag statement.

Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 17b2b4cd6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:20:43 +02:00
Jonathan Druart 794a0e0ed7
Bug 40406: Remove warnings from selenium/basic_workflow.t
t/db_dependent/selenium/basic_workflow.t .. 1/22 CP main = 1.93
t/db_dependent/selenium/basic_workflow.t .. 3/22 CP add patron category = 3.56
t/db_dependent/selenium/basic_workflow.t .. 5/22 CP add patron = 4.31
CP add biblio = 0.29
t/db_dependent/selenium/basic_workflow.t .. 11/22 CP add items = 9.81
t/db_dependent/selenium/basic_workflow.t .. 16/22 CP checkout = 5.97
t/db_dependent/selenium/basic_workflow.t .. 20/22 CP checkin = 4.04
t/db_dependent/selenium/basic_workflow.t .. 22/22 CP holds = 5.60
t/db_dependent/selenium/basic_workflow.t .. ok

This has been used in the past for benchmarking Koha.

I suggest to keep the warn but comment it.

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 0e12c572e8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c4f54429a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:16:45 +02:00
Jonathan Druart aa0feeebdf
Bug 40409: Remove warnings from t/db_dependent/Overdues.t
The tests was wrong, we should make sure the item has been checked in.

We were missing the mock userenv:
Can't use an undefined value as a HASH reference at /kohadevbox/koha/C4/Circulation.pm line 2744. at /kohadevbox/koha/C4/Circulation.pm line 2787

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 fdb9a41af3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit eb4e66dbfb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:15:04 +02:00
Jonathan Druart 3b684c6b4f
Bug 40409: Make Overdues.t fail
The test is wrong, the item is not correctly checked in, it should fail.

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 5c743feec7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9f3c5d2019)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:15:03 +02:00
Jonathan Druart 1be5bf75d3
Bug 40410: Remove warning from Letters.
t/db_dependent/Letters.t .. 95/104 Use of uninitialized value in string eq at /kohadevbox/koha/Koha/Patron.pm line 389.

contactname can be NULL in DB.

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 45493d0f06)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 1f2dffb43f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:12:32 +02:00
Jonathan Druart 75be7ae805
Bug 40411: Remove warnings from Koha/SearchEngine/Elasticsearch.t
Warnings encountered while roundtripping a MARC record to/from USMARC. Failing over to MARCXML. at t/db_dependent/Koha/SearchEngine/Elasticsearch.t line 854.

=> This one is expected: we have generated a record with large fields

item-level_itypes set but no itemtype set for item (1568) at /kohadevbox/koha/Koha/Schema/Result/Item.pm line 1100.
item-level_itypes set but no itemtype set for item (1568) at /kohadevbox/koha/Koha/Schema/Result/Item.pm line 1100.

=> Those 2 ones can be removed by create a biblio and items using
build_sample_biblio and build_sample_item

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 25277e8a4d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 103c48373e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:11:31 +02:00
Jonathan Druart 0d08141eb1
Bug 40429: Remove warnings from Koha/Patron/Modifications.t
t/db_dependent/Koha/Patron/Modifications.t .. 1/7 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'borrowernumber' on BorrowerModification - perhaps you forgot to set its 'is_auto_increme
nt' attribute during add_columns()? Treating 'borrowernumber' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174
t/db_dependent/Koha/Patron/Modifications.t .. 5/7 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification - perhaps you forgot to set its 'is_auto_inc
rement' attribute during add_columns()? Treating 'verification_token' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174

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 f851367cf4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 0bd9f325c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:08:51 +02:00
Jonathan Druart 9338678ae4
Bug 40437: Remove warning from Koha/Installer.t
t/db_dependent/Koha/Installer.t .. 1/4
Use of uninitialized value $db_version in numeric eq (==) at
/kohadevbox/koha/Koha/Installer.pm line 32.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1974dd9c91)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8e93b7c900)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:04:53 +02:00
Jonathan Druart 5d26625683
Bug 40438: Remove warnings from Koha/Old/Hold.t
it's an integer.

t/db_dependent/Koha/Old/Hold.t .. 1/3
Value not allowed for auto_incr biblionumber in Biblio at
/kohadevbox/koha/t/lib/TestBuilder.pm line 431.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd54cd5062)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b3bddd0703)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:03:47 +02:00
Baptiste Wojtkowski 152b80cb40
Bug 39997: List of closed serials: reopening shouldn't require the syspref RoutingSerials
Test plan:
1 - Create a closed serial
2 - Disable the syspref "RoutingSerials"
3 - Go to cgi-bin/koha/serials/serials-search.pl and search for the
    closed serial ; click on the "closed" panel of the result -> on the
    actions button, there is no option to reopen
4 - Apply patch
5 - Repeat 3, there is now an option to reopen.

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 573b226997)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 48a06d1513)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:00:51 +02:00
Doris Tam 48d4abef35
Bug 38966: Fix wrong POD in Koha/CoverImages.pm and Koha/Acquisition/Order/Claims.pm
Test plan:
1. perldoc Koha/Acquisition/Order/Claims.pm
2. Check that it mentions Koha::Acquisition::Order::Claims
3. perldoc Koha/CoverImages.pm
4. Check that it mentions Koha::CoverImages.pm
4. These files no longer mention 'Koha::Cities'

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 f72a235de0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8e0832fd96)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:54:48 +02:00
Jake Deery 6265e24bf5
Bug 40304: Zebrasrv configs now work on ARM CPUs
This patch adds more module search paths to the zebra-biblios-dom.cfg and zebra-authorities-dom.cfg, so that a larger range of CPU architectures will work with Zebra search unit tests.

This will not change Debian package installs, but it will fix any git-based installs.

TO TEST (you'll need access to an ARM-based CPU, and, preferably, an x86-64 machine):
ON THE ARM-BASED MACHINE:
a)  start ktd, then ktd --shell
b)  in ktd, run: prove -v t/db_dependent/Search.t
c)  notice how the test now fails
APPLY PATCH
d)  rerun step b
e)  notice how the test now passes
ON THE X86-64-BASED MACHINE:
f)  run steps a-e
g)  notice how the test passes, both before and after applying the patch
SIGN OFF

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a6ac8c843)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3cc750d5ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:52:19 +02:00
Tomas Cohen Arazi 999410ea8e
Bug 40419: Fix wrong license
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6f1bd24e87)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 62104a03a3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:50:29 +02:00
Tomas Cohen Arazi 82a39f7857
Bug 40419: Changes to testing logic
This patch makes a couple changes to the tests:

* Remove check for Copyright line. The Copyright line should not be mandatory.
* Remove dependency of GPL-related checks on the copyrigth line
  existence. (this highlights several missed checks).
* Skip testing-related templates. Koha ships some templates that are not
  excluded correctly.

This 'fix' will highlight existing errors that were skipped until now.

To test:
1. Run:
   $ ktd --shell
  k$ prove xt/find-license-problems.t
=> FAIL: Tests pass! Some files should make them fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests fail!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0a4b25acb5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 48447cc30c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:50:29 +02:00
Jonathan Druart 124287bdee
Bug 38102: Fix default sort order
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception:
DBD::mysql::st execute failed: Unknown column 'date_due desc' in 'order
clause' at /kohadevbox/koha/Koha/Objects.pm line 401

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bb71c19635)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit bc11cfea77)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:46:04 +02:00
Jonathan Druart ff92a34ca5
Bug 38102: Fix limit to 50 items in the checkout history - OPAC
Checkout history does not limit to 50 items, it's a regression from bug
33949.

To limit to 50 items we need to use "rows", not "limit".

Test plan:
Have more than 50 checkouts and confirm that by default the table only
displays 50 entries.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd28d473cd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ef5e67a6ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:43:10 +02:00
Jonathan Druart 918a22b5c8
Bug 40390: Remove warnings from t/db_dependent/Biblio.t
t/db_dependent/Biblio.t .. 2/25 Finding auth type GENRE/FORM at t/db_dependent/Biblio.t line 300.
Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300.
Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300.
Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300.
Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300.
t/db_dependent/Biblio.t .. 12/25 Finding auth type TOPIC_TERM at t/db_dependent/Biblio.t line 300.
Finding auth type TOPIC_TERM at t/db_dependent/Biblio.t line 300.
Finding auth type TOPIC_TERM at t/db_dependent/Biblio.t line 300.
Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300.
Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300.
Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300.
t/db_dependent/Biblio.t .. ok

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 afa1cfb63a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ba821f58fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:41:37 +02:00
Jonathan Druart e022f334c2
Bug 40378: Remove warnings from api/v1/biblios.t
t/db_dependent/api/v1/biblios.t .. 12/15 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'cZt7U7mP0KD' for key 'itembarcodeidx' at /kohadevbox/koha/Koha/Obj
ect.pm line 174
t/db_dependent/api/v1/biblios.t .. 13/15 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'N44vCoe4tX41' for key 'itembarcodeidx' at /kohadevbox/koha/Koha/Ob
ject.pm line 174

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 71eb056850)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3b4e9dc5cb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:40:00 +02:00
Jonathan Druart d2af4f0da4
Bug 40388: Remove warning from t/Labels.t
Use of uninitialized value $cn_item in sprintf at /kohadevbox/koha/C4/ClassSplitRoutine/LCC.pm line 53.

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 9b0709fb47)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b8d54707ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 14:29:57 +02:00
Fridolin Somers a74c4daa29
Bug 40168: [24.11.x] Tidy 2025-08-01 14:25:09 +02:00
Jonathan Druart 6cc140d470
Bug 40385: Remove warning from Reserves/CancelExpiredReserves.t
t/db_dependent/Reserves/CancelExpiredReserves.t .. 3/4 No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 602.

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 10b673ee1c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 305d081a4e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:58:20 +02:00
Jonathan Druart aa51b4c9a4
Bug 40373: Remove warning from Reserves.t
t/db_dependent/Reserves.t .. 10/70 No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 602.

We do not test the notification here, we can simply ignore the letters code.
However we do test it later so we need to limit the scope of mock

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 1ceea0019c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 37341f2994)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:55:29 +02:00
Jonathan Druart e7939ef6e1
Bug 40384: Remove warnings from Koha/Plugins/Patron.t
t/db_dependent/Koha/Plugins/Patron.t .. 1/5 Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'patron_barcode_transform called with parameter: test_cn_1'
Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'patron_barcode_transform called with parameter: test_cn_1'
Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'patron_barcode_transform called with parameter: test_cn_1'

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 cc45e0b3d5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 520ec5d991)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:50:43 +02:00
Jonathan Druart cbf5dbe7f7
Bug 40380: Remove warnings from Patrons/Import.t - Argument "" isn't numeric in numeric eq (==)
Using perl -MCarp::Always:
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1017, <$handle_1> line 2.
DBIx::Class::Row::_eq_column_values(Koha::Schema::Result::Borrower=HASH(0x57c409b9ec08), "autorenew_checkouts", "", 1) called at /usr/share/perl5/DBIx/Class/Row.pm line 945

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 3aa81fa654)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit dcc3748bdd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:48:26 +02:00
Jonathan Druart 673d650270
Bug 40380: Remove warnings from Patrons/Import.t - Use of uninitialized value $csvkeycol{"dateexpiry"} in array element
Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$handle_2> line 2.
Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$handle_3> line 2.
Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$handle_4> line 2.
Use of uninitialized value $csvkeycol{"dateexpiry"} in array element at /kohadevbox/koha/Koha/Patrons/Import.pm line 310, <$fh> line 2.

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 e21d6c04a9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 88ae9b2c1f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:46:45 +02:00
Jonathan Druart 681b2a7bc9
Bug 40403: Remove warning from Circulation_holdsqueue.t
Use of uninitialized value in addition (+) at /kohadevbox/koha/C4/Biblio.pm line 3049.

The context is:

3045     my $current_issues = $biblioitem->totalissues // 0;
3046     if ( defined $value ) {
3047         $totalissues = $value;
3048     } else {
3049         $totalissues = $biblioitem->totalissues + $increase;
3050     }
3051     return 0 if $current_issues == $totalissues;    # No need to update if no changes

It feels correct to use $current_issues to suppress the warning

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 5661df2f70)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 686495ae04)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:45:38 +02:00
Jonathan Druart 702b48ef9a
Bug 40389: Remove t/dummy.t
This file should have been removed years ago.

See the history:

commit a5a419616d
Date:   Tue Aug 28 01:50:55 2007 +0100

    Disable tests

@ t/dummy.t:1 @
+# Dummy test until Test::Harness or similar
+# is used by the other tests to check deps.
+print "1..1\nok 1\n";

Then

commit 7f01995446
Date:   Fri Dec 7 17:15:22 2007 -0600

    installer (part 3): enabled 'make test'

-   # disable tests
-   'test' => {TESTS => 't/dummy.t'},

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 b8de89eaaa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 21ca620e0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:45:05 +02:00
Jonathan Druart 0fd1ec64e2
Bug 40043: Try to prevent Agreements_spec.ts to fail randomly
One test is failing with:
"""
https://on.cypress.io/element-has-detached-from-dom" type="CypressError"><![CDATA[CypressError: Timed out retrying after 10050ms: `cy.click()` failed because the page updated while this command was executing. Cypress tried to locate elements based on this query:

> <a.show>

We initially found matching element(s), but while waiting for them to become actionable, they disappeared from the page. Common situations why this happens:
  - Your JS framework re-rendered asynchronously
  - Your app code reacted to an event firing and removed the element

You can typically solve this by breaking up a chain. For example, rewrite:

> `cy.get('button').click().click()`

to

> `cy.get('button').as('btn').click()`
> `cy.get('@btn').click()`

https://on.cypress.io/element-has-detached-from-dom
    at retryActionability (http://localhost:8081/__cypress/runner/cypress_runner.js:112246:74)
    at tryCatcher (http://localhost:8081/__cypress/runner/cypress_runner.js:1807:23)
    at Promise.attempt.Promise.try (http://localhost:8081/__cypress/runner/cypress_runner.js:4315:29)
    at whenStable (http://localhost:8081/__cypress/runner/cypress_runner.js:143192:68)
    at <unknown> (http://localhost:8081/__cypress/runner/cypress_runner.js:143133:14)
    at tryCatcher (http://localhost:8081/__cypress/runner/cypress_runner.js:1807:23)
    at Promise._settlePromiseFromHandler (http://localhost:8081/__cypress/runner/cypress_runner.js:1519:31)
    at Promise._settlePromise (http://localhost:8081/__cypress/runner/cypress_runner.js:1576:18)
    at Promise._settlePromise0 (http://localhost:8081/__cypress/runner/cypress_runner.js:1621:10)
    at Promise._settlePromises (http://localhost:8081/__cypress/runner/cypress_runner.js:1701:18)
    at Promise._fulfill (http://localhost:8081/__cypress/runner/cypress_runner.js:1645:18)
    at <unknown> (http://localhost:8081/__cypress/runner/cypress_runner.js:5450:46)
From Your Spec Code:
    at Context.eval (webpack://koha/./t/cypress/integration/ERM/Agreements_spec.ts:630:18)]]></failure>
    </testcase>
  </testsuite>
"""

My guess is that it happens because we don't wait for the /agreements
response.

Test plan:
Test should still pass, we will see how Jenkins behave after it's
pushed.

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 cebc45ad03)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7ae55e2274)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:43:26 +02:00
Emmi Takkinen a779b92a7a
Bug 40116: Do not display "Patron is already a guarantor..." popup when error occurs
If a yellow error message appears when saving the guaranteed patron,
also an extra popup message "Patron is already a guarantor for this
patron" will appear on the screen. It should only appear when you try
to add the same patron as a guarantor that already is a guarantor for
that patron. This happens because js function select_user is triggered
every time when guarantor data is send back to front-end with variable
new_guarantors if error occurs. Already existing guarantors shouldn't
be send back to front-end since their data is not lost. This patch
changes existing guarantors form elements to use classes "guarantor_id"
and "guarantor_relationship" to prevent this.

To test:
1. Find a patron with Patron guarantor or add first a Patron guarantor
   (not a Non-patron guarantor) to a juvenile patron and save.
2. Edit again the same patron with guarantor and modify their age
   to be greater than the upperage or under the required age of the
   patron category.
   => Notice that you will get a yellow message "The following fields
      are wrong. Please fix them..."
   => Notice that you will also get a pop up notice that says "Patron is
      already a guarantor for this patron".
3. Apply this patch.
4. Repeat step 2.
   => Confirm that yellow message box is displayed but "Patron is..."
      pop-up is not
   => Also confirm that guarantors data is not lost.
5. Try to add same patron guarantor as guarantor for guarantee patron
   again.
   => Confirm that pop-up is displayed right after attempting to add
      guarantor.
6. Try to add new guarantor for patron.
   => New guarantor should be added.
7. Attempt to save the patron.
   => Confirm that both guarantors data is still displayed in form.
8. Fix patrons age and attempt to save.
   => Patron is saved and both guarantors are displayed in their
      details.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f2fe453dd4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 073fbd2696)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:41:27 +02:00
Jonathan Druart e06afd310a
Bug 40344: Fix KohaTable_spec.ts
> Cannot read properties of undefined (reading 'description')

Not sure since which change this is failing but it has always been
wrong.

The code in patron-search.inc is:
        var categories = [% To.json(categories) | $raw %].map(e => {
            e['_id'] = e.categorycode.toLowerCase();
            e['_str'] = e.description;
            return e;
        });
        var categories_map = categories.reduce((map, e) => {
            map[e._id] = e;
            return map;
        }, {});

It's the keys that are lower cased.

Test plan:

  `yarn cypress run \
    --config video=false,screenshotOnRunFailure=false \
    --spec t/cypress/integration/KohaTable/KohaTable_spec.ts`
should return green

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7bc3b24827)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 16439a30a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:37:17 +02:00
Jonathan Druart a8795dd604
Bug 40402: Make xt/find-license-problems.t process files that are in the git index
And only those files.

Currently the test is failing with
02:52:31 koha_1       | #   Failed test at xt/find-license-problems.t line 65.
02:52:31 koha_1       | #          got: '0'
02:52:31 koha_1       | #     expected: '1'
02:52:33 koha_1       | # File ./misc/translator/po/LICENSE has wrong copyright: hasgpl=1, hasv3=1, hasorlater=1, haslinktolicense=0, hasfranklinst=0
02:52:33 koha_1       | # Looks like you failed 1 test of 1381.
02:52:33 koha_1       | [00:51:24] xt/find-license-problems.t

Because a LICENSE file has been added to koha-l10n, and now this test fails on it.

27ab9ff4d2

But we should not test files that are not part of the git index.

Test plan:
0. Do not apply this patch
1. Edit xt/find-license-problems.t, add
  warn scalar(@files);
2. Run `prove xt/find-license-problems.t`
=> Notice that 4056 files are processed
Note that you need to have a clean git repo. You can run the following
git command BUT BEWARE /*\ it will remove all changes not committed
  `git clean -d -f`
3. Apply this patch, prove again
=> Tests are passing, with the same number of tests
xt/find-license-problems.t .. ok
All tests successful.
Files=1, Tests=4056

Note that I think we lost one file, as Test::NoWarnings is adding a
test. But I don't think it is worth the trouble to find out which one is
missing.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 491ffdc7f1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 779c9cb17d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:33:18 +02:00
Jonathan Druart ef76977da6
Bug 40350: Remove warnings from t/db_dependent/Holds.t
Use of uninitialized value in numeric le (<=) at /kohadevbox/koha/C4/Circulation.pm line 3151.
Use of uninitialized value in addition (+) at /kohadevbox/koha/C4/Circulation.pm line 3158.
Use of uninitialized value in numeric le (<=) at /kohadevbox/koha/C4/Circulation.pm line 3151.
Use of uninitialized value in addition (+) at /kohadevbox/koha/C4/Circulation.pm line 3158.
Use of uninitialized value in numeric le (<=) at /kohadevbox/koha/C4/Circulation.pm line 3151.
Use of uninitialized value in addition (+) at /kohadevbox/koha/C4/Circulation.pm line 3158.

$issue->renewal_count is undefined in C4::Circulation:3151, but it's NOT
NULL in DB
We need to refetch the row to get the default defined at the DB level

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 53b3d5756e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit a067120e70)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:29:50 +02:00
Jonathan Druart 266523f2fe
Bug 40351: Remove warning from oha/SearchEngine/Elasticsearch/Search.t
Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 536.

I think this is the correct fix. We generate a random av category that
is used in the data, so $label get undef:
521                 $label = $authorised_values{$t};

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d6cbe0a25e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9f6088d48b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:26:23 +02:00
Jonathan Druart 202cf023e4
Bug 40353: Remove warnings from Koha/Patron.t
C4::Context->userenv not defined! at /kohadevbox/koha/Koha/Patron.pm line 2152.
C4::Context->userenv not defined! at /kohadevbox/koha/Koha/Patron.pm line 2152.
C4::Context->userenv not defined! at /kohadevbox/koha/Koha/Patron.pm line 2152.

We need to mock the userenv

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3b1bc1bbc5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b010fc5d49)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:22:41 +02:00
Jonathan Druart 2eb7815500
Bug 40348: Remove warnings from api/v1/two_factor_auth.t
02:28:36 koha_1       | WARNING: The key derivation method "opensslv1" is deprecated. Using -pbkdf=>'pbkdf2' would be better.
02:28:36 koha_1       | Pass -nodeprecate=>1 to inhibit this message.
02:28:36 koha_1       |  at /kohadevbox/koha/Koha/Patron.pm line 3216.

We should deal with that on a separate bug report. For now we can remove
the warnings from the log/output.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 12e4e92e53)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d0727bab0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 11:21:35 +02:00
Jonathan Druart 2dfa858d05
Bug 40002: Add a cypress test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit da75bdc692)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 0b9c7a09d3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 10:32:15 +02:00
Jonathan Druart 2ca099d72c
Bug 40002: Fix filtering of patrons by 'Browse by last name'
We cannot longer filter patrons by first letter, the browser errors
"Uncaught TypeError: v.replace is not a function"

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ea359a10a9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 61f9a253e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 10:32:15 +02:00
Tomas Cohen Arazi 889c45effe
Bug 39932: Remove split in template
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8d9bdbde07)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 10:26:09 +02:00
Tomas Cohen Arazi e22234ff25
Bug 39932: Add POD for Koha::Item->_status()
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4609ffd715)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 10:24:28 +02:00
Tomas Cohen Arazi 0c09ee06e7
Bug 39932: Make Koha::Item->_status return an arrayref
This patch makes the method return an actual array instead of a
comma-separated string. The API spec is adjusted so it also expects an
array in the response.

Tests are adjusted for the new return value.

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ffab355be0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 10:24:28 +02:00
Baptiste Wojtkowski 2d5d29e164
Bug 37334: [24.11] Allow filter holdings table by status (squashed) 2025-08-01 10:22:42 +02:00
Jonathan Druart 71678de6d5
Bug 40168: Remove cleanup() call from afterEach
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6096d986d5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 61d0294e62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 09:44:51 +02:00
Jonathan Druart f54810d82b
Bug 40168: Restore afterEach in KohaTable Cypress tests
We defined an anonymous function inside an arrow function, and Cypress does not call it.

Test plan:
Set AlwaysShowHoldingsTableFilters to "Do not"
Run t/cypress/integration/KohaTable/Holdings_spec.ts:
  yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts

When done, have a look at the value of AlwaysShowHoldingsTableFilters
=> without this patch it has been modified (not restored) and is set to
"Do"
=> With this patch applied the original value is restored at the end of
the tests (actually the end of each test)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b83df697de)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 98ca5b0800)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 09:44:50 +02:00
Jonathan Druart 2a26f2e137
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>
(cherry picked from commit 27292c9ea2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 09:44:24 +02:00
Jonathan Druart 4031c7997e
Bug 40347: Remove warnings from Koha/Hold.t
Those diag statements are not really needed

    # Filling a hold when pref enabled should trigger a test
    # Filling a hold when pref disabled should not trigger a test
    # Updating a hold location when pref disabled should not trigger a test
    # Updating a hold location when pref enabled should trigger a test
    # Update with no change to pickup location should not trigger a test

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b6c8cee965)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cfe55afa92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:49:41 +02:00
Jonathan Druart c08ce7a820
Bug 40169: mockData - Do not replace _id if passed
If we build an object and pass a primary key (ie. suffixed by _id) we
should not replace it.

Test plan:
The test highlights the problem, it won't affect existing tests.
0. Apply only the first patch (Cypress tests)
1. Run yarn cypress run t/cypress/integration/t/mockData.ts
=> It fails
2. Apply this patch
=> It passes

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

Amended-by: Jonathan Druart
Remove .only

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0aaf193a75)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b1ce0e9f57)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:47:12 +02:00
Jonathan Druart 1d101539f2
Bug 40169: Add a test
Signed-off-by: David Nind <david@davidnind.com>

Amended by: Jonathan Druart
Remove .only

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ea703016d4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c0752f2312)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:47:12 +02:00
Jonathan Druart c162765890
Bug 39315: (bug 38108 follow-up) Add Cypress tests
1. We move from const to var so that we can modify the value of the
variable from the Cypress tests.

2. Also remove win.libraries_map as it seems that our code is no longer
failing if it's missing (we added more checks I guess)

3. Improved selectors for the show/hide filters links
-                    cy.get(".hide_filters").click();
+                    cy.get(`.${table_id}_table_controls .hide_filters`).click();

Test plan:
Both commands should pass
 yarn cypress run --spec t/cypress/integration/PatronSearch_spec.ts
 yarn cypress run --spec t/cypress/integration/t/mockData.ts

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e1cbc7780a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:43:00 +02:00
Jonathan Druart 151ce99934
Bug 39315: MockData - generate full objects for libraries and item types
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cb384b2a1c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:43:00 +02:00
Jonathan Druart b882c3e2ef
Bug 39315: Move holdings Cypress tests to a separate file
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d3ae289b0f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:43:00 +02:00
Jonathan Druart 297913d960
Bug 39315: Move KohaTable cypress tests to a separate directory
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8d30b2aa28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:40:35 +02:00
Martin Renvoize 542f1930cd
Bug 39011: (follow-up) Update selenium tests
We alter how the options are added to the patrons_search datatables
search bar, but we didn't update the selenium test to match.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1941a0c87e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:34:16 +02:00
Martin Renvoize 6a6895cefc
Bug 39011: (follow-up) JSDoc
Add some initial JSDoc for the enhancments to datatables we introduce
here.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8ca6245a38)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:34:14 +02:00
Jonathan Druart 72ea5fd9db
Bug 39011: Apply the pre-process to column filters
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4fcff9db9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:33:23 +02:00
Jonathan Druart d0c58725b8
Bug 39011: Pre-process coded values when building the query
When a column contains authorised/coded values, it is not possible to
search on the description. It is confusing for the user as the
description is the value displayed in the table.

We have discussed this already on bug 38130 and decided to fix the
problem by doing a new SQL join. But this can lead to performance
issues, especially for tables like the items table where a lot of coded
values are displayed.

This patch suggests to do a pre-processing step, before the query is
sent, to let the client build the query it needs.

An alternative approach would be to do the same job server-side, and
allow this kind of processing for all the attributes with a object using
columns_to_str. But we will certainly reach performance problems.

This is still not perfect, but it's fixing a regression quite easily,
and will open the door to more fixes for tables using coded values.

This patch revert one we have done on bug 38130, and use this new
mecanism for home library, holding library, item type and collection
code.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c67130078b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:33:21 +02:00
Janusz Kaczmarek 21750d46f8
Bug 40128: Unit tests
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 26f17cbf68)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6fd4a80c32)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:18:10 +02:00
Janusz Kaczmarek ba0f50fb01
Bug 40128: StripWhitespaceChars can create empty subfields
When StripWhitespaceChars is enabled and the user by chance enters
some white spaces in the input field, Koha generates empty subfield
(or even entirely empty field).

Test plan:
==========
1. Enable StripWhitespaceChars system preference.
2. Edit an existing record, putting just some spaces into an empty
   subfield. Save the record.
3. Go to bibliographic record Normal view and in modal "MARC preview"
   notice that the subfield you entered spaces in exists as an empty
   subfield. If it was the only subfield in a field, the field exists
   with no data at all. This is wrong.
4. Apply the patch ; restart_all.
5. Repeat 2. and 3. You should not see any empty subfield now. If the
   empty subbfield was the only subfield in a field, the field should
   have been removed from the record.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d0ce815600)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f48cb7a0f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:18:10 +02:00
Matthias Le Gac 512fda81e4
Bug 34157: Exporting labels as a barcode range can cause 500 error
This fixes the error 500 generated when using the label
generator if you use the "Bibliographic data precedes
barcode" layout type when printing a barcode range.

Test plan:
1. Set up information for testing:
   1.1 Create a new label layout:
       1.1.1 Cataloging > Tools > Label creator
       1.1.2 New > Label layout
       1.1.3 Add these details:
             - Layout name: BZ34157
             - Choose layout type: Bibliographic data precedes barcode
             - Select 'List fieds'
             - Data fields: add some text at the end
                title, author, isbn, issn, itemtype, barcode,
                itemcallnumber, 'Some text'
       1.1.3 Save
   1.2 Ranges of barcode numbers for testing:
       1.2.1 Where the numbers are not used in KTD, and are LOWER than
             the highest barcode number (39999000019193):
             500000 to 500100
       1.2.3 Where the numbers are not used in KTD, and are HIGHER than
             the highest barcode number (39999000019193):
             39999000020000 to 39999000020100
       1.2.2 Where the numbers are used in KTD:
             3999900000001 to 3999900001001
2. Print a barcode range using the ranges in 1.2:
   2.1 Cataloging > Tools > Label creator > Print barcode range
   2.2 Enter the barcode ranges
   2.3 Select a layout to be applied: BZ34157
   2.4 Export
   2.5 Click "Download as PDF"
   2.6 Results for all barcode ranges:
       ==> You get a page with "An error has occured! Error 500...".
3. Repeat step 2, but select the DEFAULT layout for 2.3:
   ==> Results for all barcode ranges: PDFs with barcode labels
       successfully generated
4. Apply the patches and restart everything (restart_all)
5. Repeat steps 2 and 3.
6. Results for all barcode ranges and the BZ34157 and DEFAULT layouts:
   ==> PDFs with barcode labels successfully generated

Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: David Nind <david@davidnind.com>

Bug 34157: (Follow up) Removed the debugging data

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

Bug 34157: (follow-up) Tidiness fix

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Squashed
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0a51460e2c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d212c89d81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:15:12 +02:00
Emily Lamancusa 0cd39c8d9a
Bug 40370: (QA follow-up) Change raw filter to html
The diff doesn't contain intentional HTML formatting, and pre tags do
not prevent un-escaped HTML from being interpreted, so we should not
use the raw filter here

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c702e2ea4e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 37a4ec3c0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:11:54 +02:00
David Cook 805f19c806
Bug 40370: Remove incorrect DB audit instruction and fix HTML formatting
This change removes the incorrect instruction from about.pl:
"Run the following SQL to fix the database" and fixes the HTML
formatting so that the line "-- Convert schema '' to '':;" is
displayed correctly at the start of the line.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/about.pl?tab=database
2. Note that "Run the following SQL to fix the database" no
longer appears and "--Convert schema '' to '':;" starts
at the beginning of the line instead of with leading whitespaces.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6699bdb142)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6f11fcb48d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:11:32 +02:00
Lucas Gass acadcb41b7
Bug 39881: Add patron card number to transfers to receive table
To test:
0. APPLY PATCH
1. Transfer an item from Library A to Library B
2. Place and item-level hold on the item
3. Set library to Library B
4. Go to Circulation >  Transfers to receive
5. In the 'On hold for' column you should now see the patron card number.

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 295fd3bf89)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9fcc9a30f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:02:36 +02:00
Andrew Fuerste Henry 23f1445879
Bug 40332: Show tools sidebar category for batch extend due dates permission
To test:
1 - have or create a user with the permissions batch_extend_due_dates edit_quotes but no other Tools
2 - log into koha as that user, go to Tools module, confirm both Batch Extend Due Dates and Quote Editor are available from the Tools module home page
3 - Click into either available tool, confirm the sidebar menu contains the category Additional Tools and a link to Quote Editor, but nothing else
4 - add the edit_notices permission to your user
5 - reload your page from step 3, confirm the sidebar menu now also contains the Patrons & Circulation category with both Notices & Slips and Batch Extend Due Dates.
6 - apply patch, restart services, reload page, confirm nothing has changed
7 - remove the edit_notices permission from your user
8 - reload your page from step 3, confirm the sidebar menu now contains the Patrons & Circulation category with only Batch Extend Due Dates.

Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e98fab0502)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 94a50dd6e6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 15:51:55 +02:00
Emily Lamancusa 0d3ffab860
Bug 39572: Improve EDIFACT order confirmation message
Add EAN account information to EDIFACT order confirmation message
when the BasketConfirmations system preference is enabled.

To test:
1. Set EDIFACT system preference to Enable
2. Set BasketConfirmations system preference to Enable
3. Create at least 2 EANs, one with a description and one without a
   description
   i. Go to Acquisitions > Library EANs
   ii. Click "New EAN" and fill in the fields
4. Create an EDI account
   i. Go to Acquisitions > EDI accounts
   ii. Click "New account"
   iii. Click Submit (for testing purposes you don't need to fill in
         the fields)
5. Find or create a basket for the same vendor that's on the EDI account
6. Add an order to the basket from any source
7. In the menu bar at the top of the basket screen, click "Create
   EDIFACT order" and select an EAN
--> Note that the confirmation page doesn't tell you which EAN was
    selected
8. Click "No, don't close"
9. Apply patch and restart_all
10. Repeat step 7
--> The confirmation page should now display both the basket and the
    selected EAN
11. Click "Cancel"
--> Confirm that the basket is still open
12. Repeat step 7
13. Click "Yes, generate order and close basket"
--> Confirm the basket is closed
14. Click "EDIFACT messages" in the sidebar menu
--> Confirm that you see a message with type ORDERS for that basket

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c9e5029b3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ea49cfb38b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 15:48:37 +02:00
Fridolin Somers 2de7cf8b86
Bug 40088: Do not show edit button for default framework
In Administration > MARC bibliographic frameworks > "MARC structure":
Do not show "Edit framework" button in tools bar since one can not edit
the default framework description.
Currently it leads to new framework creation.

Test plan :
1) Go to Administration > MARC bibliographic frameworks
2) On default framework row, click Actions > MARC structure
3) Check you dont see in tool bar "Edit framework" button
4) Go to Administration > MARC bibliographic frameworks
5) On a framework row (not default one), click Actions > MARC structure
6) Check you see in tool bar "Edit framework" button

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 c3eccceae5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5f8958d220)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 15:29:03 +02:00
Fridolin Somers a234ec29a9
Bug 39827: Fix framework code in edit framework button
In Administration > MARC bibliographic frameworks the "Edit framework" button in tools bar always edits default framework

Test plan :
1) Go to Administration > MARC bibliographic frameworks
2) On any framework except default one click on actions then "MARC structure"
3) In tools bar click on "Edit framework"
4) Check you are editing the correct framework

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e8dcf3e898)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 15:28:28 +02:00
Lari Strand a24bb09254
Bug 32934: Correctly honor the no block due date for SIP checkout messages
**Problem:**
When using SIP checkout messages with the "no block" flag, the specified due date
was being ignored. Instead of honoring the provided due date, the system would:
1. Use the due date as the transaction timestamp (incorrect behavior)
2. Calculate a new due date based on circulation rules
3. Return an empty due date field (AH) in the SIP response

This affected SIP2 integrations where external systems needed to specify exact
due dates for checkouts, particularly for offline circulation scenarios.

**Root Cause:**
The `ProcessOfflineIssue` function in C4::Circulation was only returning a
success/failure message, but the SIP checkout transaction needed access to the
resulting checkout object to properly set the due date. The SIP Transaction::Checkout
module was calling `ProcessOfflineIssue` but couldn't retrieve the checkout details
to populate the transaction's due date field.

**Solution:**
1. Modified `ProcessOfflineIssue` to return both the status message AND the checkout
   object: `return ( "Success.", $checkout );`
2. Updated `ProcessOfflineOperation` to handle the new return format by capturing
   only the message: `( $report ) = ProcessOfflineIssue( $operation );`
3. Modified SIP Transaction::Checkout to capture both return values and use the
   checkout object to set the proper due date via `duedatefromissue`
4. Fixed the timestamp parameter to use `dt_from_string` instead of the due date

**Test Plan:**
1. **Unit Tests:**
   - Run `prove t/db_dependent/Circulation/OfflineCirculation.t` to verify
     ProcessOfflineIssue returns checkout object and respects due_date parameter
   - Run `prove t/db_dependent/SIP/Transaction.t` to verify SIP checkout honors
     no_block_due_date parameter

2. **Manual SIP Testing:**
   - Connect to SIP server via telnet on port 6001
   - Send checkout message with no block flag and specific due date:
     `111YN20250115    18000120241201    180001AP|AO|AC|AD|AB<barcode>|AA<cardnumber>|`
   - Verify response contains correct due date in AH field
   - Verify checkout record in database has the specified due date

3. **Regression Testing:**
   - Verify normal SIP checkouts (without no block) still work correctly
   - Verify offline circulation operations continue to function
   - Verify ProcessOfflineOperation still processes queued operations correctly

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4d069e5006)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d1f3ba0767)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 15:03:31 +02:00
Martin Renvoize 5cfd349d10
Bug 32934: Unit tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 04ab86f1f7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ecdcdcfb75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 15:02:17 +02:00
Andrii Nugged 84321c9b15
Bug 40092: Fill auto-populated control fields in MARC editors
Problem: Clicking Save doesn't fill control fields automatically in both the authority and bibliographic MARC editors.

Regression introduced when class `framework_plugin` was added: `AreMandatoriesNotOk()` rewrites the element `class` attribute with a hard‑coded string, dropping existing classes. Because the plugins that populate 000/003/005/008 rely on `framework_plugin`, the inputs are skipped and the fields remain empty.

This patch stops clobbering the attribute and instead appends the visual 'notFilled' class via `elt.classList.add()`. The one-line fix is applied in both `authorities.tt` and `addbiblio.tt`.

Test plan:

Authority editor

1. Authorities → New authority → choose framework (e.g. Topical term).
2. Leave all fields blank, click Save.
   Before patch: 000, 003, 008 remain blank; required tags turn yellow.
3. Apply patch, hard‑refresh, repeat steps 1–2.
   After patch: control fields auto‑populate as in 24.11.

Bibliographic editor

1. Cataloguing → New record (Not in Advanced MARC editor).
2. Click Save without entering data.
   Before patch: control fields stay blank; record cannot be saved.
3. Apply patch, hard‑refresh, repeat.
   After patch: record is blocked, but 000/005/008 auto‑populate.

Both editors behave like 24.11; mandatory highlighting still works.

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 4c4023c41c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3fd87e0ddd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 14:54:29 +02:00
Owen Leonard e17a2a4fc1
Bug 40111: Fix title sorting on two reports
This patch modifies two reports in order to correct sorting on title
columns.

To test, apply the patch and got to reports -> Lost items.

- Run the report with parameters that will return multiple results.
  - Test sorting the title column. The articles 'a', 'an', and 'the'
    should be ignored.
- Perform the same test with the "Orders by fund" report.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b94f53291c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit bd43f8df50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 14:46:16 +02:00
Owen Leonard 17c8c770c2
Bug 40165: Incomplete logic for controlling display of OPAC language footer
This patch adds some additional logic to the template which controls the
appearance of the footer in the OPAC. Some additional checks are
required to make sure an empty footer doesn't display in some
circumstances.

To test, apply the patch and install at least one additional translation
besides English.

Check any OPAC page when various combinations of system preferences are
enabled:

- opaclanguagesdisplay
- OPACLanguages
- OpacLangSelectorMode
- OPACReportProblem
- CookieConsent
- OpacKohaUurl

In particular, confirm that there is not an empty footer when
opaclanguagesdisplay is enabled but there is only one translation
enabled.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 78b8a2e6f1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7aca5cfa90)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 14:42:34 +02:00
Fridolin Somers 46abe2fafb
Revert "Bug 36586: Define self-checkin timer using Javascript class"
This reverts commit b5bc9cf343.
2025-07-31 14:34:37 +02:00
Jonathan Druart 11b58bc552
Bug 40317: Remove warnings from Auth_with_shibboleth.t output
t/db_dependent/Auth_with_shibboleth.t .. 1/5 GetPreparedLetter called at t/db_dependent/Auth_with_shibboleth.t line 73.
EnqueueLetter called at t/db_dependent/Auth_with_shibboleth.t line 80.
SendQueuedMessages called with message_id: 42 at t/db_dependent/Auth_with_shibboleth.t line 90.

Not sure what exactly is going on here, but warnings_are is not supposed
to show the warnings in the output. I think it's because of the logger
mock. A workaround is to use a variable we increment then compare to see
if we reach the sub.

Test plan:
  % prove t/db_dependent/Auth_with_shibboleth.t
should return green without warnings

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f8fd672602)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 6d12848ba3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 14:13:46 +02:00
Jonathan Druart 4ce645a170
Bug 40316: Remove warnings from selenium/regressions.t
Wide character in print at /usr/share/perl/5.36/Test2/Formatter/TAP.pm line 156.

Test plan:
Confirm that
  % prove t/db_dependent/selenium/regressions.t
still passes and does not generate warnings

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5f44a5ef5a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit fc9647c5ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 14:05:45 +02:00
William Lavoie 5adb51cdd3
Bug 19113: Barcode value builder not working with numeric branchcode
The regexp for the value builder 'hbyymmincr' doesn't allow for numerics in the branchcode,
so the nextnum found is always 0 and multiple Add always generate the same barcode.
This simply allow for numerics within the regex.

Test
- It's a bit complicated.  You need
   - all your branchcodes to be numerics (01,02,71...)
   - all barcodes to already be a bunch of numbers
- Modify the syspref 'autobarcode' to hbyymmincr, the home branch + date one.
- Find an item in the pro-search,
- New -> New Item
- Click on the 'p' to have the value builder create the next barcode.
   - Without the patch, the query won't have found anything, so it'll suggest xxxxxx0001
- Click Add.  It reprensent the form to enter another one.
   - Click on the 'p' edit box, it'll offer you again xxxxxx0001
With the patch, it'll offer valid ones everytime.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit db067d48ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 10:27:42 +02:00
Phil Ringnalda b4dca4bf67
Bug 39293: Remove box around subfield tag in basic editor
Prior to the Bootstrap 5 update, the feature of editing subfield codes in the
basic editor was kept subtle by putting the code in an <input>, but removing
the border around the input, so it required either knowing the feature exists
or accidentally clicking on or around the single letter code and seeing it
turn into an editable input.

This patch removes the border again, because when people accidentally see the
feature, they are sometimes not pleased to see it.

Test plan:
1. Without the patch, open the cataloging basic editor and switch to the "1"
   tab with the 100 fields.
2. Note that the codes for the subfields are clearly in editable inputs.
3. Apply patch, reload the editor page.
4. Note that now the codes look like just plain text, until you actually
   click on or very near the letter, when they become visible as inputs
   by having the focus border.

Sponsored-by: Chetco Community Public Library
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cfb5d05ed9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 09:57:40 +02:00
Jonathan Druart 9399d5f794
Bug 40277: Add a test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1c7cb4d43b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 342f6465f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 11:03:56 +02:00
Fridolin Somers d16a366e10
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>
(cherry picked from commit 8854037fbd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 11:03:55 +02:00
Martin Renvoize ed1226827d
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>
(cherry picked from commit ad7a9355a3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:55:22 +02:00
Martin Renvoize 8f4dff1c76
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>
(cherry picked from commit a5949e7575)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:55:22 +02:00
Martin Renvoize 12837d0773
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>
(cherry picked from commit ac2ca31d87)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:50:52 +02:00
Tomas Cohen Arazi 4cd03fcb73
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>
(cherry picked from commit 61b3019600)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:46:31 +02:00
Owen Leonard 80ba31f7b1
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>
(cherry picked from commit 3e0f04851f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:43:22 +02:00
Lucas Gass 2048da14f2
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>
(cherry picked from commit aed4eb5974)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:39:01 +02:00
Owen Leonard 5eb4acc1d4
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>
(cherry picked from commit fe3f83e492)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:35:08 +02:00
Emily Lamancusa 2025ddf3e7
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>
(cherry picked from commit 25c36c5884)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:33:13 +02:00
Fridolin Somers 839fc4e7a6
Bug 34776: [24.11.x] fix folding
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:27:43 +02:00
Emmi Takkinen 27262c0058
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>
(cherry picked from commit a57bd07127)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:22:07 +02:00
Emmi Takkinen 4e591a268e
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>
(cherry picked from commit 7fc5b0b0f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:22:07 +02:00
Marcel de Rooy c59dfb40b1
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>
(cherry picked from commit 3b031ce510)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:22:06 +02:00
Emmi Takkinen f2fb8844e8
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>
(cherry picked from commit 8d496f1bed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:21:00 +02:00
Marcel de Rooy 93349248df
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>
(cherry picked from commit 7ed54da4f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:09:52 +02:00
Emily Lamancusa 7b9078a99b
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>
(cherry picked from commit 2e206204c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:09:20 +02:00
Tomas Cohen Arazi 7a2bb02df0
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>
(cherry picked from commit 377602a36d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-28 10:01:58 +02:00
Owen Leonard 5f08cccbad
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>
(cherry picked from commit e377e09840)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:57:54 +02:00
Owen Leonard 859bf3c69c
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>
(cherry picked from commit d7bf63a327)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:54:11 +02:00
Mason James 35dee71d00
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>
(cherry picked from commit 14662a012e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:52:08 +02:00
Martin Renvoize 8842423b18
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>
(cherry picked from commit 1ab7ccde18)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:49:49 +02:00
Martin Renvoize b513d654d8
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>
(cherry picked from commit ceb1f9f230)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:48:58 +02:00
Martin Renvoize e0fa74360b
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>
(cherry picked from commit 421968355e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:48:57 +02:00
Martin Renvoize 79a3ff3dec
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>
(cherry picked from commit fb2899f311)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:48:57 +02:00
Fridolin Somers ff0a32a714
Bug 40022: Add the 25.11 release team (squashed) 2025-07-25 16:39:02 +02:00
Nick Clemens 2edc07b710
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>
(cherry picked from commit 87043c9f53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:16:22 +02:00
Marcel de Rooy 4af0a13ff3
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>
(cherry picked from commit 816b4537e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 16:11:15 +02:00
Lucas Gass 1ce5104666
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>
(cherry picked from commit ec04bbbb62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:47:57 +02:00
Tomas Cohen Arazi 05d43daabf
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>
(cherry picked from commit 3042fa93d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:43:26 +02:00
Tomas Cohen Arazi 89a20a36ca
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>
(cherry picked from commit ec396bfdd4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:42:08 +02:00
Baptiste Wojtkowski c065e16b8d
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>
(cherry picked from commit 5ffdf17098)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:40:54 +02:00
Alexander Blanchard 2ae12cf6c2
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>
(cherry picked from commit f222847062)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:39:45 +02:00
Jonathan Druart fda49309c0
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>
(cherry picked from commit ce72073ff5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:30:35 +02:00
Jonathan Druart 80da7586dc
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>
(cherry picked from commit 7c33240af2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:30:34 +02:00
Pedro Amorim 39aa9c13ce
Bug 40122: [24.11] Dont attempt regex search for select dropdowns
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:26:55 +02:00
Pedro Amorim 22fbc90da1
Bug 40118: [24.11] Squashed patch for 24.11
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:26:54 +02:00
Jonathan Druart 4dbb5cdf67
Bug 39473: Use exact search for column filtering with dropdown
We need to use an exact search when using the id of an option.

Test plan:
0. If not using default KTD data, create an item type with the following settings:
   Item type: BK
   Description: Books
   leave all other values on their defaults

1. Create a new item type with the following settings:
   Item type: BKA
   Description: Other type of book
   leave all other values on their defaults

2. Add or edit items on a bib record so that the record has at least one item of type "Books" and at least one item of type "Another type of book"

3. Go to Normal View for that bib record

4. Click "Show filters" above the item holdings table

5. In the Item type column, filter by "Books"
Only "Books" items show in the table

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ec2fbc0d81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:12:00 +02:00
Owen Leonard 5ab075a7ab
Bug 40108: Fix print receipt option in self-checkout
The self-checkout logout process, with SelfCheckReceiptPrompt enabled,
asks the user if they want to print a receipt. Because of an error in
time calculation the system always believed the process had timed out
and wouldn't print the receipt.

Before we implemented a modal dialog to ask for confirmation upon
self-checkout logout, it was necessary to have a timeout function built
into the process. See Bug 11498.

The modal no longer blocks the page timeout function, so this time
calculation is obsolete and can be removed.

To test, apply the patch and go to the self-checkout module.

- Make sure the SelfCheckReceiptPrompt system preference is enabled.
- Log in as a user for doing self-checkout.
- Click the "Finish" button.
  - You should see a dialog, "Would you like to print a receipt?"
  - Clicking "Print receipt..." should open a new window with your
    receipt and log you out of the self-checkout system.
  - Clicking "End session" should end your session without triggering a
    popup.
- Set the SelfCheckTimeout system preference to something very low, like
  10 seconds.
  - Perform the same test as above, but after triggering the dialog wait
    10 seconds for the timeout to trigger.
  - The page should reload automatically and log you out.
- Disable the SelfCheckReceiptPrompt system preference.
  - Perform the same tests to confirm that clicking the "Finish" button
    logs you out immediately without offering to print a slip.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6f147f4116)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit cf2d0dd69a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 15:00:54 +02:00
Owen Leonard 4fc4761a95
Bug 39499: Add some padding to the Save button in the sticky bar in cataloging
This patch corrects a regression in the style of the floating toolbar on
the basic MARC editor page. There should be comfortable padding around
the "Save" button while keeping the toolbar's full width matching the
tab panels.

To test, apply the patch and clear your browser cache if necessary.

- Go to Cataloging -> New record.
- The toolbar with the "Save" button should look correct.
- The container with the tab buttons right below that should be the same
  width as the tab panel.
- Scroll down and confirm that everything looks good when the toolbar is
  floating.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Michelle Spinney <mspinney@clamsnet.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0e43eed8c0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 16727da95c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:55:56 +02:00
Kyle M Hall 8e1d10cbfd
Bug 39903: Catalog details page emits error if librarian cannot moderate comments on the record
If a librarian cannot moderate comments and a bib has comments, the
error "Something went wrong when loading the table." will pop up during
the page load.

Test Plan:
1) Add a comment to a record
2) Log in to the staff interface with a librarian that cannot moderate
   comments
3) Browse to the "Normal" view for that record
4) Note the error message
5) Apply this patch
6) Reload the page
7) No error!

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ca1af51349)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 67d20ed350)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:53:40 +02:00
Nick Clemens a47375fdd3
Bug 40166: Fix typo for all ips in ILSDIAuthorizedIPs
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7e9c897c03)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 26242dbe8b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:51:28 +02:00
Kyle M Hall 034feb6951
Bug 37439: Fix misleading ChildNeedsGuarantor description
Unless I misunderstood the purpose of the ChildNeedsGuarantor system preference, I  think the description is misleading.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch, reloaded the syspref page for ChildNeedsGuarantor,
verified the new description looks OK.
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ee57c56eeb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c8f1779c20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:50:04 +02:00
Laura_Escamilla e0b5ad0edc
Bug 33440: Tests
Test Plan
1. Staff member A creates a public list.
2. Staff member A transfers this public list to another staff member (staff member b) without list permissions.
3. Staff Member B now has the ability to edit this public list and add/remove items from this list.
4. Apply the patch
5. Repeat steps 1 and 2. An error message should now appear stating that the “Transfer not allowed: You or the selected user do not have the required permissions.”
6. Provide the correct permissions to Staff Member B. Initiate the transfer again. The transfer should be successful.
7. Test these steps in the OPAC as well.
8. Prove t/db_dependent/Virtualshelves.t
9. Sign off and have a wonderful day! :D

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 45c7020220)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7ed45d8d15)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:35:30 +02:00
Laura_Escamilla bef7058550
Bug 33440: Updated wording for unauthorized_transfer OPAC message
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7a98edf427)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 831a8bf9b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:30:32 +02:00
Laura_Escamilla 86dc876a56
Bug 33440: Updated wording for unauthorized_transfer error message
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e7b790e3a6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 82041841e5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:30:32 +02:00
Laura_Escamilla 6e3b07a00c
Bug 33440: Added permission requirements to unauthorized_transfer
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0edf689870)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit acae50f177)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:30:31 +02:00
Marcel de Rooy 4077d3f156
Bug 40119: (QA follow-up) Small additional comment
The reference to this bug report may be helpful to understand
later why we did so.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 01526ef545)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4efb86aec8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:28:18 +02:00
Janusz Kaczmarek 31922cb5cf
Bug 40119: Unit tests
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5eeb04be97)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8119ed0405)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:27:25 +02:00
Janusz Kaczmarek 08fefb0a1f
Bug 40119: Merge should not leave empty 6XX subfield $2 (MARC 21)
Currently, when removing 040 $f from authority record with 008/11 =
'z' (MARC 21), merge function removes the content of $2 subfield in
linked 6XX fields, leaving the 6XX $2 subfield empty.  This is not
correct.  We should not have empty subfields in a MARC record.

Instead, the old content of the $2 subfield should be retained (if
auth 008/11 is still = 'z').

Test plan:
==========
1. Have an authority record with 008/11 = 'z' and 040 $f = 'whatever'.
2. Link the record to a bibliographic 6XX.
3. Edit the authority record, removing 040 $f.
4. Go to bibliographic record and in modal "MARC preview" from Normal
   view notice that 6XX $2 exists but is empty. This is wrong.
5. Apply the patch ; restart all.
6. Repeat p. 1.-4. Note that the content of 6XX $2 has not been
   removed.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bd43ebdc5e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ba31b8cc35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:26:23 +02:00
Martin Renvoize 88a23dfc20
Bug 40080: Fix search position on course reserves page
This patch corrects the position of the table search box on the course
reserves details pages by warpping the presented table in a 'rows' class
div.

We also update the search box dom configuration in the datatable itself
to match that of other opac tables.

Test plan
1) Add some course reserves to a course
2) View that course on the OPAC
3) Note that the search box for the table is aligned to the top of the
   main section of the page and over to the far right almost off screen.
4) Apply this patch
5) Confirm that the display of the search box is now nested just above
   the table in the same location as the course reserves list page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 32242f438a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d0dc3ffd71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:18:59 +02:00
Tomas Cohen Arazi 25bcc23a3c
Bug 39911: Remove redundant warn
Following the original test plan you notice, `THIS IS A TEST` is printed
twice:

* In the logs.
* In STDERR for the SIP server.

The latter is redundant, and also problematic for
`xt/author/pod_coverage.t` which fails the `no warnings` tests because
of that.

To test:
1. Run:
   $ ktd --shell
  k$ prove xt/author/pod_coverage.t
=> FAIL: Scary errors, lots of them
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Follow the original bug test plan
=> SUCCESS: There's `THIS IS A TEST` in the logs, which was the author's
goal in the first place.
5. Sign off :-D
6. Visit bug 40144 :-P

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9a4fd4facb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 036d940d54)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:15:42 +02:00
Kyle M Hall 5f9bf7974e
Bug 39911: Add POD
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 702d1d2792)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 90aca69657)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:15:41 +02:00
Kyle M Hall 46b433ee20
Bug 39911: Trap DIE signals in SIP server
At some point our SIP server stopped logging fatal errors to either logs or standard error. We should restore this vital functionality.

Test Plan:
1) Apply the first patch which will cause the patron information request
   to fail
2) Stop the SIP server
3) Start it again with: perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
4) Trigger the failure with the following command:
   ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l MPL --patron koha -m patron_information
5) Note "THIS IS A TEST" is not found in logs or stderr
6) Apply the second patch
7) Repeat steps 2-4
8) Note the error message is now visible from stderr at the command line
   and also in the SIP log

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f214db14dd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7c06904612)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:15:41 +02:00
David Cook b625a562cd
Bug 40087: Fix t/Scrubber.t unit test
Remove "tag" and "staff" and add the missing "note"

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 1d10d8b8c9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ce008cf965)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:13:02 +02:00
David Cook 5332be872c
Bug 40087: Remove "tag" and "staff" scrubber profiles
This patch removes unused "tag" and "staff" scrubber profiles.

Test plan:
0. Apply the patch
1. prove t/Koha/Plugins/HtmlScrubber.t
2. prove t/Scrubber.t
3. Grep around the code for C4::Scrubber and make sure "tag"
and "staff" aren't used as arguments for C4::Scrubber

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 e846abeeb7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f72d9f2962)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:12:13 +02:00
Owen Leonard 2fed47325b
Bug 39919: Overdues with fines report has incorrect title, breadcrumbs, etc.
This patch corrects the "Overdues with fines" page so that the page
title, breadcrumbs, and main heading match the name used in navigation
menus.

To test, apply the patch and go to Circulation -> Overdues with fines.
Confirm that the page title, breadcrumb menu, and page heading are
correct: "Overdues with fines at [library]"

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 28cf1da6ea)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 1210d6aafa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:08:46 +02:00
Tomas Cohen Arazi 8522161152
Bug 39961: (follow-up) Make `koha-disable` stop all queues
This patch applies the same logic to `koha-disable`.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d2ffae92a7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 79f69e7e4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:04:34 +02:00
Tomas Cohen Arazi 00bfca0a3f
Bug 39961: Make `koha-create` start all queues
Taking advantage of the `get_worker_queues` function introduced in bug
31124, this patch makes `koha-create` start all defined queues.

To test:
1. Run:
   $ ktd --shell
  k$ sudo -s
  k$ koha-create --create-db test
=> FAIL: No mention of `long_tasks`
2. Apply 31124 and then this patch
3. Run:
  k$ cp debian/scripts/koha-functions.sh \
        /usr/share/koha/bin/koha-functions.sh
  k$ debian/scripts/koha-create --create-db test1
=> SUCCESS: `long_tasks` worker is started
4. Sign off :-D

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 45089704fa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5a6ad66117)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:04:33 +02:00
Tomas Cohen Arazi 1fc68a8d3c
Bug 31124: Make koha-remove stop all workers
This patch makes two things:

* Adds a `get_worker_queues` function to koha-functions.sh
* Makes `koha-remove` loop through all the defined queues to stop all
  the running workers before trying to remove the unix user for the
  instance.

To test:
1. Run:
   $ ktd --shell
  k$ sudo -s
  k$ koha-create --create-db test1
  k$ service koha-common restart
  k$ koha-remove test1
=> FAIL: There's an error about not being able to drop the instance user
2. Run:
  k$ ps -ef | grep test1
=> FAIL: There's a running process for the 'long_tasks' queue worker.
3. Apply this patch
4. Run:
  k$ cp debian/scripts/koha-functions.sh \
        /usr/share/koha/bin/koha-functions.sh
5. Repeat 1 naming the instance `test2`
=> SUCCESS: The instance is removed correctly. No error about running
processes
=> SUCCESS: No process is running for `test2`
6. Sign off :-D

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 576c496442)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 86fd02bd1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:03:13 +02:00
Andreas Jonsson 5cef68c735
Bug 38974: Fix error in OPAC patron update
Test plan:

1) Make sure Patron category is checked in the system preference PatronSelfModificationBorrowerUnwantedField
2) Log in to the opac
3) Go to "Personal details"
4) Select any value for "Date of birth"
5) Click save
6) This must not yield error 500. (But may be a successful save or a validation error).

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 04ebdd4ac1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c3a9ef0989)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:02:00 +02:00
Jonathan Druart 6055966948
Bug 40003: Add a test
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 c4f7b14906)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 65b15bcc19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-25 14:00:41 +02:00
Jonathan Druart e153b9654d
Bug 40003: Remove warning from log when creating a new bib record
Test plan:
Hit cataloguing/addbiblio.pl?frameworkcode=FA

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

with this patch applied: no warning

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

squash

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

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

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

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

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

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

We edited the config and it broke the git repo:

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

So tests were not running correctly

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

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

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

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

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

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

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

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

To test:

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

7. Apply the patch and restart services

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

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

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

Will be tested within previous test plan.

Sponsored-by: Reserve Bank of New Zealand
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 00395f2520)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:12:00 +02:00
Aleisha Amohia d20b4d554d Bug 39313: Make OpacTrustedCheckout self-checkout modal accept valid barcode
This patch fixes a regression introduced by Bug 38505.

To test:

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

7. Apply the patch and restart services

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

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

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

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

[1]
To reproduce:

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

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

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

2. Create a layout:
Units: US inches

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

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

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

4. Export using the above template and layout

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

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

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

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

Better wording idea welcome.

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

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

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

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 168d282e94)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 11:01:09 +02:00
Hammat Wele cf2a14f2ba Bug 38892: Show correct error message when we attempt to add guarantor as a child
When we attempt to add child as guarantor the error message shown is 'A guarantor cannot be a guarantee.' it doesn't make sense

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

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

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

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b65eb561e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:57:15 +02:00
Tadeusz „tadzik” Sośnierz e2b344eba5 Bug 40033: Call GetPlugins correctly in background_jobs.pl
Test plan:

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

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

Test plan:

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

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

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 300247d2c6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b48f5c432d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:43:07 +02:00
Martin Renvoize cfd1981554 Bug 37364: Unit tests
This patch adds unit tests to confirm that the 773 record created by
Koha::Biblio now takes account of RDA updates and subfield ordering.

Test plan
1. Apply patch
2. Run `prove ./t/db_dependent/Koha/Biblio.t`.
3. Test fails.
4. Apply next patch in series
5. Run `prove ./t/db_dependent/Koha/Biblio.t`.
6. All tests pass.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f234fe5a1c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 3826b4794e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:43:07 +02:00
Owen Leonard a634548a6c Bug 39955: Report subgroup filter not cleared when changing tabs
This patch fixes the JS on the saved SQL reports page so that the
subgroup column filter is correctly cleared when the tab changes. The
wrong table column is targeted.

To test, apply the patch and go to Reports -> Saved SQL reports.

- If necessary, at least two SQL reports, each with in a different group
  and different subgroup. For example:
  - sql: SELECT * FROM items LIMIT 10;
  - group: Catalog
  - subgroup: Statistics
  ...and...
  - sql: SELECT * FROM borrowers LIMIT 10;
  - group: Patrons
  - subgroup: Statistics
- From the saved reports page, go to the tab for one of your reports and
  filter by subgroup.
- Switch to a different tab containing SQL reports. The reports should
  be shown as expected.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2de0265166)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 1c62677aa0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:42:01 +02:00
Lucas Gass e34d113b23 Bug 39991: Fix MARC record display on showdiffmarc.pl
To test:

1. Download a record you already have in Koha
2. Cataloging > Stage MARC records for import
3. Record matching rule: KohaBiblio (99$c)
4. Stage for import > View batch
5. In the table results there should be a link to 'View' in the 'Diff' column.
6. Notice the Record comparison is not side by side.
7. APPLY PATCH
8. Try steps 1 - 6 again, this time the record comparison should be side by side.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0cafda92b6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 56f329e843)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:41:01 +02:00
Pedro Amorim 3c3347260d Bug 39823: Identify error messages based on code
Even if severity does not exist. Additionally, only add severity to message if it exists.

Test plan:
1) Apply tests patches. Run tests (they should fail):
prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t
2) Apply this patch and run tests again (they should pass this time).

UI test:
1) Create a new data provider linked to Gale Cengage, service url:
https://api.siqcloud.online/counterapi/r51
2) Add report release 5, customer id: '123', requestor id: '123', report types: 'TR_J1'
3) Run a report for this data provider, from Feb 2025 to Apr 2025. Notice that before applying patches, the job report results in a red bar with no error message.
4) Apply patches, repeat 3. Notice it now results in a nice error message.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 023f935360)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b801888856)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:39:14 +02:00
Pedro Amorim ca9a2fe61e Bug 39823: Add tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9b0d6260bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d4fb56be5b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:39:14 +02:00
Pedro Amorim 2fe997fa43 Bug 39823: Clean-up: Mock LWP response instead of class method being tested
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d618dc808f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 54ee4ded1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:38:47 +02:00
Lucas Gass a091c7751f Bug 38477: (follow-up) Correct failing Item.t test
prove /kohadevbox/koha/t/db_dependent/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 53a9631335)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 13bff9ff2f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:30:35 +02:00
Nick Clemens af0124caeb Bug 38477: Only charge a new lost fine when the last patron to return the item matches the original fined patron
Set these sysprefs:
- FinesMode: Calculate and Charge
- WhenLostForgiveFine: Forgive
- WhenLostChargeReplacementFee: Charge

In circ rules:
- Have a rule that charges fines
- Set Refund lost item replacement fee to "Refund lost item charge and charge new overdue fine"

1 - Have/create item with replacement price
2 - Check item out to patron 1, due date in past
3 - Run fines.pl
4 - confirm fines on patron 1
5 - mark item lost
6 - confirm replacement cost generated and fine forgiven on patron 1
7 - check item in
8 - confirm replacement cost forgiven and new fine generated on patron 1
9 - check item out to patron 2, due date in future
10 - check item in
11 - mark item lost (no replacement fee generated because item is not checked out)
12 - in database, update date_due for checkout to patron 2, set to a date in the past
13 - check item in
14 - confirm patron 2 now has a fine
15 - Apply patches, restart all
16 - Repeat test plan with another item and confirm no fine is added for patron 2

Note: At step 12 we're pushing the date_due of the old issue into the past to make date_due<curdate(). In production, this comes up when there are days between steps 10 and 13.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 67c95addeb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9c81bdf529)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:30:35 +02:00
Nick Clemens 1ce180baf9 Bug 38477: Unit test
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 732c7d11ce)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 27266f68ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:30:35 +02:00
Nick Clemens fa2bd9507e Bug 39987: Correct breadcrumbs link to batch item deletion
This patch adds th del=1 param to the batchMod link in the breadcrumbs to ensure we return to batch item
deletion and not modification

To test:
1 - Browse to Cataloging->Batch item deletion
2 - Click the 'Batch item deletion' link in the breadcrumbs
3 - You are now at 'Batch item modification'
4 - Apply patch
5 - Repeat, you stay on the correct page
6 - Complete a batch item deletion and confirm the breadcrum is correct at each stage.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fd2c0709bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 056ce915ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-19 09:28:00 +02:00
Tomas Cohen Arazi 5f1ec4595b Bug 36625: (follow-up) Restore subtest titles
Due to a bad rebase we ended up changing subtest names in commit 1b4bb57092
This patch restores them and has no effect on the tests themselves.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9fcf329dcf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 35aa5bd0bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-18 15:20:50 +02:00
Jonathan Druart 7aae661fc7 Bug 36625: Run subtests in txn - Koha/Biblio.t
Test plan:
select count(*) from itemtypes;
run the tests
exectute the select query again
=> No itemtypes should have been created

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 89c42eda9f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 2b7d31a613)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-18 15:20:50 +02:00
Owen Leonard add3e016c2 Bug 38127: Missing column headings in 'Add user' pop-up modal
This patch modifies the template for adding to a basket from a new
(empty) record in order to make the "Add user" patron search results
correct. The patron search results table headers must be defined in the
template before they are used.

To test, apply the patch and go to Acquisitions.

- Search for a vendor.
- Add or create a basket for that vendor.
- Click "Add to basket" and select "From a new (empty) record."
- In the "New order" form, under the "Patrons" heading, click "Add user"
- Search for patrons to add.
- In the patron search results, each column should have a heading: Card,
  Name, Category, Library.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b4171a1522)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 5321f7fdd5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-18 15:09:21 +02:00
Martin Renvoize db0be7b399 Bug 39887: Improve documentation for overdue_notices.pl
This patch corrects a few spelling mistakes and missing grammer and adds
a little more detail to the '--date', '--email' and '--frombranch'
options.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f6fd9f2e90)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b54a6574f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-18 15:05:20 +02:00
Nick Clemens db5b3a8384 Bug 39920: Update query for check previous checkout to use IN
This patch alters the query for checking previous checkouts to use
IN instead of a list of OR for itemnumbers.

To test:
1 - On the command line:
    export DBIC_TRACE=1
2 - perl -e 'use Koha::Patrons;my $patron = Koha::Patrons->find(5);my $item = Koha::Items->find(54);warn $item->itemnumber;$patron->do_check_for_previous_checkout( $item->unblessed );'
3 - Note the query
4 - Apply patch
5 - Repeat 2
6 - Note the shorter query

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 64ec35b2a5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8b044defb5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-06-18 14:56:47 +02:00
Paul Derscheid a887152eb7
Update release notes for 24.11.05 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:59:56 +02:00
Paul Derscheid 2fcdbf1e14
Increment version for 24.11.05 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:49:30 +02:00
David Cook 1b28bd3425
Bug 39184: Turn off ABSOLUTE and EVAL_PERL for user-entered templates
This change turns off ABSOLUTE and EVAL_PERL for user-entered templates,
as these options can allow for arbitrary code execution and information
disclosure.

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Create a Notice for Reports with a report like:
[% IF ( x == 1 ) %]
One
[% ELSE %]
Two
[% END %]
3. Run a report using this template
4. The report should show "Two"
5. Turn on CHECKOUT emails for a test patron
6. Perform a checkout
7. Look at the CHECKOUT email and note that the email body
is correctly generated

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Would be good to have this fixed as the default.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The test plan should include PERL blocks or absolute paths! Tested those
instead. Testing x==1 seems irrelevant.
I tried:[% PERL %]print 1;[% END %] and [% INCLUDE /app/Dockerfile_1 %]
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:48:04 +02:00
David Cook b5bc9cf343
Bug 36586: Define self-checkin timer using Javascript class
This patch rewrites the self-checkin timer code to be defined in a
Javascript class which is then instantiated in once in sci-main.pl
depending on certain conditions (ie a barcode has been entered, or
an item has been checked in by barcode).

To test:
1 - Set SelfCheckinTimeout to a small value like 5
2 - Go to the self checkin:
    http://localhost:8080/cgi-bin/koha/sci/sci-main.pl
3 - Sign in as the SCI user
4 - Watch the page, it should refresh every 5 seconds
5 - Confirm that moving the mouse/typing prevents the reset
6 - Check in an item
7 - Wait and confirm reload of main page happens when idle
8 - Confirm mouse/typing prevents refresh
9 - Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Bug 36586: Add sc-timer to sco

This patch implements the timer form the last patch on the sco

To test:
1 - Set SelfCheckTimout to 5 or something low for testing
2 - Go to the self checkout module
3 - Either sign in or confirm you have AutoSelfCheck user setup
4 - Observe the page reloads every 5 seocnds (or as you set above)
5 - Sign in as a patron
6 - Confirm on idle you are logged out to home page
7 - Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>

Bug 36586: Fix tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ff403dcfb3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:06 +02:00
Thomas Klausner 3398c37bb4
Bug 37020: (follow-up): Remove memleak when not using Elasticsearch
If using ES, the script will collect the newly created records and biblionumbers in atwo arrays (@search_engine_record, @search_engine_record_ids) and pass that to the indexer when $commitnum records are read. The arrays are cleaned afterwards.

BUT: The records and biblionumbers were always stored, even if we're not using Elasticsearch. And as the cleaning of those arrays only happens if we are in fact using ES, all the data is added but never cleaned.

This patch fixes this by only storing record and biblionumber if we have an $indexer (i.e. if we're using Elasticsearch).

I have no idea though how/if the records are indexed when using Zebra.

After applying this patch and importing a large enough file without using Elasticsearch, the RAM usage also stays more or less constant.

@Jan, please verify!

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 132593c8a8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:06 +02:00
Thomas Klausner d836f19689
Bug 37020: (follow-up) Fix txn handling, loop label and record_number counter
So, I reviewed the code, which has a bunch of issues:

* there's a call to `next RECORD`, but no `RECORD` loop label.
* $record_number is incremented twice
* and the calls to txn_begin is moved from the outside the loop into each record, starting one transaction per record. Not sure how mysql handles this, but postgres would not like it.

This patch fixes those issues:

After I fixed the first two issues, I ran the patched script on a file containing 75 authorities (from GND), and not one was added to the DB, presuambly because nested transactions don't work in mysql?

So I also moved the BEGIN transaction outside of the main loop and started a new one after each commit, and added a final commit after to loop.

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 01d36c5e8b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:05 +02:00
David Gustafsson 848cd28c8e
Bug 37020: bulkmarcimport gets killed after update to 24.05. when inserting large files
Include checking for invalid marc data in main loop to avoid
loading all marc data into memory at once.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ba0979a4c9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:05 +02:00
Lucas Gass 66211fbbe8
Bug 17338: Fix redirection to correct tabs on waitingreserves.pl
To test:
1. Place multiple holds, good to have at least 4, for pickup at a location, I used Nick's handy script
2. Perl misc/cronjobs/holds/build_holds_queue.pl
3. Check in at least 4 items for pickup at one location so they'll be wating
4. Update the expiration date on those holds using ktd --dbshell
  update reserves set expirationdate = DATE('2024-01-01') where branchcode='CPL';
5. On Circulation > Holds waiting past their expiration date tab use the cancel button that is in the actions column to cancel a hold

The page loads on the Holds waiting tab, although in the url you see /circ/waitingreserves.pl?tab=holdsover

6. APPLY PATCH
7. Try 1 - 5 again, this time after step 5 you should be redirected.
8. Try cancelling holds with a transfer, ensuring you get redirected correctly.

Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c746e675c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:04 +02:00
Nick Clemens 160f5fafe9
Bug 39415: (follow-up) Add 651g to bib heading fields as well
Test plan:
 0 - Apply other patches - reindex your catalog
     perl misc/search_tools/rebuild_elasticsearch.pl -v -d
 1 - Set the prefs AutoLinkBiblios and CatalogModuleRelink to Do
 2 - Create three GEOGR_NAME authorities:
      151$aDismal Swamp
      151$aDismal Swamp$gSouth
      151$aPit of Despair
 3 - In a new bib record, add 651 fields
      651$aPit of Despair
      651$aDismal Swamp
      651$aDismal Swamp$gSouth
 4 - Click Link authorities automatically
 5 - 'Pit of despair' links correct - other records both link to 'Dismal swamp'
 6 - Apply this patch, restart_all
 7 - Click Link authorities automatically
 8 - Dismal Swamp and Dismal Swamp South are correctly linked

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e93057f4fc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:03 +02:00
Nick Clemens 11880e199e
Bug 39415: Add subfield g for geographic name authorities
This patch adds the subfield g to the hardcoded list of controlled fields
so that it is no longer ignored

To test:
1 - Edit a GEOGR_NAME authority to add a g subfield to field 151
2 - Search for this authority in Authorities
3 - Don't see g
4 - Apply patch, restart all
5 - Search again, you see g!
6 - Edit a record and link to the authority
7 - g is copied over!

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 38d552f4cb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:03 +02:00
Nick Clemens 697a18d9c5
Bug 38650: Only fill title level holds, or holds on the exact item
We change the conditions for filling holds to require that either:
- the hold is title level
- the hold is on the exact item

To test:
 1 - Place a hold for patron A on item #1 of a record
 2 - Place a hold for patron B on item #2 of a record
 3 - Issue item #2 to patron A - their hold on item #1 is filled incorrectly, check the item in
 4 - Apply patch, restart all
 5 - Place hold for patron A on item #1
 6 - Issue item #2 to patron A - their hold on item #1 is not filled, check the item in
 7 - Cancel that hold
 8 - Place a title level hold for the record for patron A
 9 - Check item #1 in at a different branch and confirm transfer
 9 - Issue item #2 to patron A
10 - The hold is filled as title level, even though item #1 was selected for the hold, check the item in
11 - Place an item level hold for item #2 for patron A
12 - Issue item #2 to patron A, hold is filled

Signed-off-by: Stephanie Petruso <spetruso@aacpl.net>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1df229719c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:17:02 +02:00
Nick Clemens a21bf53836
Bug 38650: Unit tests
Signed-off-by: Stephanie Petruso <spetruso@aacpl.net>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5cdfea2d5f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-26 20:16:57 +02:00
Paul Derscheid b5c6028818 Bug 39857: Add new dependency Test::NoWarnings for 24.11.x 2025-05-26 11:03:03 +02:00
Owen Leonard e662510452 Bug 35202: Table settings should apply to multiple subscriptions in the OPAC
This patch updates the bibliographic detail page in the OPAC so that if
there are multiple subscriptions attached to one record, each table of
issues under the subscriptions tab adheres to the settings defined in
Table Settings.

To test you should have at least two subscriptions attached to one
record, and at least one issue of each subscription.

- Apply the patch and view the record in the OPAC.
- Under the "Subscriptions" tab there should be separate tables for each
  subscription, each of them a sortable DataTable.
- In the staff interface, go to Administration -> Table settings -> OPAC
  -> subscriptionst
  - Select some columns to be hidden by default.
- Return to the OPAC and confirm that each subscription table now
  reflects the change you made in table settings.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ff71f51b65)
2025-05-23 18:37:12 +02:00
Lucas Gass 3035ea4d48 Bug 39620: Fallback to GetMarcPrice if nessesary
To test:
1. Have a MRC file with price populated in the 020$c
2. Have nothing the MarcFieldsToOrder or  MarcItemFieldsToOrder sys prefs
3. Create a new basket and import from a new file
4. The price is not imported.
5. APPLY PATCH and restart_all
6. Try again, this time the price should be populated correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit da3d4b72dd)
2025-05-23 18:28:42 +02:00
Aleisha Amohia de77d28db5 Bug 39406: Make serial issues sort from new to old on collection page
This patch fixes the serial collection table to sort in descending order on the date published column.

To test:

1. Create a subscription if you don't already have one.
2. Go to the Serial Collection tab using the left navigation.
3. Click the Generate Next button a bunch of times to generate some serial issues. Note that the issues are displaying in the table in ascending order, with the oldest date published at the top.

4. Apply the patch and refresh the page

5. Confirm the issues are now displaying in the table in descending order, with the newest date published at the top.
6. Click the Generate Next button again and confirm the issue is inserted at the top of the table.

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d49e7392bc)
2025-05-23 18:24:16 +02:00
Nick Clemens 1d6731025d Bug 38395: Only embed deleted_biblios for old holds
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6db083163d)
2025-05-23 12:33:51 +02:00
Nick Clemens 72e52478ff Bug 38395: Display bibliographic data for deleted biblios in holds history
This patch adds deleted_biblio to the patron holds api and adjsuts the display to
shwo the data for deleted items

To test:
 - place a hold
 - cancel the hold
 - look in patron hold history, see the title
 - delete the biblio
 - reload patron hold history
 - you see a line with no title or author
 - apply patch, yarn build, restart_all
 - reload patron hold history
 - success, you see deleted title info
 - enable OPACHoldsHistory preference
 - sign in to OPAC as patron
 - confirm holds history shows deleted title info

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a628fd131)
2025-05-23 12:33:51 +02:00
Jonathan Druart afbf1ea56c Bug 38714: biblio-title.inc [opac]
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit df00647882)
2025-05-23 12:33:51 +02:00
Nick Clemens ae818c0ca8 Bug 36867: (follow-up) Don't check IP if ILS-DI disabled
When ILS-DI is disabled we still expect to return the correct service name/section in the
xml, but just indicate that it is disabled.

We should skip the check for authorized IPs in this case, as the IP only matters when service is enabled

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3f649cfed7)
2025-05-23 12:18:30 +02:00
Paul Derscheid 97b0baa77d Bug 38641: Prevent failure of vue_tidy.t by removing excess whitespace 2025-05-23 12:18:30 +02:00
Nick Clemens d24b4f3806 Bug 39710: Handle deleted biblios in holds history
To test:
 - place a hold
 - cancel the hold
 - look in patron hold history, see the title
 - delete the biblio
 - reload patron hold history, error
[2025/04/23 11:43:28] [WARN] OpenAPI >>> GET api/v1/patrons/5/holds [{"message":"Expected integer - got null.","path":"\/body\/3\/biblio_id"},{"message":"Expected integer - got null.","path":"\/body\/4\/biblio_id"}]
 - apply patch, yarn build, restart_all
 - reload patron hold history
 - success
 - enable OPACHoldsHistory preference
 - sign in to OPAC as patron
 - confirm holds history can be loaded

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 926b8c9c68)
2025-05-23 12:18:30 +02:00
Nick Clemens 955f9d4528 Bug 39710: Unit test
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0fff879e40)
2025-05-23 12:18:30 +02:00
Jonathan Druart a3179fb7eb Bug 35560: historical => past
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 64e51d89e1)
2025-05-23 12:18:30 +02:00
Owen Leonard 89c0c9591b Bug 35560: (follow-up) Changes to classes and ids; BS5 follow-ups
This follow-up changes the "selected" class to "select_hold_status" to
avoid possible future collisions with other CSS. IDs are added to the
checkbox containers because I can already tell that some libraries will
want to hide the "Processing" checkbox which is only relevant to some
setups.

The patch also makes a couple corrections to "alerts" to update them
with BS5 classes.

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 963424d7c7)
2025-05-23 12:18:30 +02:00
Owen Leonard cf8e24c427 Bug 35560: (follow-up) Add in-page links to jump between tables
Also a terminology change: I think "Past holds" reads better than
"Historical holds."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 86b4fcf656)
2025-05-23 12:18:30 +02:00
Jonathan Druart 49c5e2b5ec Bug 35560: Add filter on status
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 605ca6176e)
2025-05-23 12:18:30 +02:00
Jonathan Druart 58f23b99db Bug 35560: Use the REST API for holds
This patch uses the new REST API endpoint to retrieve the old holds.

We can now have 2 tables, one for the current holds and one for the old
ones.

Test plan:
Have several holds with several statuses.
Notice that you see the holds in the respective tables. Test the usual sorting
filtering DT feature and confirm that everything works as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d581f067d6)
2025-05-23 12:18:29 +02:00
Tomas Cohen Arazi 7193d89c0a
Bug 38461: (follow-up) Fix tests
This patch does two things:

* Fixes a backport issue with 38461, making `mock_table_settings` have
  the right function signature, and accept (and use) the
  `table_settings_var` parameter.
* Makes the scope for the `items_table_settings` variable be the window
  object, so it is accessible to Cypress for manipulation/mocking. This
  is done by changing `let` for `var` [1]

To test:
1. Run:
   $ ktd --shell
  k$ run_cypress --spec t/cypress/integration/KohaTable_spec.ts
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

[1] If you are curious about it, change it back to `let` and run the
tests.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-22 19:58:50 +02:00
Lucas Gass 60623d7056
Bug 39276: Show record level priority in opac detail page
To test:
1. Enable Holds history system preference and set the OPACShowHoldQueueDetails to "Show holds and their priority level".
2. Make an item level hold on a record.
3. Make a record level hold on a different record.
4. Login to the OPAC as that patron
5. On the detail page for the item level hold, it works
6. On the detail page for the record level hold, dataTable error
7. APPLY PATCH
8. Try each of the OPAC detail pages again, they should both work.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2a6da59f48)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:06:00 +02:00
Lucas Gass 6c3645f3de
Bug 39633: Use column names to get table settings
1. Cataloging > Inventory
2. Run the tool without uploaded barcodes
3. Table loads and you see all the DataTable controls ( Table settings, etc )
4. Run the tool while uploading at least 1 barcode
5. No DataTable controls
6. APPLY PATCH
7. Try steps 1 -4 again, making sure everything now works.

Signed-off-by: Sam <sam.sowanick@corvallisoregon.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 74838888c0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:06:00 +02:00
Matt Blenkinsop b036666b81
Bug 39915: Restore CSV export of late issues
This patch restores the ability to export late serial claims to CSV

Test plan:
1) Create a new subscription, setting the vendor id as 1
2) Set the subscription start date as yesterday's date, the other
   details aren't relevant so set whatever you want
3) Click into claims
4) If you get a warning saying no claims notice is defined then click
   the link to define one (on the dropdown for the 'New notice' button
   you want 'Claim serial issue. The content of the notice isn't
   relevant here so input anything). Then head back to the claims page.
   If no warning shows, proceed to the next step
5) Choose My Vendor and hit OK
6) You should see a table of claims with the first issue for your new
   serial
7) Click the checkbox next to the row
8) Click the 'Download selected claims' button at the bottom
9) The CSV will download
10) Click into it - it will have the header but the rows will be blank
11) Apply patch
12) Hard refresh the page
13) Click the download button again
14) Check the new file, the rows will be filled out correctly with data

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a3d16177c2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:59 +02:00
Lucas Gass 6e54b335fd
Bug 39361: Wrap modal JS in document ready function
To test:
1. Find or create an item with a hold on it.
2. Go to Circulation > Transfers
3. Transfer the item from step 1.
4. No modal appears to warn that the item has a hold.
5. APPLY PATCH
6. Try step 3 again, this time the modal should appear correctly.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 097153f279)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:59 +02:00
Owen Leonard cc97c6290d
Bug 39886: [24.11.x] Identifier typed as Identifierr
This patch corrects a typo in the Elasticsearch mappings template:

Identifierr -> Identifier

To test, apply the patch and go to Administration -> Search engine
configuration. In the "Type" column, check the dropdown menus. There
should be an item "Identifier."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:58 +02:00
Lucas Gass e2c2df4b22
Bug 39588: Fix concatenation in bookings to collect
1. Turn on bookings for an item or item type
2. Find an item and book it.
3. Check the same item out.
4. Go to Circulation > Bookings to collect and run the report
5. The table never loads
6. APPLY PATCH
7. Try again, the bookings to collect report should load!

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9b8e2ea5e6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:57 +02:00
Lucas Gass 6993bb0017
Bug 39644: Skip processing guarantor if already seen
To test:
1. In k-t-d try loading both member/moremember.pl and circ/circulation.pl for a patron with many guarantors.
2. Note the load times.
3. APPLY PATCH
4. Load times should now be reduced pretty significantly.
5. prove -v /kohadevbox/koha/t/db_dependent/Koha/Patron.t
6. No behavior should change.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8bd72af1ff)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:57 +02:00
Nick Clemens 178e8c6d20
Bug 39857: Fix expanded_avs option for OAI
This patch correct the call to filter the record

To test:
1 - Enable OAI
2 - Set  OAI-PMH:ConfFile to '/var/lib/koha/kohadev/OAI.yaml'
3 - Edit/create the file above to have content:
format:
  marcxml:
    metadataPrefix: marcxml
    metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
    schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
    include_items: 1
    expanded_avs: 1
4 - save and restart_all
5 - View some records:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml
6 - Note the items show coded values
7 - Apply the regressions tests patch
8 - Run:
    $ ktd --shell
   k$ prove t/db_dependent/Koha/OAI/Server/Repository.t
=> FAIL: Tests fail!
9 - Apply this patch
10 - Restart all
11 - Refresh and confirm items now have descriptions
12 - Repeat 8
=> SUCCESS: Tests pass!

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit (tcohen): Amended the test plan to include the added regression
tests run
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6130a072d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:56 +02:00
Tomas Cohen Arazi 44c321861a
Bug 39857: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e07046708)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:56 +02:00
Phil Ringnalda 696454621f
Bug 39464: Grey rows in tables not highlighting in yellow when they should
Because the CSS rule for turning odd-numbered rows grey is highly-specific
(tbody tr:nth-child(2n+1):not(.dtrg-group, .active, .ok) td:not(.bg-danger,
.bg-warning, .bg-info, .bg-success, .bg-primary)), it overrides the
.highlighted-row, .highlighted-row td rule that some tables use to turn the
background of a currently-selected row yellow, so highlighted-row needs to be
added to the lists of not().

Test plan:
 1. Without the patch, Cataloging - New from Z39.50/SRU, perform a search like
    Author smith which will return at least two results.
 2. On an even-numbered row with a white background, click MARC and note that
    the row is given a yellow background (either by increasing the size of the
    popup to peer around the preview, or by closing the preview, since the
    highlight persists).
 3. On an odd-numbered row with a grey background, click MARC and note that
    the row isn't given a yellow background
 4. Administration - Circulation and fine rules, if you don't already have at
    least two rules add one by just changing the Patron category in the edit
    row and Save
 5. On a row with a white background, click Edit and note that the background
    for that row is yellow
 6. On a row with a grey background, click Edit and note that the background
    remains grey, not yellow
 7. Apply patch, in ktd --shell yarn build (or in a sandbox Actions - Build
    CSS and JS), clear browser cache or shift+Reload the page
 8. Repeat steps 1-6, but this time note that you get the same yellow
    highlighted background for both odd and even rows.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b346ed1e79)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:54 +02:00
Lucas Gass 6b4e2e12c6
Bug 39414: Retain item type selection when editing a booking
To test:
1. Place a booking on an item.
2. Click on edit to open the Edit booking modal.
3. The item type will be de-selected, and the booking dates calendar will be locked until the item type is re-selected.
4. APPLY PATCH
5. Try steps 1 - 3 again, this time the proper item type should be selected and the date field will not be locked.
6. Try creating a new booking, making sure everything still works as excepted.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3aa13d8a29)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-05-17 21:05:49 +02:00
Paul Derscheid ad2edae3cf
Update release notes for 24.11.04 release again (with last minute inclusions)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-25 11:44:33 +02:00
Johanna Räisä b129a7bbc0
Bug 38905: change permissions for item creation and modification
This patch changes the permissions to edit_items for item creation and modification via the API.

Test plan:
1) Apply the patch
2) prove t/db_dependent/api/v1/biblios.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ae069f57ec)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-25 11:27:59 +02:00
Raphael Straub 6835058093
Bug 39405: (follow-up) Add the parameter borrowernumber to the overwrite_calc_fine plugin hook
This patch adds the borrowernumber as a parameter to the overwrite_calc_fine
plugin hook. E.g., the borrower is needed for calculating graduated fines.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 936b5650c5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-25 11:27:58 +02:00
Tomas Cohen Arazi 0303621e7d
Bug 39405: Add more plugin examples to build tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9b972d9b3e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-25 11:27:57 +02:00
Tomas Cohen Arazi 33ad4fa783
Bug 39405: (follow-up) Simplify code for choosing the first fine values
This patch avoids the introduction of a `foreach` loop and a `return`
call inside of it, by using grep on the array assignment, and then just
returning the first element on it, if any.

No behavior change is expected.

The code becomes easier to read and spot what is doing.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9345f6d784)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-25 11:27:56 +02:00
Raphael Straub 8081b1e3c1
Bug 39405: Add hook overwrite_calc_fine to override CalcFine in Overdues.pm
This new hook allows to overwrite the koha standard calculation of fines.
This can be useful if your library has a fine policy with graduated fines
per overdue letter.

To test:
1) Apply patch.
2) Run prove -v t/db_dependent/Circulation/CalcFine.t
3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t
4) Sign off.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fa329e4a09)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-25 11:27:40 +02:00
Paul Derscheid c01975246d
Update release notes for 24.11.04 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-24 19:48:07 +02:00
Paul Derscheid d0aee389e1
Increment version for 24.11.04 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-24 18:48:31 +02:00
David Cook b52f4a0851
Bug 38969: (QA follow-up) fix tidy
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-24 18:42:32 +02:00
Jonathan Druart 51c780583f
Bug 38969: Prevent JS error when adding tags with quote at the OPAC
Uncaught SyntaxError: missing ) after argument list

There are way more to fix in this controller...

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-24 18:42:31 +02:00
Jonathan Druart 755e20839b
Bug 38969: Prevent XSS in tags/review.pl
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-24 18:42:31 +02:00
Nick Clemens 2c7cd938ee
Bug 36867: Update preference description
This lists the new syntax for allowing all IPs in the preference

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-24 18:42:30 +02:00
Nick Clemens 77de8990ee
Bug 36867: Do not allow access to ILS-DI for IPs not explicitly listed in ILS-DI:AuthorizedIPs
This patch forces a check of authorized IPs against the Koha system preference, if nothing is present, no access is allowed

To test:
 1 - Enable ILS-DI, leave  ILS-DI:AuthorizedIPs blank
 2 - In another window:
    http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=1+2+99999&id_type=item
 3 - You get a response
 4 - Apply patch and restart all
 5 - Reload ilsdi page, 'Not authorized'
 6 - Copy the IP listed as refused and paste into ILS-DI:AuthorizedIPs
 7 - Reload the page, you get a response again
 8 - Change ILS-DI:AuthorizedIPs to:
    0:0:0:0/0
 9 - You still have access
10 - Paste your specific IP again, and add a second made up IP (comma separated)
11 - Reload and confirm you still have access

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-24 18:42:25 +02:00
Nick Clemens bd6bea710a
Bug 39056: Do not copy preferred_name to new patron when using Duplicate
It looks like this was a type/copy paste error, template fixed

To test:
1 - Find a patron, ensure preferred_name is populated
2 - Duplicate
3 - Note preferred_name is carried over
4 - Apply patch
5 - Cancel and duplicate again
6 - Preferred name is blank!

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 796bfddf87)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:33 +02:00
Tomas Cohen Arazi 785bb50121
Bug 39397: 'biblio' attributes take precedence over 'biblioitems' in response
This patch swaps biblio for biblioitem attributes in the return value.
The effect is that attributes from the `biblio` table overwrite those
named the same (`timestamp` being the target).

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: The biblioitems.timestamp is returned!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Things go smooth now
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f69aab3735)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:32 +02:00
Tomas Cohen Arazi e10571e4ce
Bug 39397: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 419d708666)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:31 +02:00
Lucas Gass a841d4aa58
Bug 39294: [24.11.x] Fix includes to properly remember selections
To test:
1. Cataloging > Stage MARC record for import
2. Upload a MARC file
3. Change some of the following settings:

    -Action if matching record found:
    -Action if no match is found:
    -How to process items/Item processing:

4. Stage for import and View batch
5. None of this settings have been retained.
6. APPLY PATCH
7. Try these steps again, now the settings should be remembered
8. Turn on the 'MarcOrderingAutomation' system preference.
9. Administration > MARC order accounts
10. Create a new account
11. Change the "Record matching settings" and submit
12. Make sure every selection is remembered when you edit the account.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:31 +02:00
Tomas Cohen Arazi b0891ed525
Bug 36365: (follow-up) Indexing should be done async and in chunks
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6881b674e6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:30 +02:00
Tomas Cohen Arazi 2d91c1e0eb
Bug 36365: Add a way for compare_es_to_db.pl to fix problems
This patch adds a new option switch `--fix` (or `-f`) to make the script
try to fix the problems it found.

Bonus: `--help` option switch added.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ perl -MKoha::SearchEngine -MKoha::SearchEngine::Indexer -e 'my $i = Koha::SearchEngine::Indexer->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); $i->delete_index([1]);'
=> SUCCESS: Bibliographic record #deleted from ES index
3. Run:
  k$ koha-mysql kohadev
   > DELETE FROM biblio WHERE biblionumber=2 OR biblionumber=3;
=> SUCCESS: Bibliographic records 2 and 3 deleted directly from the
database, no reindex triggered by Koha.
4. Run:
  k$ perl misc/maintenance/compare_es_to_db.pl
=> SUCCESS: The results from (2) and (3) are explained. [1]
5. Run:
  k$ perl misc/maintenance/compare_es_to_db.pl --fix
=> SUCCESS: It says it is gonna fix things
6. Repeat 4
=> SUCCESS: The problems we generated are no longer reported! They've
been fixed!
7. Sign off :-D

[1] Note KTD ships some broken records on purpose so devs need to deal
with a not-perfect DB everyday, and catch misses in the code.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3669cb0eed)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:29 +02:00
Julian Maurice b4d6c538b7
Bug 37286: Add tests for REST authentication through Mojo apps
Amended-by: Jonathan Druart
Add +x

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 58f6d7d73d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:29 +02:00
Julian Maurice 3ae15a34cd
Bug 37286: Fix REST API authentication when using Mojo apps
Koha::REST::V1::Auth checks the request URL path and do various things
depending on how it looks.
For instance, it allows everyone to access paths starting with
"/api/v1/oauth/"

But because of how Koha::REST::V1 was written, when using mojolicious
applications Koha::App::Intranet and Koha::App::Opac, paths had to add a
path prefix ("/api"), which means the final path as seen by
Koha::REST::V1::Auth looked like this: "/api/api/v1/oauth".

I said "had to", but actually there is another way that does not require
this path manipulation and that's what this patch does:

Koha::REST::V1 now accepts a configuration parameter that allows to
change the base path for API routes, which allows
Koha::App::Plugin::RESTV1 (used by Koha::App::Intranet and
Koha::App::Opac) to generate the right routes.

This configuration parameter defaults to "/api/v1", so when outside of
Koha::App::Intranet and Koha::App::Opac (when using
debian/templates/plack.psgi for instance), the behavior is unchanged.

Test plan:
1. Do not apply the patch yet
2. Run `bin/intranet daemon -l http://*:8080`
3. Run `curl -i -d{} http://127.0.0.1:8080/api/v1/oauth/token`
   It should return a 403 error, with an error message "Authentication
   failure".
4. Stop `bin/intranet daemon -l http://*:8080` by hitting Ctrl-C on the
   terminal you started it
5. Apply the patch
6. Run `bin/intranet daemon -l http://*:8080` again
7. Run `curl -i -d{} http://127.0.0.1:8080/api/v1/oauth/token`
   This time it should return a 400 error with an error message saying
   the "grant_type" property is missing.
   This error is normal as we did not send any data in the POST request
   body, and seeing this means Koha allowed us to use that route because
   it recognized '/api/v1/oauth/' at the start of the URL path
8. You can do the same test with `bin/opac`

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. See Bugzilla for notes from testing.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 751391cc5c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:28 +02:00
Jonathan Druart ccbe38128c
Bug 38104: Always update when hea cronjob is run
If the cronjob is configured to run every month we don't need to add
another test on the delay in the script itself.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c26a989c64)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:27 +02:00
Brendan Lawlor 9285dddcef
Bug 38174: Fix self checkout alerts for non batch checkouts
This patch adds a check for batch_checkouts_allowed to SCO.

If not using batch checkout, only the most recent chekout should be
rendered as an alert, instead of all the new issues for the session.

This makes the input box consitently render in the same position.

To replicate:
1. Login as self_checkout to localhost:8080/cgi-bin/koha/sco/sco-main.pl
2. Login as a patron to make self checkouts
3. Check many items out and notice an additional alert is rendered
    for each checkout, eventually pushing the barcode input off screen.

To test:
1. Apply patch and restart_alll
2. Login as a patron to make self checkouts
3. Check many items out
4. Notice only the most recent checkout is rendered as an info alert
5. Confirm the Checkouts table below still loads all checkouts
6. In Admin set BatchCheckouts to 'Allow'
7. Set SCOBatchCheckoutsValidCategories to 'Select all'
8. Login to sco as a patron and enter a newline delimited list of barcodes
9. Confirm that an alert is rendered for each checkout in the batch

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit db120bb6e5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:27 +02:00
phette23 0896db1dc2
Bug 29238: Cataloging cron jobs are not logged
Testing plan:

1. set CronjobLog to "Log"
2. Run the three cron jobs
   `perl misc/link_bibs_to_authorities.pl; perl misc/cronjobs/merge_authorities.pl -b; perl misc/migration_tools/remove_unused_authorities.pl --confirm`
3. Visit the log viewer /cgi-bin/koha/tools/viewlog.pl, select the "Cron jobs" module, & note it's empty
4. apply the patch
5. Repeat steps 2 & 3 but note the cron logs aren't empty

squash

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 97c2437bb3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:26 +02:00
Tomas Cohen Arazi 60c9d227f7
Bug 38932: Make adding a credit return the Location header
This patch makes the `POST /patrons/:patron_id/account/credits` endpoint
return a valid `Location` header. Tests are added.

Bonus: the debits counterpart already returned the header, but pointed
to a non-existent endpoint (now added by bug 38931) and it gets tests
added.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> FAIL: The behavior is not implemented for credits.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4d6aef19cc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:25 +02:00
Tomas Cohen Arazi 820bc96fae
Bug 38932: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fcced47c2b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:25 +02:00
Jonathan Druart 2b418426ad
Bug 38929: Add 2 exceptions
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ff0919ec19)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:24 +02:00
Jonathan Druart 36dd17c544
Bug 38929: Add xt test to enforce REST3.4.1 POST
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a5f3859c5c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:23 +02:00
Tomas Cohen Arazi e037d855dd
Bug 38929: (follow-up) Replace SWAGGER -> REST in the tests
The wiki now uses `REST*` for the rule names instead of `SWAGGER*` some
tests have their descriptions correct, but most don't.

This is a follow-up to an editorial decision made on the Wiki (probably
at a dev meeting too, I don't remember).

QA tests will probably not pass, but I refrain from tidying it because
there's a major tidy on its way to main.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d597123789)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:23 +02:00
Tomas Cohen Arazi a6c5884a7d
Bug 38929: Make POST endpoints return the `Location` header
This patch makes the POST endpoints missing the Location header return
it.

Some endpoints I skipped:

* /patrons/account/credits (doesn't have a GET route to point to)
* /patrons/account/debits (doesn't have a GET route to point to)

To test:
1. Apply the regression tests
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/authorities.t \
           t/db_dependent/api/v1/biblios.t \
           t/db_dependent/api/v1/clubs_holds.t \
           t/db_dependent/api/v1/holds.t \
           t/db_dependent/api/v1/ill_batchstatuses.t \
           t/db_dependent/api/v1/import_batch_profiles.t \
           t/db_dependent/api/v1/transfer_limits.t
=> FAIL: Tests fail! The endpoints don't return the header!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eab06ab69b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:22 +02:00
Tomas Cohen Arazi 58f5996df8
Bug 38929: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit de1b28d2f6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:21 +02:00
Owen Leonard 2fc8ae7929
Bug 38958: Search history deletion broken in the staff interface
There is some JS on the staff interface search history page which uses a
jQuery selector that doesn't seem to work after the DataTables upgrade.
This patch fixes it.

To test, apply the patch and enable EnableSearchHistory if necessary.

- In the staff interface, perform a few catalog searches if necessary.
- Choose "Search history" from the user menu in the upper right.
- In the table of searches, check the checkbox next to one or more
  search history entries.
- The delete button at the top of the table should become enabled.
- Clicking the delete button should work correctly to delete your
  selected searches.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b6709f2984)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:21 +02:00
Jonathan Druart 88da97fb0e
Bug 38854: Remove 'class' property from ToolbarButton
We never use another value than the default one.
We can simply remove this property.

Test plan:
Rebuild the dist files using `yarn js:build` and confirm that the
buttons in the toolbar of the ERM and Preservation modules still appears
and are styled like before.

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a575d38770)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:20 +02:00
Phil Ringnalda d1e1052f67
Bug 38921: Remove unused href from Cancel hold link
The trashcan icon to cancel a hold from the list of holds on a bib record has
a leftover href attribute from before the bug 34478 CSRF protection changes.
It has an 'op=cancel' which does nothing since there's only a cud-cancel op,
so it just falls through to the view case and redisplays the page if you open
it in a new tab, and doesn't get used at all if you click the trashcan, when
JavaScript builds up a form that you can POST.

Test plan:
1. Place a hold on any item.
2. On the list of holds, right-click the Cancel hold trashcan icon, and
   select Open in new tab
3. In the new tab, note that the URL in the browser address bar shows all
   sorts of things about op=cancel and borrowernumber and biblionumber and
   reserveid, but nothing changed, your hold wasn't deleted
4. Close that pointless tab, and apply patch
5. Reload the page with the list of holds, and again right-click the
   Cancel hold trashcan and select Open in new tab
6. In the new tab, note that the URL just has the biblionumber and a #, no
   other extraneous things
7. In the original tab, left-click the trashcan, confirm cancellation in the
   popup, and make sure that cancelling still does work.

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 22c5a1ea6f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:19 +02:00
Jonathan Druart 708d0a5458
Bug 38954: Hide checkout type using colvis
This is not the correct way to hide a column, we should use the DT's column
visibility plugin.

Test plan:
Have some checkouts for a patron, go to the checkout history page
Without this patch notice the "shift" => the table does not take the
whole available width.

Apply this patch, restart_all, remove localStorage entries

=> The table is now displayed properly

You can also play with on-site checkouts.

Before:
https://snipboard.io/uTWYit.jpg
https://snipboard.io/qxZE35.jpg

After:
https://snipboard.io/2L0F3Q.jpg
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5a6f89f3f0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:19 +02:00
Jonathan Druart f2ae545902
Bug 36163: Chomp country list
I found the same code in preferences.tt, actually we don't need to trim
if the list is properly generated (ie. without extra spaces)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3a644175f2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:18 +02:00
Janusz Kaczmarek cf3a3124f5
Bug 36163: Usage statistics - Not possible to select a country
Site: .../cgi-bin/koha/admin/usage_statistics.pl

If you try to select a country, you get an error:
==
The value of your system preference 'UsageStatsCountry' is not valid (Germany). Please select a valid one.
==

It doesn't matter which country you chose, no country is valid.

Test plan:
==========
1. Select a country for UsageStatsCountry system preference.
2. Go to http://<your addr>:8081/cgi-bin/koha/admin/usage_statistics.pl
3. Confirm the issue.
4. Apply the patch ; restart_all.
5. Repeat p. 2.
6. Confirm that the issue has been solved.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3d844e774d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:17 +02:00
Tomas Cohen Arazi 1619c3c87e
Bug 38679: (follow-up) Fix old typos in column names
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 804394e530)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:17 +02:00
Tomas Cohen Arazi 5e36f23859
Bug 38679: Add attribute mappings Koha::Old::Biblioitem
This trivial patch replicates the mappings in Koha::Biblioitem.

To test:
1. Pick a sample record ID
2. Fetch is using the API with your favourite tool:
   GET /api/v1/biblios/<the ID>
   Accept: application/json
3. Save the output for later
4. Delete the record
5. Fetch the deleted biblio using the API:
   GET /api/v1/deleted/biblios/<the ID>
   Accept: application/json
6. Compare the results
=> FAIL: Attributes like `volumedate` are not mapped!
7. Apply this patch
8. Repeat 5
=> SUCCESS: Attributes are mapped!
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Leo Stoyanov <leo.stoyanov@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 980890517f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:16 +02:00
Owen Leonard ce8a5562aa
Bug 38870: Remove overflow scroll from batch patron modification
This patch removes the <div> surrounding batch patron modification
results with the style "overflow:auto". Also removed is the DataTable
option "scrollX". This eliminates the horizontal scrolling for the table
itself, and causes the whole page to scroll horizontally instead. This
is consistent with other pages in Koha.

This fix lets us avoid bugs which are associated with the overflow
scrolling and our DataTables implementation. (see Bug 37730).

To test, apply the patch and go to Tools -> Batch patron modification

- Submit a batch of patrons for modification.
- On the screen showing the patrons which will be modified, the page
  will probably have a horizontal scrollbar already. If not, resize your
  browser to confirm that the whole page scrolls, not just the table.
- Confirm that the table header "sticks" to the top of the screen when
  you scroll down, and that the header continues to be aligned correctly
  when you scroll horizontally.

Sponsored-by: Athens County Public Libraries
Signed-off-by: William Lavoie <william.lavoie@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 39cd514642)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:15 +02:00
Owen Leonard 6ecef5e28b
Bug 38783: (follow-up) Remove obsolete .badge-pill class
.badge-pill is from a previous version of Bootstrap. .rounded-pill is
the current version, but I think it looks better without.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0c1a2f54b6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:15 +02:00
Leo Stoyanov cc82fd0996
Bug 38783: Added "Checked out" badge for checked out items in the circulation history table.
To test:
1. Make some checkout to a patron so they have a circulation history,
   with some items checked in and some still on loan.
2. Look at the patron's "Circulation history" table. There are four
   possible background colors for each row: #ffffff, #f3f4f4, #F9FAE0,
   and #FFFFCC.
3. Apply the patch, update the CSS (yarn build), and restart everything
   (restart_all).
4. Repeat steps 1-2, if needed. An orange/gold badge will appear under
   the "Return date" column of the table for items that have been
   checked out, and there will no longer be alternating, pale yellow rows.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. I agree that it looks better now than before, and
that it is easier to tell the checked out items from the returned items.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c76bda202)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:14 +02:00
Tomas Cohen Arazi ec322648b6
Bug 38926: Make POST /biblios return 400 if AddBiblio fails
We don't have proper exceptions in the `C4::Biblio::AddBiblio` method,
but we at least know `$biblio_id` will be `undef` in the even of an
error processing the call.

This patch makes the controller handle this situation so (at least) it
is obvious that something bad happened.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: Tests fail! The endpoint returns 200 even on error!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! The endpoint returns a 400 with a reasonable
message!
5. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a98760a994)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:13 +02:00
Tomas Cohen Arazi 9f21b316de
Bug 38926: Regression tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 384b869ccd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:13 +02:00
Tomas Cohen Arazi 8a7cc55474
Bug 38927: Only call FindDuplicate if required
This patch makes the code call `FindDuplicate` only if
`x-confirm-not-duplicate` is not passed. This makes sense, as having it
passed makes it override any duplicate found.

This patch doesn't change any end user behavior, just makes the code
more efficient.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass, no behavior change
4. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d6a4637ff6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:12 +02:00
Baptiste Wojtkowski d09a7f3cdf
Bug 8425: Increment the barcode on each call of set_barcode()
Duplicate barcodes are generated when placing an Order in Acquisitions when AcqCreateItem = "placing an order" and Autobarcode is turned on.

The problem is that you can accidentally attach 3 items to an order, but only 1 will be saved to the database. When you go to receive your order, you can only receive 1 item as the other two were never made, since the barcode wasn't unique.

In 3.8.0, a software error comes up which prevent any item creation, I believe, but master (3.9.x) doesn't throw any warnings or errors.

Yes.. This tries and solve a bug from 3.8.0 /o/

Test plan:
1 - set syspref "autoBarcode" to generated in the form <branchcode> yymm001
2 - set the barcode field to "barcode.pl" in marc structure
3 - create a new basket
4 - add one item to this basket
5 - click on the barcode field -> it should have a barcode
6 - click on add item and click on the new barcode fiels, it should have
 the same value
 APPLY PATCH:
7 - click on the barcode field -> it should have a barcode
8 - click on add item and click on the new barcode fields, it should have
  an higher barcode.

Note : The barcode is incremented each time the barcode with an empty
value is clicked on. Therefore, if the
librarian removes the value from barcode and click again, they could get
another barcode. I do not know if it is an issue.
Note: This patch is not splitted in two parts anymore

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan, works as advertised.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b7ed38413a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:11 +02:00
Andrew Fuerste Henry 4ae68a17ed
Bug 38894: Use HomeOrHoldingBranch with longoverdue cronjob
To test:
1: Add 4 items, 2 with homebranch = Library A and 2 with homebranch = Library B
2: Logged into Library A, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
3: Set yourself to Library B, check out 1 Library A item and 1 Library B item, both with due dates in the past enough for the longoverdue cron
4: Run longoverdue cron with --verbose, without --confirm, and without --Library. see that it would act on all 4 items
5: Set CircControl to "the library the item is from"
6: Set HomeOrHoldingBranch to "the item's home library"
7: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
8: See the cron wants to act on the items with homebranch = A
9: Set HomeOrHoldingBranch to "the item's holding library"
10: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
11: See the cron is still trying to act on the two items with homebranch = A
12: Apply patch, restart all
13: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
14: See the cron is now trying to act on the two items with holdingbranch = A
15: Set HomeOrHoldingBranch to "the item's home library"
16: Run longoverdue cron with --verbose and --library="A" (where A is the code for your Library A), wihout --confirm
17: See the cron wants to act on the items with homebranch = A

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 562dd9e2c9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:10 +02:00
Jonathan Druart 369898cccf
Bug 38872: Fix the missing occurrences
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 511ba0e4d8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:10 +02:00
Jonathan Druart aed43db878
Bug 38872: Parse all 'a' element, not only the first one
Test plan:
Apply the "Add test" commit
% prove t/template_filters.t
=> Fail
Apply this patch
% prove t/template_filters.t
=> Success
% prove xt/find-missing-filters.t
=> Fail
Apply the last patch "Fix occurrences"
% prove xt/find-missing-filters.t
=> Success

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3e5fa21f85)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:09 +02:00
Jonathan Druart e3b5d1415f
Bug 38872: Add a test
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7fdf2983a9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:08 +02:00
Matt Blenkinsop 16a0ad092c
Bug 36836: (follow-up) Fix incorrect syntax
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 78c4bc89b1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:08 +02:00
Matt Blenkinsop 809590b921
Bug 36836: Amend translation fixes
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ea6a4db1b6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:07 +02:00
Katrin Fischer 8804634de3
Bug 36836: Fix translation issues in ERM module
This tries to fix multiple translation issues in the ERM module.
This includes:

* Making strings translatable
* Using double quotes instead of single around strings according to
  coding guidelines
* Fixing some translations where the variable was marked for translation,
  but not the strings themselves:  ...>{{ $__(item.tab_name) }}</a

To test:
* Apply patch
* Run yarn build
* Make sure you have a clean work space in git
* Run gulp po:update lang de-DE (or another language)
* Verify the strings from the patch set now appear in the po files

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Amended-by: Jonathan Druart
-                                        {{ $__("Uploaded on:") }}
+                                        {{ $__("Uploaded on") }}:
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit beb8770bc9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:06 +02:00
Owen Leonard 85e5051fbf
Bug 38502: Use Bootstrap alert info class for messages on table settings page
This patch updates the table settings template to add style to
informational messages.

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

- Go to Catalog -> detail -> holdings_table. Above the table's settings
  you should see a message, "Please not that if a field..." It should
  have the standard Bootstrap "info" style.
- Go to Cataloging -> additem. You should see a similarly styled
  message, "Changes made below..."

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 020f709d64)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:06 +02:00
Jonathan Druart 545b7d5db5
Bug 38461: (follow-up 2) Do not rely on biblio_id=1
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 665f9a50ad)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:05 +02:00
Jonathan Druart 27709dcfe0
Bug 38461: (follow-up) Do not rely on biblio_id=1
19:05:50 koha_1       |   "error": "Basic authentication disabled"

We don't need to pass the auth in this request, we are authenticated
already.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 51aa5ab6b0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:04 +02:00
Jonathan Druart a3406f10a7
Bug 38461: Do not rely on biblio_id=1
It might not exist!

This code is not trivial and should ideally be moved to somewhere it
could be reused easily. But good enough for now to fix the failing tests.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bb2e88a1e3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:03 +02:00
Victor Grousset/tuxayo 64e8c285e4
Bug 38461: Fix multiple case changes that broke variables
Amended-by: Jonathan Druart
-                        "x-base-total-count": baseTotalCount,
-                        "x-total-count": baseTotalCount,
+                        "X-Base-Total-Count": baseTotalCount,
+                        "X-Total-Count": baseTotalCount,

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bfd7d533f0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:03 +02:00
Jonathan Druart 9206cd62d1
Bug 38461: Add tests for catalogue/detail/holdings_table
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2ec4e6dd4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:02 +02:00
Jonathan Druart ac327713ff
Bug 38461: Bypass the clipboard for tests
There are known bugs with Cypress trying to play with the clipboard, and
I don't manage to make the tests pass consistently (also tried realClick
from cypress-real-events)

Here I am suggesting to not click on the button, but simply retrieve the
url (which needs a bit of work in the existing code).

We don't test the "Copied!" tooltip and the behaviour of the button, but
at least the tests pass!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 12e0d722c4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:01 +02:00
Jonathan Druart 325d88f3ce
Bug 38461: Fix random failures
All this is weird.
I found this and implemented it:
https://stackoverflow.com/questions/69425289/javascript-prompt-cause-document-is-not-focused
It was still not enough to reduce the failures.
The wait and adding the focus to the window seems ok.
If I remove one of those 3 hacks, I still get failures...

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit aab60455b5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:01 +02:00
Jonathan Druart 5f3c15600c
Bug 38461: Jump to the configuration page
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 79bc770baa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:02:00 +02:00
Jonathan Druart eddef24852
Bug 38461: Shareable link
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7e9ce66bed)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:59 +02:00
Jonathan Druart fd9727ff50
Bug 38461: Refactoring - mock_table_settings
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3d6210552c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:59 +02:00
Jonathan Druart 211576422f
Bug 38461: Refactoring - build_libraries
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f5a7c307da)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:58 +02:00
Jonathan Druart 18c8c36a8b
Bug 38461: Save state ON/OFF
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a55281fbca)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:57 +02:00
Jonathan Druart 9e25b97101
Bug 38461: Columns - All, is_hidden by default, then shown by user
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9544cbf977)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:57 +02:00
Jonathan Druart fcdc0754f9
Bug 38461: Use buildSampleObjects
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6438b1e0e2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:56 +02:00
Jonathan Druart 3be4e3df60
Bug 38461: Add tests for 'Clear filter'
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b00b99f31d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:55 +02:00
Jonathan Druart 1b9771023f
Bug 38503: Do not generate too long strings
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 55c3840588)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:55 +02:00
Jonathan Druart 95490ba8e4
Bug 38503: Merge the module.exports
We redefine it and so the query/mysql plugin is not available

It fixes csrf.ts
14:36:17 koha_1       | The task &apos;query&apos; was not handled in the setupNodeEvents method. The following tasks are registered: buildSampleObject, buildSampleObjects

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a5eb0ba010)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:54 +02:00
Katrin Fischer aae6af9754
Bug 38503: Update yarn.lock
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a9870fd1c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:53 +02:00
Jonathan Druart 257f133795
Bug 38503: Do not list the objects
No need to list all the objects, just retrieve the spec depending on the
"object" var we pass.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9f5f4aa1d6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:53 +02:00
Jonathan Druart dc4f90b1c7
Bug 38503: Generate correct values for date and date-time
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ddd22c7887)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:52 +02:00
Jonathan Druart b6f11a8e27
Bug 38503: Deal with types that can be "null"
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3bc9bd8b62)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:51 +02:00
Jonathan Druart 2524a79821
Bug 38503: Allow to pass values
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 34f6663374)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:50 +02:00
Jonathan Druart 00fe3f8b55
Bug 38503: Have a generic buildSampleObject[s]
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3f880c5978)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:50 +02:00
Jonathan Druart 7bad7ea76d
Bug 38503: Same for libraries
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7b3426928f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:49 +02:00
Jonathan Druart 6b3711d2c0
Bug 38503: Implement a plural form - buildSamplePatrons
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bad59ca734)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:48 +02:00
Jonathan Druart 8995b8b806
Bug 38503: Read patron swagger spec file and implement buildSamplePatron
Test plan:
1. Install deps
     sudo yarn install --modules-folder /kohadevbox/node_modules
2. Run tests
     cypress run --config video=false --spec t/cypress/integration/t/mockData.ts

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3a3294966a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:48 +02:00
Caroline Cyr La Rose f224586f7c
Bug 38856: Typo: EmailAddressForPatronRegistrations - "chooose"
This patch fixes a typo in the description of the
EmailAddressForPatronRegistrations system preference.

To test:
1. Apply patch
2. Go to Administration > System preferences
3. Search for EmailAddressForPatronRegistrations
4. Read the description (2nd line) and make sure the spelling is correct

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3fc855f568)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:47 +02:00
Nicolas Hunstein e40a130a93
Bug 38471: update "Field suppresion" to "Field suppression"
updates "Field suppresion" to "Field suppression"

to test:
- go to Administration/Authority types/Default framework/Tag 090
- verify description for subfield t is Field suppresion, FSP (RLIN)

- apply patch
- reset database or reset_all
- verify description has changed to Field suppression,FSP (RLIN)

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ede69d5c5f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:46 +02:00
David Nind 4a66ba2524
Bug 38448: Fix inconsistencies in database update messages
This fixes some database update messages to improve their
consistency with the database update guidelines
https://wiki.koha-community.org/wiki/Database_updates

Test plan:
1. Apply the patch.
2. Review the differences to make sure the messages make
   sense and are consistent with the database update
   guidelines:
   2.1 Review the diff attached to the bug
   or
   2.2 Run: git show
3. Sign off D:

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Leo Stoyanov <leo.stoyanov@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bdcbcc0a33)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:45 +02:00
Caroline Cyr La Rose 6352c25dad
Bug 38845: OpacNoItemTypeImages required to show item type images in staff interface advanced search
This patch makes it so that the noItemTypeImages system preference is
the one that controls the display of item type images in the staff
interface advanced search page. It was previously erroneously managed by
the OpacNoItemTypeImages system preference.

To test:

1. Add images to item types, if there aren't any already (KTD has them by default)
   1.1. Go to Administration > Item types
   1.2. Click 'Edit' next to one of the item types
   1.3. Choose an icon
   1.4. Click 'Save changes'

2. Disable OpacNoItemTypeImages

3. Enable noItemTypeImages (already enabled in KTD)

4. Go to the advanced search page
   --> The item types don't have any images next to them

5. Apply patch and refresh the page
   --> The item type images should be displayed

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 55632527fc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:45 +02:00
Imani Thomas 8ee985911e
Bug 36229: Move koha-run-backups to the top of the cron
test plan:
    1. check run order of scripts in the cron
    2. apply patch
    3. koha-run-backups is now at the beginning of the cron

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 814e1326b7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:44 +02:00
Jonathan Druart be75a5ce94
Bug 38855: (bug 22056 follow-up) Remove 'test' directory template-side
This should have been removed by bug 22056

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 90774b33a7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:43 +02:00
Pedro Amorim a590750430
Bug 38505: CirculateILL: Add ILL::Request::check_out regression tests
prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 642f21a6f2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:43 +02:00
Pedro Amorim df52748092
Bug 38505: CirculateILL: Add UNKNOWN_BARCODE warning message
Test plan, before applying patches:
1) Enable ILLModule system preferece.
2) Create a book ILL request:
  <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) After creating a Book ILL request, go to its detail page and click on the newly created linked biblio
4) On the biblio detail, click 'NEW' -> 'New item', add type and home library + current library (dont enter a barcode)
5) Repeat 2) -> Click confirm request and continue.
6) Click "Check out" -> If theres a problem with the patron (expired or max checkouts hit) it'll say "A problem with patron occurred". Fix that adn click c"check out" again.
7) Notice the message "An unknown error occurred while trying to checkout the item"
8) Apply patches. Repeat. Notice the message you now get is 'The bibliographic record's item contains an unknown (or empty) barcode.'.

This patch also adds a link to the respective biblio for Staff members'
convenience.

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ecd0604a8d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:42 +02:00
Pedro Amorim 4af7516065
Bug 38505: ill-requests.tt: Use .alert-warning when .alert exists
Cosmetic changes only.

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 90304e7632)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:41 +02:00
Pedro Amorim af48f1b8bd
Bug 38505: CanBookBeIssued preparation: Appropriate behavior when barcode is falsy
Before applying this patch, apply the CanBookBeIssued preparation: tests patch and run that,
Verify it fails, apply this patch. Run that same tests file again.

----- About this change -----

CanBookBeIssued wants to find one item given a barcode.
If a falsy (undef, empty) barcode is supplied, UNKNOWN_BARCODE should be returned.

Ensure this change does not introduce any regressions:
prove t/db_dependent/Circulation*
prove t/db_dependent/DecreaseLoanHighHolds.t
prove t/db_dependent/rollingloans.t
prove t/db_dependent/api/v1/checkouts.t
prove t/db_dependent/Patron/Borrower_PrevCheckout.t

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 89b7f160a7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:41 +02:00
Pedro Amorim 5cc10bb9bf
Bug 38505: CanBookBeIssued preparation: Add tests for falsy barcode
prove t/db_dependent/Circulation.t

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 45626c75c4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:40 +02:00
Martin Renvoize a52ab11e82
Bug 37448: (QA follow-up) Move POD to make QA Script happy
This particular script has POD at the end rather than inline POD. This
patch simply moves the POD addition for this patchset into the bottom
section.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 25fd262192)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:39 +02:00
Pedro Amorim c620d76399
Bug 37448: Add build_sample_ill_request
The linked biblio_id of a generated test ILL request needs to be created by build_sample_biblio->AddBiblio.
Or else the related biblio is created by just 'build' and is not indexed + its related metadata is missing.

To test:
1) Apply the [DONT PUSH] patch and enable ILLModule
2) Run the script for ILL requests:
  misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=Standard
3) Visit the ILLModule:
  http://<intra_url>/cgi-bin/koha/ill/ill-requests.pl
4) Notice it loads 5 test ILL requests correctly

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c42cfecd43)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:38 +02:00
Kyle M Hall c0a51634f5
Bug 37448: Add script to allow developers to quickly generate large amounts of data for development and testing
Test Plan:
1) Apply this patch
2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall  -d zipcode=111111
3) Search patrons' for the name "Hall"
4) Note there are 99 Hall's in your results!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Bug 37448: Make use of build_sample_biblio and build_sample_item

The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed

To test, before this patch, run:
1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test
  Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio)
2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 37448: (QA follow-up) Tidy script

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 576621a6df)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:38 +02:00
Pedro Amorim cb26be6d27
Bug 38751: Update Standard ILL backend migrate
Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually

The test plan in bug 38819 fails without this patch (page explodes with duplicate ID error).
It's the same cause as the one being fixed here in bug 38751 so I'm submitting this here.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 92fd65840a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:37 +02:00
Pedro Amorim 2dfdc7c491
Bug 38751: Update Standard ILL backend add_request
Make use of newly updated ILL::Request->extended_attributes method instead of
creating the query manually

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6526e00374)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:36 +02:00
Pedro Amorim 898880da96
Bug 38751: Add tests
prove t/db_dependent/Koha/ILL/Request.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2a6bc075f6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:36 +02:00
Pedro Amorim 0b3f441166
Bug 38751: Update ILL::Request->extended_attributes
This updates the extended_attributes method to also act as setter.
Additionally, it'll skip adding any attribute that result in error,
preventing an ugly error 500.

Test plan:
1) Enable ILLModule sys pref
2) Attempt to create the following openurl request through the OPAC:
   http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?DOI=10.1001%2Fjama.2024.11146&atitle=Interventions%20for%20High%20Body%20Mass%20Index%20in%20Children%20and%20Adolescents%3A%20US%20Preventive%20Services%20Task%20Force%20Recommendation%20Statement.&aulast=Nicholson%2C%20Wanda%20K.&backend=FreeForm&cardnumber=53807898&date=20240716&genre=article&id=DOI%3A10.1001%2Fjama.2024.11146&issn=00987484&issue=3&method=create&opac=1&openurl=1
3) Notice it fails with a Duplicate ID error and the OPAC blows up.
   This is because Koha is trying to add the 'DOI' illrequestattribute
   twice and that is resulting in a duplicate ID
4) Apply patches, repeat test plan, notice the error no longer happens,
   the request is created correctly and all successful attribute have
   been added.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9fc470c0a8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:35 +02:00
David Cook 92a428ba48
Bug 38846: Only call getLanguages for advanced search pages
This change makes it so that C4::Languages::getLanguages is only
called for the advanced search pages and not the search result pages
where the output is not used.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?expanded_options=1
2. Note that the "Language" and "Language of original" dropdowns appear with language
options
3. Go to the following
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?advsearch=1
&idx=kw&q=test&sort_by=relevance
4. Note that the page loads normally

5. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?expanded_options=1
6. Note that the "Language" dropdown appears with language options
7. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
8. Note that the page loads normally

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 996ec95274)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:34 +02:00
Martin Renvoize 9f4ce28da5
Bug 38857: (QA follow-up) Fix perltidy errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9e894ee790)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:33 +02:00
Nick Clemens 85e586af8d
Bug 38857: Update cronjobs to log run before processing parameters
A few notes:
- I grabbed this list by looking for things in misc/ that had cronlogaction
- I didn't touch scripts that aren't in the cronjobs directory, except
  fix_invalid_dates where I follow import_patrons and only log if confirmed
  since they aren't crons, I figure this seems reasonable
- purge_suggestions I moved the logggin up and changed the addition of
  effective days to a verbose message - this seems more consistent

To test:
 1 - Enable CronjobLog
 2 - On command line:
     perl misc/cronjobs/cleanup_database.pl --old_reservers 550
 3 - Error on command line
 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit
 5 - No entries
 6 - Apply patch
 7 - Repeat and see run is logged with wrong parameter
 8 - Fix parameter and confirm
 9 - Spot check other files until you are satisfied
10 - Sign it off!

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ed04d5b0fa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:33 +02:00
Lucas Gass de8c20de12
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form
To test:
1. FinesMode on
2. CircConfirmItemParts on
3. have an item with a materials specified note (952$3)
4. Check in item with 'forgive overdue charge' selected, no materials note, box stays checked.
5. Check in item with 'forgive overdue charge' selected, with a material note, Materials note checkin deselects the box.
6. APPLY PATCH
7. Try steps 4-5 again, the correct value should be retained in the 'forgive overdue charge' checkbox.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5a3380a751)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:32 +02:00
Nick Clemens c88bed8554
Bug 14907: Sort item search by cn_sort when sorting by callnumber
This patch simply intercepts a call to sort by callnumber and changes it to cn_sort

To test:
1 - Add three items:
    barcode TEST1 callnumnber D1015.B4 1965
    barcode TEST2 callnumnber D102.D3 1930
    barcode TEST3 callnumnber D101.2.A8 1951
2 - Go to item search
3 - barcode is 'TEST%'
4 - Sort the results by callnumber
5 - order is TEST3,TEST1,TEST2 (or reversed depending on sort direction)
6 - Apply patch, restart_all
7 - sort again
8 - order is TEST3,TEST2,TEST1 (or reversed depending on sort direction)

Signed-off-by: Gretchen Maxeiner <maxeinerGL@gcc.edu>
Signed-off-by: Heather Hernandez <flyingendpaper@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eecb123bd5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:31 +02:00
Nick Clemens 13471ab545
Bug 14907: Unit tests
Signed-off-by: Gretchen Maxeiner <maxeinerGL@gcc.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ef9c0f6872)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:31 +02:00
Martin Renvoize 20daebce79
Bug 38646: (follow-up) Ensure consistent ordering of languages
We add an `ORDER BY` clause to the SQL statement to ensure we
consistently order accross databases by the iso code.

This fixes the failing test on MariaDB as it's default sort order
appears to differ from MySQL for this.

This also ensure we are consistently ordering which will lead to more
consistent and clear results for end users.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7da684a507)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:30 +02:00
Martin Renvoize e68d757bdb
Bug 38646: Update unit test for change
This drops the bracketed translation in the tests in
language_description where the bracketed language name matches the
preceeding one.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6e59b40f55)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:29 +02:00
Martin Renvoize f57011dc2e
Bug 38646: (QA follow-up) Fix ONLY_FULL_GROUP_BY
We can use a plain AND in the WHERE clause here rather than requireing a
HAVING.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 24379efb10)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:29 +02:00
Michał Kula 1644149866
Bug 38646: rewrite C4::Languages::getLanguages to use a single cachable SQL query
My profiling with NYTProf has found that the call to C4::Languages::getLanguages is unreasonably slow, taking over 100 ms (and that's just on a single call of it apparently!!!). Indeed, the way it's coded, it'd run over 540 SQL queries for no good reason, slowing the already slow catalog search page loading further down.

This patch is gonna replace the inefficient and complicated function logic with proper SQL statement that joins the relevant functions. It also fixes the bug where user's native language would be displayed with native language in the parenthesis as well, such as "Polski (Polski)" instead of just "Polski".

The whole query is pretty fast and it gets cached by MySQL server, meaning its runtime is measured in microseconds instead of hundreds of miliseconds, making it easily a 1000x+ improvement.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 26a6e476f1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:28 +02:00
Martin Renvoize a62f249b75
Bug 38646: Improve unit test coverage
This patch adds proper coverage of getLanguages() to the existing test
file.

It should pass prior to applying the rest of the patchset of this bug

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 08bd56d1f7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:27 +02:00
Paul Derscheid b1ec75d802
24.11.04: Update contributors.yaml
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-22 23:01:05 +02:00
Lucas Gass 5f871921ba
Bug 39283: Concat middle name with preffered name if it exists
1. Have a patron with a middle name
2. Do a patron search that brings them up, no middle name appears
3. APPLY PATCH
4. Try again, middle name should appear in patron searches.

QA follow-up: made the same fix inline for other_name

Signed-off-by: Bibliothèque Ifao <bibliotheque@ifao.egnet.net>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3888d1ee7a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:36 +02:00
Jonathan Druart d90814bf03
Bug 39077: Do not complain about obsolete translations
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8c0d196ff6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:36 +02:00
Jonathan Druart ac57c62b15
Bug 34068: Mock RESTdefaultPageSize
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 27ea32e74b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:36 +02:00
Jonathan Druart 809a6735d8
Bug 34068: Fix tests
Several wrong things in the previous attempt:
* as_list returns an array
* as_list returns objects, ->{library_id} does not exist
* as_list does not returns api object, you need to call ->branchcode to
  get the id
* $pickup_locations defined for both situations was confusing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 44b29d114f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:36 +02:00
Jonathan Druart 9854dee78b
Bug 34068: Add tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 04c095c473)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:35 +02:00
Matt Blenkinsop a3a0d6dbb3
Bug 34068: Fix pagination for hold pickup locations
This patch addresses an issue where pagination filters are set incorrectly for the pickup locations endpoint. Only the final page is returned rather than the expected full list of results

Test plan:
1) In KTD, set the syspref RESTdefaultPageSize to 5
2) Set AllowHoldPolicyOverride to Allow
3) Create a hold on an item for a patron
4) Navigate to the patron's page and click on the holds tab
5) Click the dropdown in pickup locations
6) There will be two results, repeated three times
7) Apply patch and restart_all
8) Repeat step 5, there should now be a full list of 12 libraries

Co-authored-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37f85baed4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:35 +02:00
Leo Stoyanov 51194d6e2b
Bug 37927: Fixed report name on page title not showing up when viewing SQL
To test:
1. Create a SQL report.
2. Go to /cgi-bin/koha/reports/guided_reports.pl?id=1&op=show.
3. Inspect element the page, go to the head, and find the title; it should have no report name or id.
4. Apply patch.
5. Redo steps 1-3 to see the fix.

Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c500a8ac8c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:35 +02:00
Martin Renvoize 1bb41e48ef
Bug 38423: Add unit tests
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 210e0cb18b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:35 +02:00
Martin Renvoize a269b1e295
Bug 38423: Code more defensively in process_invoice
We re-arrange the logic of process_invoice a little here to ensure we
skip order lines in invoices that do not have corresponding bib records.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit af19a0f553)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:35 +02:00
Kyle M Hall 5851316ff8
Bug 22415: (QA follow-up) Fix misc qa issues
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7fb78e4a5d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:35 +02:00
Martin Renvoize 0dad7ecaf6
Bug 22415: Add new log config for EDI
This patch adds the Log4perl configurations required to match the
existing prior use of Log4perl in EDI code.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f3511eaec)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:34 +02:00
Martin Renvoize 318aa5103c
Bug 22415: Update EDI to use Koha::Logger
This patch updates the EDI code to use the Koha::Logger wrapper in
preference to the bare Log::Log4perl module.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7f6c186831)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:34 +02:00
Jonathan Druart 4268d7d53b
Bug 38147: Fix Edit and Cancel translatability in booking table
It seems that "Edit" was not picked by the translator script because there was a TT tag
on the same line.

See comment 0 for a test plan.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8c3a42aa02)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:34 +02:00
Kyle M Hall e549f533e0
Bug 38810: SIP account level system preference overrides not properly cleared between requests
Account level syspref overrides in SIP will "leak" between SIP requests.

Basically an account level system preference override will may be set by a given request, but those overrides will never be cleared for the life of that SIP process thus "contaminating" that process until it reaches end of life".

This is because the code
    # Clear overrides from previous message handling first
    foreach my $key ( keys %ENV ) {
        delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') > 0;
    }
is checking if the env key contains the substring OVERRIDE_SYSPREF_ at an index greater than 0. The problem is that for all overrides the subtring *starts at 0* since it's always the first part of the string. If the substring is not part of the string index will return -1. TLDR we have an "off by one" error. We need to check that the return value is zero instead of any positive value.

1) Set your SIP server params so that only one SIP process should run,
  <server-params
    min_servers='1'
    min_spare_servers='0'
    max_spare_servers='0'
    max_servers='0'
    custom_tcp_keepalive='0'
    custom_tcp_keepalive_time='7200'
    custom_tcp_keepalive_intvl='75'
  />
2) Set noissuescharge to $5
3) Create two SIP accounts
4) Set an account level override for noissuescharge to $500
5) Create a patron that owes $10 in fines
6) Run a patron information request on the "normal" SIP account for the
   patron, the patron flags should show the patron being not able to
   check out items
7) Run a patron information request of the "overridden" SIp account for
   the patron, the patron flags should show the patron being allowed to
   check out items
8) Run a second patron information request on the "normal" SIP account
   for the patron, the patron flags should show the patron being able to
   check out even though they should not be able to check out
9) Apply this patch
10) Restart all the things!
11) Repeast steps 6-8
12) The flags should be correct!

Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit de83983b98)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:34 +02:00
Jonathan Druart eb03255298
Bug 38827: DataTables - Do not filter when inputs lose focus
On a table using DataTables and the REST API wrapper with the column
filters, if one input is used to filter the table the query will be made
twice: when the user stopped typing and when the input will lose the
focus.

Test plan:
Search for patron
Open the dev console, "Network" tab
In the "Card" column filter enter "0000"
Notice that the table is filtered and that a request has been made
Click outside of the "Card" input
=> Without this patch another request (the same) is made and the table
updated
=> With this patch applied no request is made when the input loses the
focus.

Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e32533ef22)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:34 +02:00
Paul Derscheid 8ba5ea83c7
Bug 33268: DBRev 24.11.03.001
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:34 +02:00
Victor Grousset/tuxayo 69b876a007
Bug 33268: (QA follow-up): tidy up code
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cd04d58522)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:33 +02:00
David Gustafsson a2d02061b6
Bug 33268: If rules exists add rules to preserve current behavior
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e2c0403440)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:33 +02:00
David Gustafsson 6fd5870d85
Bug 33268: Overlay rules don't work correctly when source is set to *
Fallback to overlay rules with wildcard filter if no match
found for exact filter match.

To test:
1. Administration => record overlay rules
2. Add this:
Module  Filter	                   Tag Preset  Added Appended Removed Deleted
Source  Z39.50 	                   245 Protect Skip  Skip     Skip    Skip
Source  * 	                   300 Protect Skip  Skip     Skip    Skip
Source  Batch record modification  245 Protect Skip  Skip     Skip    Skip
3. Add MARC modification templates:
Update existing or add new field 245$a with value CATSCATSCATSCATS
Update existing or add new field 300$a with value CATSCATSCATSCATS
4. Find a record that has those fields (likely any record would)
5. Use batch record modification on the record
6. 300$a should have been catified (expected, that's the bug)
7. 245$a is preserved
8. Change the value of the 300$a to something else.
   Temporarly disable MARCOverlayRules to be able to do so. And reenable
   it.
9. Apply the patch, restart services
10. Use batch record modification on the record
11. 300$a should be preserved, cat protection should have worked
12. Run tests: prove t/db_dependent/Biblio/MarcOverlayRules.t
13. Celebrate! :D

Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied inline (tcohen)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cb2d98fc5b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:33 +02:00
David Gustafsson 850da7cd4f
Bug 33268: Add tests for context module priority
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied inline (tcohen)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3168da6e39)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:33 +02:00
David Gustafsson 199672f6bc
Bug 33268: Add tests
Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 03d6f83546)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:33 +02:00
Paul Derscheid a2c394207b
24.11.04: Update contributors.yaml
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-17 14:30:29 +02:00
Pedro Amorim ac5a417281
Bug 38738: Only close select element if needed
Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c

Test plan, apply both patches:
1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Notice the message 'This message should only show if a select input is present' only shows for select inputs, i.e. it's only closing the element when it needs to

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 885f33bdd6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:19 +02:00
Nick Clemens 9b8caef9a2
Bug 38777: Use branch reply to for HOLD messages
When sending a notice of a hold ready for pickup (not digest) we use the library where the hold is at.

We should also use this when setting the reply to.

To test:
1 - Set the email/replyto for a patron's library to be:
    patron@example.com
2 - Set the email/replyto for another branch to be:
    holdbranch@example.com
3 - Place a hold for the patron for pickup at the other branch
4 - Check in and set hold waiting
5 - SELECT * FROM message_queue
6 - Note the message is from the hold branch, but has a null replyto
    This means we will use patron branch when sending
7 - Apply patch
8 - Revert hold waiting status
9 - Checkin and confirm hold again
10  -Check message queue
11 - Hold now has reply address of branch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 723ed39c2a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:19 +02:00
Jonathan Druart 7d5e03fec7
Bug 38724: Do not show the filters when updating col vis (if not needed)
(In reply to Brendan Lawlor from bug 38632 comment #7)
> During testing I noticed small related bug in current main. On the
> bibliographic record details page if you click to configure columns and you
> add or remove a column it automatically shows the column filters too, but it
> does not toggle the filter link to 'Hide filters` so you have to click twice
> to hide them.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 11500e7352)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:18 +02:00
Andrew Fuerste Henry ac964e2658
Bug 38790: Add classes to item information on moredetail.pl
to test:
1 - Have a bib with multiple items
2 - view those items on the Items tab (moredetail.pl), confirm various parts of the page are not classed and are therefore hard to target with CSS, etc
3 - apply patch
4 - reload page, observe there are classes on things but the display and data have not changed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1938c510dd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:18 +02:00
Katrin Fischer 6007514751
Bug 26211: (QA follow-up) Shorten error message
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 891b10311b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:18 +02:00
Lucas Gass a47162d1c7
Bug 26211: (follow-up) Remove age_low and age_high template variables
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d0cbb308f7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:18 +02:00
Amit Gupta 0c20d9ac45
Bug 26211: Patron age verification while doing the self-registration.
To Test
1. Create the patron category from the staff page for ex: Kid and give age required and age Upperage limit
   age required 5 yrs and upperage limit 17.
2. Allow category in PatronSelfRegistrationDefaultCategory for online registration from opac.
3. Go to /cgi-bin/koha/opac-memberentry.pl page.
4. Fill the form and give choose date of birth 10/10/1974 and click OK. Now you can able to save the page.
5. Apply the patch.
6. Again go to cgi-bin/koha/opac-memberentry.pl page.
7. Fill the form and give choose date of birth 10/10/1974 and click OK. It will give the error message.
   Patron's age is incorrect for their category. Ages allowed are 5-17.

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 579389ed32)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:18 +02:00
Jonathan Druart d8ad5d8637
Bug 38377: Improve translatability of "%s/%s renewals remaining"
See comment 0
The sentence in English: "2 of 3 renewals remaining" is translated as  "2 uzatma hakkınızdan 3 tane kaldı" in Turkish.
This is wrong. Right Turkish translation must be like this : "3 uzatma hakkınızdan 2 tane kaldı"

We cannot use %s/%s as the order will be preserved, we need to use named
placeholders.

Test plan:
Apply this patch
% gulp po:update --lang LANG
Go to misc/translator/po
% git grep 'renewals remaining'
Translate the occurrences, remove fuzzy
sudo koha-translate --update LANG --dev kohadev
restart_all
Enable LANG for both staff and OPAC
Have a look at the checkouts table and notice that the strings have
been correctly translated

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 674ff624b3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:18 +02:00
Brendan Lawlor 13ebb74803
Bug 38698: Fix Acquisitions duplicate orders search
This patch updates the field for the created by filter from
ui.item.borrowernumber to ui.item.patron_id

To test:

1. Add a vendor and a basket
2. Stage a file and add an order to the basket
3. Add another basket and add an order using From existing orders (copy)
4. On the Duplicate existing orders page search for Basket created by: 'koha'
5. No results appear :(
6. Apply patch and repeat steps 3 and 4
6. Confirm the search returns the basket you created earlier

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 50c5d167bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:17 +02:00
danyonsewell d4ac3fa2c2
Bug 36729: Add publisher/distributor number to standard identifier search index
Have written a patch to allow Publisher/Distributor number to be searched using the standard identifier search index.

Testing plan:

1. Start up KTD with Elasticsearch: ktd --es8 up
2. Apply the patch and restart everything (restart_all).
3. Reset the mappings: Administration > Catalog > Search engine configuration (Elasticsearch) > Reset mappings (at the bottom of the page)
4. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
5. Alternative to steps 3 and 4: reset_all
6. Update the visibility for 028a in the default framework so that it is visible in the Editor.
7. Add a new record using the default framework and put a term in 028a.
8. Using the advanced search "Standard number" Field, search for the term you put in step 7.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ee69f07c29)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:17 +02:00
Katrin Fischer 068f023b40
Bug 33454: (follow-up) Use tx() to improve translatability
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d8cbdfa2df)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:17 +02:00
Emily Lamancusa 447b118958
Bug 38765: Parse dates correctly
Some dates in invoices.tt are being formatted to the system DateFormat
when they are not being displayed, which causes processing errors when
the code expects ISO format. Dates should be formatted for local format
only when they are being displayed.

To test:
1. Go to Acquisitions and create some invoices
    i. Search for a vendor (can submit a blank search box)
    ii. Click on vendor name
    iii. Click "Receive shipments" button
    iv. In the "Receive a new shipment" section, enter any value in the
        "Vendor invoice" field and click "Next"
    v. Click the "My Vendor" breadcrumb and repeat iii-iv a few times
2. Go to Acquisitions > Invoices
3. Search for some invoices (can submit with all blank filters)
4. Select the checkboxes by two or more invoices
5. Click "Merge selected invoices"
6. Click "Merge" without editing the input data at all
--> Internal server error! "The given date <date> does not match the
    date format (iso)"
7. Apply patch
8. Repeat steps 2-6
--> The invoices are merged successfully!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 80a5022129)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:17 +02:00
Katrin Fischer ff814e9d92
Bug 38771: Add "Auth" prefix to system preference search query
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 907118e9b0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-14 11:59:13 +02:00
David Cook 29ba9d81c7
Bug 39460: Fix koha-upgrade-schema when no DB change needed
This patch fixes koha-upgrade-schema so that it returns an exit
code of 0 whether or not a DB change is needed. This is important
so that koha-common.postinst proceeds correctly even when there
is no DB change needed (e.g. for 24.11.03-2)

Test plan:
0. Apply the patch
1. cp debian/scripts/koha-upgrade-schema /usr/sbin/koha-upgrade-schema
2. dpkg-reconfigure koha-common
3. Note the process completes correctly
4. koha-upgrade-schema kohadev
5. Note following text appears very quickly:
Upgrading database schema for kohadev
No database change required
6. koha-mysql kohadev
update systempreferences set value = '24.1102000' where variable = 'Version';
7. Clear memcached
8. koha-upgrade-schema kohadev
9. Note that it applies the 24.11.03 database upgrade

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-04-02 17:02:14 +02:00
Jonathan Druart 043451b08d
Bug 38684: Fix problem with koha-translate
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3c1a4a2ffb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-25 15:55:49 +01:00
Paul Derscheid 3224a2fac1
Merge branch '24.11.x-security' into 24.11.x
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-25 09:44:04 +01:00
Paul Derscheid 8adac85be4
Update release notes for 24.11.03 release 2025-03-24 19:24:58 +01:00
Paul Derscheid d391a7f1a2
Increment version for 24.11.03 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:13 +01:00
Paul Derscheid 0ebbfe802b
24.11.03: Update contributors.yaml 2025-03-24 18:13:11 +01:00
Paul Derscheid a993704ec5
Bug 38108: DBRev 24.11.02.001
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:11 +01:00
Katrin Fischer 30007f6f98
Bug 38108: (follow-up) Amend system preference description with "staff interface"
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 707d3b3563)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:10 +01:00
Emily Lamancusa 84fd8d28e7
Bug 38108: (QA follow-up) Use say_success in dbrev
Use say_success instead of say when outputting a line that the
system preference was added successfully

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 606cd8d63e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:09 +01:00
Lucas Gass a994955855
Bug 38108: Add ability to show/hide table filters via system preference
To test:
1. APPLY PATCH, updatedatabase, restart_all
2. Search for the 'AlwaysShowHoldingsTableFilters' system preference. It should be set to 'Don't'.
3. Without changing the system preference, go to a record detail page.
4. The filters should not show by default.
5. Make sure that toggling the Hide filters/Show filters button still work as expected.
6. Set 'AlwaysShowHoldingsTableFilters' to 'Do'.
7. Now the filters should show by default when you load the table.
8. Make sure that toggling the Hide filters/Show filters button still work as expected.

Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 04f398890e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:09 +01:00
Lucas Gass e3318f2fec
Bug 38108: Add system preference AlwaysShowHoldingsTableFilters
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9a55785c8b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:08 +01:00
Jonathan Druart 5a2ac2285e
Bug 38632: Do not show all columns when displaying the filters
Yet another visibility bug fix for this specific table.
When the filters are displayed the table is destroyed and recreated.
We should not save the visibility changes made by DT and consider them
changes made by the user.
A temporary variable is used to store the user settings duringt this
action, then we restore them once it's done.

Test plan:
Go to the detail page of bibliographic record with items
Click on "show filters"
=> Only columns displayed should still be displayed
Retry but show/hide some columns before you display the filters
=> Only columns displayed should still be displayed

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0fefe2bed5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:08 +01:00
Lisette Scheer dd9c0d846c
Bug 39172: Merging records no longer compares side by side
This patch updates the cataloging merge screen to restore side-by-side
comparison.

Both columns had ids added by the patch for formatting purposes.

To test:
1. Go to cataloging module
2. Do a search (in sandboxes/ktd 1 works)
3. Select 2 or more records to merge
4. Click the "merge selected" button
5. Observe there are 2 columns on top of each other instead of side by
   side
6. Apply the patch
7. Restart all & rebuild css
8. Repeat steps 1-4
9. Observe the columns are side by side again.
10. Sign-off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jason Vasche <jvasche@roundrocktexas.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4156022d8a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:07 +01:00
Andrew Fuerste Henry d4d4df1102
Bug 39025: Use old_issue_id for issue details on patron account screens
To test:
1: Have an item that is checked out, overdue, and showing an accruing fine
2: On the patron account, check both Make A Payment and Transactions tabs, confirm that the fine shows Due Date, Checkout Date, and Checked Out From values
3: Check your item in
4: Reload the patron account, confirm that the fine no longer shows checkout data on either Make A Payment or Transactions
5: Apply patch
6: Reload pages, confirm Make A Payment and Transactions tabs now show values in Due Date, Checkin Date, Checkout Date, and Checked Out From

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 41a368f35e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:07 +01:00
Nick Clemens 622abfa3b2
Bug 39108: Prevent 'Ignore' on found hold from triggering a new modal
When ignoring a waiting hold, we don't need to take any further action, we
shoudlsimply close the modal

This patch adds JS to prevent form submission

To test:
1 - place a hold
2 - check in an item that can fill the hold
3 - in the hold found modal, click Ignore
4 - the modal dismisses and nothing changes on the hold (this is the desired behavior)
5 - check in the item again, click Confirm Hold, confirm your hold is now Waiting
6 - check in the item again, confirm the modal says "Item is already waiting"
7 - click Ignore, confirm modal reloads
8 - click Ignore, confirm modal reloads
9 - click Ignore, confirm modal reloads
10 - Apply patch
11 - check in the item again, click Confirm Hold, confirm your hold is now Waiting
12 - check in the item again, confirm the modal says "Item is already waiting"
13 - click Ignore, nothign happens! Orange you glad I didn't say banana?

Signed-off-by: Amanda Campbell <acampbell@hmcpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 177d648ded)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:06 +01:00
Lucas Gass 708f14ce56
Bug 39270: Check to make sure checkouts are not already booked
To test:

1. Find an item that is bookable, I turned on Bookable at the item type level for BK. I am using biblionumber=28 in k-t-d with 3 items
2. Book item with barcode ( 39999000001297 ). I did March 7 - April 1
3. Book item with barcode ( 39999000001259 ). I did March 7 - April 1
4. Now checkout 39999000001297 to the patron is was booked to. When asked about early collection say yes.
5. Now item with barcode ( 39999000001273 ) is not checked out or booked. It should be bookable
6. Try to book it, it is not available till April 2, though it should be available right now.
7. APPLY PATCH
8. Try the bookings again.
9. You should correctly not be able to book 39999000001297 or 39999000001259.
10. You should be able to book 39999000001273.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37c8c6606a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:05 +01:00
Nick Clemens d0f50136c8
Bug 37920: Add cronjob loggging to writeoff_debts.pl
This patch adds the same logging as other cronjobs have

To test:
1 - Enable system preference CronjobLog
2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01
3 - Check the logs - no entries
4 - Apply patch
5 - Repeat 2
6 - Check the logs, two entries - one for the start and one for the end

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested on top of bug 39236. Works as advertised.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit de9c1a8ff2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:05 +01:00
Nick Clemens 358c60bee0
Bug 39236: writeoff_debts.pl needs adjustments
From bug 22435 - we need to use 'CREATE' as the account_offset type
From bug 31095 - we need to 'use Koha::Patrons;'

To test:
1 - Add a fine to a patron account
2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01
3 - Cronjob dies
4 - Apply patch
5 - Rerun
6 - Job succeeds!
7 - Confirm patron's fine is written off
8 - Sign off

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 93e2a0953d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:04 +01:00
Paul Derscheid a0d2779c31
24.11.03: Update contributors.yaml
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:04 +01:00
Phil Ringnalda 1e9c53d0b8
Bug 38853: Make 'Cancel selected' on holds table work
Because 'Cancel selected' on the table of existing holds uses
$("#cancel_modal_form #inputs").empty; rather than empty();, it fails to
clear out whatever things are in there before it puts in the things it wants.
That leaves things in a confused state, and makes it fail to actually cancel
holds.

Test plan:
1. Without the patch, add a hold to any bib record
2. Select the checkbox for the hold you placed, then click 'Cancel selected'
   and confirm that you want to cancel
3. Note that there's no message box about a background job having been
   enqueued, and no matter how long you wait, the hold doesn't go away
4. Apply patch, repeat step 2, note that there's now a message box, and
   when the background job finishes, that the hold has been deleted.

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3bd4a9fad6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:03 +01:00
Pedro Amorim f77d570e34
Bug 39175: Fix Attributes->Attribute
Bug introduced in FreeForm prior to adding it to core in this commit:
369dffb159 (diff-662970ddc6f6828afd23e6823399a4a32807c4a6c487a0aff86c9d116f60797dR806)

It should've been Koha::Illrequestattribute into Koha::ILL::Request::Attribute not Koha::ILL::Request::Attributes

To test, k-t-d:
1) Enable ILLModule syspref
2) Edit the only patron in k-t-d with the 'Interlibrary loan' category:
<staff_url>/cgi-bin/koha/members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=16
3) Add a valid e-mail address to 'Primary email:'
4) Create a new ILL request:
/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
5) Add any type, any valid patron cardnumber, any library. Click 'Create'.
6) Click 'Place request with partners'
7) Pick the only available partner library 'FRL-Walker'
8) Click 'Send email'.
9) Notice you get an error. Apply patch & restart plack. Repeat.
10) Confirm the there's no error and message was queue as expected:
$ select * from message_queue;

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d59a3db8d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:03 +01:00
Owen Leonard 4dc4651e67
Bug 39268: Fix tab switching on lists page
This patch fixes broken tab switching on the staff interface lists page.
It was broken by the upgrade to Bootstrap 5.

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

- If necessary, create multiple public and private lists.
- Confirm that switching between the "Your lists" tab and the "Public
  lists" tab works correctly.
- Try using URL parameters to load each tab:
  http://127.0.0.1:8081/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0
  http://127.0.0.1:8081/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3054868fc4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:02 +01:00
Nick Clemens 636c290186
Bug 39044: Pass budgets to template
This simply copies the fetch of budgets from the acqui/histsearch.pl script.

We should in the future make this a template or other method to avoid code duplication,
but we should fix the functionality first.

To test:
1 - Go to Acqusitions
2 - See the dropdown "Fund: All funds" in the order search section
3 - Click it
4 - Feel disappointed
5 - Apply patch and restart all
6 - Reload and click the dropdown
7 - Options! Feel warm and fuzzy

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c5f598d874)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:01 +01:00
Lucas Gass 7b312a9554
Bug 39244: Fix display of change password/duplicate buttons
To test:
1. Make or find some patron categoies that are not adult category type.
2. On patron pages notice that the Change password and duplicate
   buttons are missing from the toolbar.
3. APPLY PATCH
4. Try again, this time the pChange password and duplicate buttons
   should appear.
5. Make sure the 'Add guarantee' buttons still work.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9580e06e67)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:01 +01:00
Martin Renvoize f0f00c6c1d
Bug 38375: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9bed52a868)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:00 +01:00
Martin Renvoize 3967f4cbdb
Bug 38375: Use perl 5.10+ \R
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 006485a036)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:13:00 +01:00
Lari Strand ee703aba86
Bug 38375: Splitting SIP2SortBinMapping syspref does not support all operating systems' line endings
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3407dc28a3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:59 +01:00
Jake Deery 69ad16e955
Bug 38957: edifactmsgs data table sorts on date
This trivial patch addresses a missing order-by on
the edifact messages datatable since moving to API
based fetching

TO TEST:

a)  Read in a load of EDIFact messages in k.t.d
b)  Notice on the EDIFact messages table the order
    is seemingly arbitrary
c)  APPLY PATCH
d)  Notice the sorting is now by transfer date,
    descending

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 09d3fd9b95)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:59 +01:00
Emily Lamancusa 17f56ba608
Bug 39183: Only check unresolved claims
To test:
1. Set up sysprefs:
   - Set any non-empty value for ClaimReturnedLostValue
   - Set AutoClaimReturnStatusOnCheckout to "found in library"
   - Set AutoClaimReturnStatusOnCheckin to "returned by patron"
2. Check out an item to a patron
3. On the patron's account page, click the "Claim Return" button next to
   that checkout
4. Check the item in. Note the message that the claim was auto-resolved.
5. Return to the patron's account page and open the Claims Returned tab
--> Note that the claim is resolved and hidden
6. Click the "Show all 1 claims" link to view the hidden claim. Make a
   note of the resolution code and timestamp.
7. Check the item out again
--> Note the message saying that the claim was resolved, even though it
    was already resolved previously
8. View the return claim again
--> Note that the timestamp and resolution code have changed
9. Apply patch and restart_all
10. Repeat steps 2-8 with a new item
--> Note you do not get a claim resolved message on checkout this time
--> Note that the timestamp and resolution code remain the same before
    and after the checkout

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b6325dfce)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:58 +01:00
Emily Lamancusa c42c928adf
Bug 38793: Don't dismiss modal before submitting form
Remove the bs-data-dismiss attribute from the "cancel transfer" button
on the Wrong Transfer modal. The "cancel transfer" button's JS works by
adding a hidden input and then submitting the form - we don't want
Bootstrap to dismiss the modal before the embedded form has been
submitted.

Note: This bug seems to be browser-dependent. So far it has been
reproduced with Firefox, but not Chrome/Chromium or Microsoft Edge

To test:
1. Log into the staff client using Firefox
2. Set up system preferences:
   TransfersBlockCirc - Don't block
   AutomaticConfirmTransfer - Do
3. Find or create an item that belongs to a branch other than the
   logged-in branch
4. Check in the item to trigger a Return to Home transfer
5. Click OK on the modal to confirm the transfer
6. Check in the item again to trigger a Wrong Transfer modal
7. Click the "Cancel transfer" button on the modal
8. Navigate to the bib for that item and check the item status
--> The transfer wasn't cancelled - the item is still in transit
9. Apply patch and refresh the page
10. Repeat steps 6-8
--> Item shows as available - the transfer was cancelled successfully

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cdf12b9bda)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:58 +01:00
Katrin Fischer 182cd42e60
Bug 38766: (follow-up) Make confirmation message translatable
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit be1646fb80)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:57 +01:00
Emily Lamancusa 1ef8886a24
Bug 38766: Use uri filter for all parameters in referer link
Also fixes the confirmation message for deleting.

To test:
1. Go to Acquisitions and create some invoices
    i. Search for a vendor (can submit a blank search box)
    ii. Click on vendor name
    iii. Click "Receive shipments" button
    iv. In the "Receive a new shipment" section, enter any value in the
        "Vendor invoice" field and click "Next"
    v. Click the "My Vendor" breadcrumb and repeat iii-iv a few times
2. Go to Acquisitions > Invoices
3. Specify search filters for shipment to/from dates (that include the
   invoices you entered) and search for invoices
4. Try opening, closing, and deleting individual invoices using the
   Action menu
--> Internal server error! "The given date <date> does not match the
    date format (iso)".
--> Also, note that there is no confirmation dialog when deleting
5. Apply patch
6. Repeat steps 2-4
--> Confirm that invoices can be opened and closed using the drop-down
    menu with no issue
--> Confirm that both open and closed invoices can be deleted with no
    issue, and that a confirmation message displays before deleting

Note for QA: search for $KohaDates within invoices.tt, and confirm that
the $KohaDates filter is now only used for display, never for Internal
data storage/flow

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47f35a4017)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:57 +01:00
David Cook c19b6e8968
Bug 38826: Make check_api_auth $sessionID consistent
This change makes $sessionID consistently return using the session
ID and not sometimes the session object.

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' --cookie-jar /tmp/test.cookies
3. Note the Csrf-Token header value
4. Replace the <CSRF-TOKEN>, <USERID>, and <PASSWORD> tokens in the next step
using the appropriate values (eg the CSRF-TOKEN is from the previous step)
5. curl -v -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Csrf-Token: <CSRF-TOKEN>" -XPOST \
    'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    -d "login_userid=<USERID>&login_password=<PASSWORD>" \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
6. curl -XGET -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies > rec.marcxml
7. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
8. Note the Csrf-Token header value
9. curl -H "Content-Type: text/xml" -H "Csrf-Token: <CSRF-TOKEN>" \
    -XPOST -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies --data @rec.marcxml

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 04dbbcc2f2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:56 +01:00
Andrew Fuerste Henry f10e7f799c
Bug 38986: Restore Any in fund dropdown on suggestions homepage
This patch restores Any as a budget filter option on the suggestions homepage, but does not allow one to select Any when saving a suggestion

To test:
1 - have two suggestions, one with a fund assigned and one without
2 - go to /cgi-bin/koha/suggestion/suggestion.pl, use Fund filter, confirm it does not offer an Any option
3 - apply patch, reload page
4 - use Fund filter, confirm it shows Any as an option and both Any and None work properly
5 - confirm you cannot select Any when creating a new suggestion

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>

Bug 38986: Restore Any option to suggestions homepage filter

"Any" should show all suggestions, any fund value and null fund values. One should not be able to create a suggeestion set to "Any"
"None" should show only suggestions with no fund value selected. A new suggestion should default to "None"

To Test:
1: have two suggestions, one with a fund selected and one without
2: go to suggestions homepage, confirm the filter does not have an "Any" option
3: apply patch, reload page
4: confirm the fund filter on suggestion homepage now has both Any and None and they behave as described above
5: confirm the fund filter defaults to Any as you change the branch filter
6: create a new suggestion, confirm its fund defaults to None and cannot be set to Any

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit da6996c08e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:55 +01:00
Jonathan Druart b4acbebd6a
Bug 36025: Fix failure when pref is off
Prevent JS error if ExtendedPatronAttributes is off
 "Uncaught TypeError: options.extended_attribute_types is undefined"

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Makes the Cypress tests pass.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 16f528e4b4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:55 +01:00
Jonathan Druart a8380e82a5
Bug 36025: Add cypress tests
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tests pass, with the followup patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 60332e7552)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:54 +01:00
Andreas Jonsson 4bb59ec348
Bug 36025: Incorrect clause in patron search
This patch removes the search clause for
extended_attributes when there is no patron
attribute types which are searchable by default.

The clause was incorrectly added because the array
extended_attribute_types was rendered as [""]

This seems to be an issue with get_columns from DBIX Class and how that is cast when forcing an array
in the template. It returns an empty string for nothing, a scalar for a single value, and an array for multiple
values.

This patch now checks if the variable is set and has content, and wraps as an array if so. In the case of two attributes,
we do double the array, but this was true before as we always cast the return as an array.

Test plan:

* Make sure that no borrower attribute type is set to "searched by default"
  in Koha administration -> Patron attribute types.
* Enable the network monitring in the developer tools in your web browser
  (Ctrl + Shift + E in firefox or Ctrl + Shift + I and select the "Network"
  tab).
* Go to the patrons view members-home.pl (click patrons in top menu bar).
* Search for a string that will match multiple borrowers (to not be automatically
  redirected)
* Examine the ajax-request and make sure that "extended_attributes.code" is NOT
  part of the query.
* Also, in koha-testing-docker with selenium enabled,
  run 'perl t/db_dependent/selenium/patrons_search.t'
* Now set one patro attribute to searchable and searched by default and add a value for a patron, confirm search works
* Set a second patron attribute to searchable and searched by default and confirm searching works

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Did not run the selenium tests, as they have
been obsoleted.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 208a7cc3a4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:54 +01:00
Nick Clemens 779d89df0e
Bug 39282: (follow-up) Use generated budget and don't rely on existing data
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f97533c7a0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:53 +01:00
Nick Clemens 4b29adb4bc
Bug 39282: Use generated MARC record to create item and return itemnumber
When creating items from the form we need to use the MARC record we build from the HTML->XML->MARC

This patch simply uses the variable we create and ensures we pass the itemnumbers back

To test:
1 - prove -v t/db_dependent/Koha/MarcOrders.t
2 - Still failing
3 - Apply this patch
4 - Success!

Phew! We did it.

Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3f6d482410)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:53 +01:00
Nick Clemens 89302013aa
Bug 39282: Clarify use of budget codes and ids
When getting items from the form on addorderiso2709.pl we are getting actual budget id's,
we only deal with codes when fetching the values from the MARC.
The code here assigns an id into a variable called code - this patch clarifies that and
ensures that we fallback to using the id if one has been passed from the interface form

To test:
0 - Apply first two patches
1 - prove -v t/db_dependent/Koha/MarcOrders.t
2 - It fails
3 - Apply this patch
4 - It fails?

Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fd609d9bb3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:52 +01:00
Nick Clemens 21350cb20d
Bug 39282: Ensure items are created using Item Information values if not using MarcItemFieldsToOrder
When using MarcFieldsToOrder and not MarcItemFieldsToOrder it is expected that all of the item
information will come from the second tab 'Item information' on addorderiso2709.pl

Currently we are not and blank items are beign created

To test:
 1 - Apply unit tests
 2 - prove -v t/db_dependent/Koha/MarcOrder.t
 3 - It fails
 4 - Set MarcItemFields to Order:
     price: 949$p
     quantity: 947$c
     budget_code: 947$f
 5 - Ensure MarcItemFieldsToOrder is blank
 6 - Find a basket in acquisitions
 7 - Add to basket from a file
 8 - Fill item information, set 'Matching' at top of form to 'Do not look for matchign records' and save
 9 - Orders are added
10 - Click on a title
11 - Items do not load and an error is generated, this is because items don't have any values
12 - Check the DB:
     SELECT * FROM items WHERE homebranch IS NULL\G
13 - Note items from order are listed
14 - Apply the rest of the patches
15 - Repeat 6-10
16 - This time the items load successfully

NOTE: This patch alone doesn't address all errors, but subsequent will, keeping separate to address
each issue individually, but test plan can be executed as a whole against all

Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5034c27628)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:52 +01:00
Nick Clemens 2bf988a5d4
Bug 39282: Unit tests for item creation
Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a68623009b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:51 +01:00
Matt Blenkinsop 2f4d62bb8d
Bug 39007: Update API spec and unit test
Test plan:
1) Run prove t/db_dependent/api/v1/erm_sushi_services.t - FAIL
2) Apply patch
3) Repeat step 1 - PASS
4) Inspect patch diff and note that last_audit has been added to the API definition

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5d67151107)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:51 +01:00
Nick Clemens dc765520c1
Bug 38459: Ensure cities field works in patron quick add
This patch adjust the selector for quick add and updates the change event for the city
dropdown to affect quickadd fields as well

To test:
 1 - Administration->Cities and towns
 2 - Define several cities
 3 - http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronQuickAddFields
 4 - Select city,state, zipcode and some other fields
 5 - Patrons->Quick add new patron
 6 - Note city field/dropdown does not show
 7 - Apply patch
 8 - Reload
 9 - City dropdown shows!
10 - State and zip are updated when city is selected!
11 - Celebrate!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b007966f44)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:50 +01:00
Emily Lamancusa c69e7864f6
Bug 38789: Add block class to WrongTransfer modal
To test:
1. Find or create an item belonging to a branch other than the logged-in
   branch
2. Check in the item and click OK in the "transfer to home" modal
3. Check the item in again
--> The Wrong Transfer modal should appear, but it doesn't!
4. Apply patch
5. Cancel the transfer or find a different item
6. Check in the item and click OK in the "transfer to home" modal
7. Check the item in again
--> The Wrong Transfer modal should appear
8. Click OK
9. Open the bib record for that item in a new tab
--> The item should have a status of "In transit"
10. Change the system preference TransfersBlockCirc to don't block
11. Check the item in again
--> The Wrong Transfer modal should still appear
12. Confirm that you can click outside the modal to dismiss it without
    choosing an option

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 46e025d08c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:49 +01:00
Owen Leonard 4fa4464601
Bug 35808: Remove obsolete responsive table markup from several pages in the OPAC
This patch removes span.tdlabel from several templates. The markup is
obsolete now that we use the DataTables responsive feature.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- Log in to the OPAC as a user with checkouts, suggestions, and tags.
- Check these pages to confirm that the tables on each one have the
  correct responsive behavior at varying browser widths:
  - OPAC home -> Most popular
  - Your account
  - Your account -> Checkout history
  - Your account -> Suggestions
  - Your account -> Tags
* The recalls history page is fixed in Bug 37158

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2627cfbe1d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:49 +01:00
Eric Garcia 3565e9c59a
Bug 33454: Improved breadcrumbs for patron lists
To test:
1. Apply patch
2. Tools -> Patron lists
3. Create a new patron list
4. Click on the name of your new list
5. Notice the breadcrumbs are changed to "Add patron to 'LIST NAME'"
6. Return to Patron lists
7. In your patron list select Actions -> Add patrons
8. Notice the breadcrumbs are the same

Signed-off-by: Fiona Borthwick <fiona.borthwick@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3c6ea779e7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:48 +01:00
Owen Leonard 4f397d23db
Bug 38221: Add Bootstrap styling to pagination in authority plugin search results
This patch updates the markup of pagination links in the authority
search popup so that they have Bootstrap styling consistent with other
pages (e.g. catalog search results).

The pagination markup has also been moved to a BLOCK so that it can be
reused instead of duplicated on the page.

To test, apply the patch and go to Cataloging -> New record (using the
basic MARC editor).

- Switch to tab 1 and click the tag editor link next to tag 100 subfield
  a.
- Perform a search in the popup window which will return multiple pages
  of results (an empty search will work with default testing data).
- Confirm that the pagination links are styled like catalog search
  results.
- Confirm that the search links work correctly and that the correct
  number is highlighted as you page through results.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a762f61faa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:48 +01:00
Owen Leonard df9f5d17ab
Bug 37826: Remove the use of the script_name variable where it is unnecessary
Most of the places where a "script_name" variable used it is not
strictly necessary. Because it is also used inconsistently, I think it's
better to simply remove the use of the variable where it isn't strictly
necessary.

This patch removes creation of the template variable from several
scripts and updates the corresponding template with the URL itself.

To test, apply the patch and restart services. Test the following pages,
including the various permutations where they are present, e.g. New,
Edit, Delete.

- Administration -> Cities and towns -> Search via the header search
  form
- Administratoin -> Currencies and exchange rates -> Search via the
  header search form
- Administration -> Desks
- Administration -> Budgets
- Administration -> Authority types
- Administration -> Authority types -> MARC structure -> Subfields
- Administration -> Classification configuration
- Administration -> MARC bibliographic framework
- Administration -> MARC bibliographic framework -> MARC structure ->
  Subfields
- Administration -> Record matching rules
- Administration -> OAI repositories
- Administration -> Patron attribute types
- Administration -> System preferences -> Local use
- Administration -> Z39.50/SRU servers
- Acquisitions -> Vendor -> Contracts
- Acquisitions -> Vendor -> Basket -> Export as CSV
- Acquisitions -> Vendor -> Basket -> Edit basket
- Acquisitions -> Vendor -> Basket groups
- Tools -> Import patrons
- Tools -> Notices and slips

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a433d4f20)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:47 +01:00
Tomas Cohen Arazi 87e8effead
Bug 38684: Improve translatability in cat-toolbar.inc
This patch converts strings using

* *subscription(s)*
* *item(s)*

into different strings for the singular and plural forms. This helps
translating and is also more accurate for the end user.

To test:
1. Have a record with 2 items and 2 subscriptions
2. hover on the _Edit > Delete record_  dropdown item
   => FAIL: Mixed form string about items
3. Delete one item at a time, repeating 2
   => FAIL: Mixed form string at each step
4. Once items are deleted, repeat 2
   => FAIL: Mixed form string about subscriptions
5. Delete one subscription at a time, repeating 2
   => FAIL: Mixed form string at each step
6. Apply this patch
7. Repeat 1-5
   => SUCCESS: Different message in singular and plural forms
   => SUCCESS: The message is correct
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 03392b660e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:47 +01:00
Emily Lamancusa 3d9aa17407
Bug 38735: Add preferred_name to default search fields for new installations
To test:
1. Attach patch first, and then start up KTD or sandbox to see the
   behavior for a new installation
2. Go to Administration > System Preferences and search for
    DefaultPatronSearchFields
3. Click to edit
--> Confirm preferred_name is checked in the modal that displays
4. Edit a patron to give them a preferred name that is different from
   their first name
5. Search for the patron by the newly set preferred_name
--> Confirm the patron correctly autocompletes and appears in the search
    results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit deccd6eb7e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:46 +01:00
Lari Taskula 0c965868d9
Bug 35975: Show biblionumber when download cart as BibTeX
To test:
1. In OPAC, add a record to your cart
2. Go to your cart
3. Click Download -> BibTeX
4. Observe downloaded file in your favorite text editor
5. Observe Koha::Hash(xxx) within file contents
6. Apply patch
7. Repeat steps 3 and 4
8. Observe Koha::Hash has been replaced with biblionumber

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f66379c075)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:46 +01:00
Owen Leonard 74f85e12a9
Bug 38753: Missing table cells breaks OPAC charges table
This patch adds a couple of instances of the empty cell required by
DataTables to enable responsive behavior. The mismatch between table
headers and table cells causes DataTables to fail.

To test you must log in to the OPAC as a user with charges and credit.

- Apply the patch and go to Patrons in the staff interface.
- Find and view a patron record. Click "Accounting" in the sidebar menu.
- Use the "Create manual invoice" and "Create manual credit" tabs to
  create at least one charge and a credit which is greater than the
  charges.
- Log in to the OPAC as that user and go to their Charges tab.
- The charges table shoud look correct, with DataTables sorting
  indicators on the table headers to indicate that DataTables is
  working.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b49cac544f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:45 +01:00
Magnus Enger 2b5fe6fc76
Bug 38617: Fix warning about auto increment and biblioitems
To reproduce:
- Delete a bibliographic, noting the biblionumber (let's call it X)
- Run this in the database:
    UPDATE deletedbiblioitems SET biblionumber = X;
- Go to About Koha > System information
- Notice the warning compares two tables that are not equivalent:
  "The following IDs exist in both tables biblio and deletedbiblioitems"

To test:
- Apply the patch
- Reload the System information
- The warning should now read:
  "The following IDs exist in both tables biblioitems and deletedbiblioitems"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 44e15f5b99)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:45 +01:00
Owen Leonard 8571b91840
Bug 38349: Fix style of sidebar form submit button on tags review page
This patch fixes the markup of the sidebar form on the tags
review page and removes an incorrect "btn-sm" class from the
submit button.

To test, apply the patch and go to Tools -> Tags.

In the sidebar form, confirm that the submit button has the same yellow
"primary" style as other submit buttons, and that it fills the width of
the sidebar.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f6c4663d85)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:44 +01:00
Owen Leonard e9a32d369c
Bug 38285: Replace instances of obsolete Bootstrap class "pull-right"
This patch fixes instances where the pre-Bootstrap-5 class "pull-right"
was missed during the upgrade. Most cases were on dropdown menus, and
in all of these cases the class can be removed because Bootstrap 5 menus
have better responsive behavior.

Other changes: Added "dropdown-item" classes to some menu items which
lacked it; Added some custom style for the "Filter" form in the patron
permissions toolbar.

To test, apply the patch and rebuild the staff interface CSS. Test that
the following menus look correct and work correctly:

- Catalog -> Bibliographic details page -> Holdings table: The "Edit"
  secondary menu shown for each item (requires that the LocalCoverImages
  system preference be enabled.
- Administration -> Z39.50 servers: The "Actions" menu for each server
  in the list of servers.
- Circulation -> Article requests: The "Actions" menu for each title and
  under each tab (New, Pending, and Processing).
- Tools -> Patron lists: "Actions" menu.
- Administration -> Plugins: "Actions" menu (requires that you have at
  least one plugin installed).
- Reports -> Saved SQL reports: The secondary menu on each saved
  report's "Run" button .
- Cataloging -> Rotating collections: "Actions" menu.
- Serials -> Subscription search results: In the "Open" tab, the
  secondary menu on the "Serial receive" button on each subscription. In
  the "Closed" tab, the "Actions" menu.
- Acquistions -> Suggestions: The secondary menu on each title's
  "Edit" button.
- Tools -> HTML customizations: The secondary menu on the "New
  entry" button; The secondary menu on each entry's
  "Edit" button; Edit entry -> The secondary menu on the "Save" button.
- Cataloging -> Stock rotation: The "Manage" menu on each rota.

A non-menu change:
- Patrons -> Patron details -> More -> Set permissions: CSS has been
  added to correctly align the "Filter" menu.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b6c04435c5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:44 +01:00
Jonathan Druart 6081e6972b
Bug 37761: Add focus on patron search when on the tab
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4fb4b7527e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:43 +01:00
Sukhmandeep Benipal 7973987d35
Bug 37761: Fix redirection on the tabs and buttons
To test:
- Apply the patch and enable the CurbsidePickup system preference if
  necessary.
- Properly testing requires testing data. You can run this command to
  REPLACE your curbside pickup data with sample data:

  bash <(curl -s https://gitlab.com/-/snippets/2572579/raw/main/test_curbside_pickups.sh)

- Go to Circulation -> Curbside pickups.
- Confirm that the tabs look correct. The first tab should be active
  by default.
- Confirm that the right content is displayed when you click each tab.
- Under the "Schedule pickup" tab, search for a patron.
- After you submit the search the page should reload and the "Schedule
  pickup" tab should be open.
- Go on each tab and try each button to verify you're staying on the
  same tab.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ffb344c580)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:42 +01:00
Owen Leonard 2bd04b1899
Bug 37761: Use tab WRAPPER for circulation curbside pickups tabs
The tabs on Circulation -> Curbside pickups look broken because they
were not updated to use the tab WRAPPER markup. This patch revises the
template so that the tabs look correct and makes additional changes to
ensure that the correct tab is preselected.

To test:
- Apply the patch and enable the CurbsidePickup system preference if
  necessary.
- Properly testing requires testing data. You can run this command to
  REPLACE your curbside pickup data with sample data:

  bash <(curl -s https://gitlab.com/-/snippets/2572579/raw/main/test_curbside_pickups.sh)

- Go to Circulation -> Curbside pickups.
- Confirm that the tabs look correct. The first tab should be active
  by default.
- Confirm that the right content is displayed when you click each tab.
- Under the "Schedule pickup" tab, search for a patron.
- After you submit the search the page should reload and the "Schedule
  pickup" tab should be open.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1311b8c01c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:42 +01:00
Alexander Wagner e33343ccd6
Bug 38711: Wrong font-weight in tables during printing from staff interface
Fix last columns of tables to be printed in `bold`. This affects
various functions of Koha e.g. Notices and Slips, Pages etc.

1. Go to `Home / Tools / Additional content / Pages`
2. Select `Add new entry using text editor`
3. Add the following html

```html
<table>
   <tbody>
      <tr>
         <td>col 11</td>
         <td>col 12</td>
      </tr>
      <tr>
         <td>col 21</td>
         <td>col 22</td>
      </tr>
</tbody>
</table>
```

4. Save
5. Use the `Staff`-URL from `Additional content: Pages`
   to open the page in a new tab
6. Select `File / Print`
   (or fire up the dev console via F12 and apply the Print-css)
7. The entries `col 12` and `col 22` appear in bold face.
8. Apply the patch
9. Reload the page
10. The entries `col 12` and `col 22` appear in normal font.

Sponsored-by: Deutsches Elektronen-Synchrotron DESY, Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ec0ced1652)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:41 +01:00
Emily Lamancusa 823faed9a5
Bug 38748: Pass the correct branchcode value to transfer slip
To test:
1. Find or create an item belonging to a library other than the
   logged-in library
2. Check the item in and print slip
--> The transfer slip says "Transfer to" but the library name is blank
3. Apply patch and restart_all
4. Cancel the transfer or find a different item
5. Check the item in and print slip
--> The library name now appears on the slip

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4ee3accfb3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:41 +01:00
Owen Leonard 8463b1097f
Bug 38667: Point of sale transaction history should not appear to be sortable
This patch adds configuration options to the Point of sale "Transactions
to date" and "Older transactions" tables so that they don't appear to be
sortable. Both have an option that makes their sorting fixed.

To test, apply the patch and go to Point of Sale.

- Enable 'EnablePointOfSale' and 'UseCashRegisters' system preferences.
- Add a least one cash register (Administration -> Cash registers).
- Add a least one debit type (Administration -> Debit types). Check "Can
  be sold."
- Go to the Point of Sale page.
  - Under "Items for purchase" click "Add" next to an item.
  - Under "Collect payment," fill out the form, including the cash
    register selection, and submit.
- Click "Transaction history for..." in the sidebar menu. (You may have
  to click "Cash summary for..." and then the name of the register you
  used in your transaction.
  - Check that the "Transactions to date" and "Older transactions"
    tables do not have sorting indicators in the table headers.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eaeb05b5e1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:40 +01:00
David Nind 1c69ac42c1
Bug 36609: Update index type labels for search engine configuration
This fixes the labels used for the type options when configuring
Elasticsearch search fields so that they use:
- sentence case
- the full name, instead of abbreviations (to make it clearer
  for translators)

Test plan:
1. Go to Administration > Catalog > Search engine
   configuration (Elasticsearch).
2. In the search fields tab, select the type column dropdown list
   for any field. Note the labels used for these options:
   - <empty entry> (the default option)
   - Std. Number
   - Call Number
3. Apply the patch.
4. Refresh the page.
5. Repeat step 2 and note that the option labels are now:
   - Default (instead of being blank)
   - Identfier (instead of Std. Number)
   - Call number (instead of Call Number)
6. Sign off D:

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f549427e3d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:39 +01:00
Owen Leonard 9723475364
Bug 38665: Fix markup error in Additional fields template title
The logic of the title tag construction should not result in a caret
preceding the first element on the Additional fields main page.

To test, apply the patch and go to Administration -> Additional fields.
There should be no caret appearing at the start of the page title
information:

Additional fields > Administration > Koha

Other pages (listing additional fields, adding additional fields, etc)
should have the correct title, e.g.

New field > Table 'aqbasket' > Additional fields > Administration > Koha

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ca170081b8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:39 +01:00
Owen Leonard d69a007eb7
Bug 38077: Fix minor spacing issue in self checkout login page
This patch adjusts the markup and CSS of the self checkout login screen
so that form layout is consistent and readable. I have adjusted the
template conditional so that it re-uses more form elements like
<legend>.

To test, apply the patch and enable WebBasedSelfCheck if necessary.

- Set the SelfCheckoutByLogin system preference to 'cardnumber'
- Go to the self-checkout page (/cgi-bin/koha/sco/sco-main.pl)
  - The login form should be labeled "Log in to your account" followed
    by the label, form field, and submit button arranged vertically.
- Set the SelfCheckoutByLogin preference to "username and password"
- Reload the self-checkout page. The form should look the same with the
  addition of the password field.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4d67788ad1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:38 +01:00
Phil Ringnalda c01e819a61
Bug 38462: Remove unused code for pagination in OPAC authority search
The remote branch for bug 13618 started out when OPAC authority search did its
own pagination in a template block, then bug 2735 replaced that with
pagination_bar, the template var passed from the script, then at some point
before bug 13618 landed the second time, a rebase error put the template block
back in. And since it's not at all obvious it is dead code unless you look for
where "pagination" rather than "pagination_bar" is used, we've kept updating
it, and bug 36032 thought the way it used >> instead of > for next ought to be
fixed while one that was actually used was fixed.

Time to get rid of it, before we 'fix' it again.

Test plan:
 1. Without the patch, in the OPAC go to Authority Search and do a search that
    will return pages of results, like the letter a
 2. Note that the button for the next page uses ">" rather than the "Next >>"
    in the block this patch removes
 3. Apply patch, click the browser Back button, refresh page
 4. Verify that when you search for something that returns more than one
    page of results, the page navigation hasn't changed from what it was
    before the patch, telling you that what the patch removes was unused

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8c9fd0f5d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:37 +01:00
David Nind e59e6e6c44
Bug 38771: (follow-up) Fix the authentication log not enabled message
This corrects the display of the "Log not enabled" message for the
authentication module in the log viewer.

If either AuthFailureLog or AuthSuccessLog system preferences are
set to "Don't log":
- the "Log not enabled" warning icon is now shown
- clicking the triangle icon now links to the two system
  preferences

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 86e8835da0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:37 +01:00
Roman Dolny 3f45fc8402
Bug 38771: Typo 'AuthScuccessLog' system preference
Typo in system preference 'AuthScuccessLog' -> 'AuthSuccessLog'.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2f5c51383a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:36 +01:00
Roman Dolny 656baf068f
Bug 38772: Typo 'minPasswordPreference' system preference
Typo in system preference 'minPasswordPreference' -> 'minPasswordLength'
in opac/opac-password-recovery.pl

There is no 'minPasswordPreference' system preference in database.
Bug 23816 added the capability to override minPasswordLength.

Test plan:
==========
1. Check 'minPasswordPreference' appearances:
   git grep -i 'minPasswordPreference' **/*
--> Note: only one in opac-password-recovery.pl; no one in sysprefs.sql
2. Apply the patch.
3. Repeat p. 1. Note there is not 'minPasswordPreference' at all.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b8db36d2a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:35 +01:00
Yanjun Li c10aba6a2d
Bug 38302: Add delete confirmation dialog
To test:

1. Create a list in the staff interface
2. Go to lists
3. See "Your lists" tab and find "Delete" button in "Actions" col, click "delete", no confirmation dialog pop up
4. Create another list
5. Go to lists and view the list detail
6. See "Edit" dropdown and click "Delete Lists" button, see confirmation dialog pop up
7. Apply patch
8. Try step 1 through 3 again
9. "Delete" button in "actions" column has the same confirmation dialog, and delete function works

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0a5591bdaa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:34 +01:00
Pedro Amorim d84b3f4b23
Bug 38782: mock_userenv in API tests
Reorder logic slightly for each to only create the counter_file after the mock_userenv has taken place

prove t/db_dependent/api/v1/erm_custom_reports.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1e7c49ab98)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:34 +01:00
Pedro Amorim 35b520f4b0
Bug 38782: Apply same fix for CounterFile.t
prove t/db_dependent/Koha/ERM/EUsage/CounterFile.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidy (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a297c42394)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:33 +01:00
Pedro Amorim 597a95d18b
Bug 38782: Remove concat in background process
The ud_provider->{report_type} is only defined on ->harvest_sushi, meaning it'll never be defined here.
We don't need this anyway. The filename should be the filename of the file being manually uploaded. We only need this concat logic for COUNTER files being generated by Koha following a SUSHI harvest, and that works.
This also gets rid of a warning when running the tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0231911c98)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:32 +01:00
Pedro Amorim 74189746c7
Bug 38782: Mock userenv->{number}
prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidy (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3e8b9b851)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:31 +01:00
Pedro Amorim b08bc8fc60
Bug 36039: (QA follow-up): Improve audit messages
Improve messages clarity.
Show success message if no schema diff was found from audit.
Code refactor to ensure the title+message shown in UI is the same as the one shown in CLI and are all translatable.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7834d25fb4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:31 +01:00
Pedro Amorim 1d6fb756f9
Bug 36039: (QA follow-up): Address i18n for print messages
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 42c1e109af)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:30 +01:00
Martin Renvoize dff1628187
Bug 36039: (follow-up) Move view logic to script/template
This patch updates the module as suggested by David to handle just the
diff code and leaves the display logic up to the templates and script.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: JesseM <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 534fba2691)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:29 +01:00
Pedro Amorim 501b1860ca
Bug 36039: New 'datatabase audit' tab in about page
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: JesseM <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6940167048)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:28 +01:00
Pedro Amorim b7c7075dd4
Bug 36039: Move audit_database script logic to a dedicated module
Test plan #1 ensure same script functionality (same as bug 34064):
0. Apply patch
1. vi ./installer/data/mysql/kohastructure.sql
2. Comment out some columns, change NULL status, or whatever you like
3. perl misc/maintenance/audit_database.pl \
    --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql
4. Note that the output includes SQL commands to change the database
to match the new kohastructure.sql

5a. Try using koha-foreach and note that the database name appears above
the database comparison
5b. koha-foreach "perl misc/maintenance/audit_database.pl \
    --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql"

Test plan #2:
1. After doing test plan #1, access the new 'database audit' tab, visit:
<staff_url>/cgi-bin/koha/about.pl?tab=database
2. Ensure the output is the same as test plan #1

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: JesseM <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 09bb85409d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:28 +01:00
Lucas Gass 36bf9321ff
Bug 37398: Fix test in basic_workflow.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2350a2ada8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:27 +01:00
Lucas Gass a4552b54a7
Bug 37398: Add CSS for the important class
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9b7dcb46ea)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:26 +01:00
Jonathan Druart fa84dfb770
Bug 37398: Adjust tests
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3fe252f6a8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:26 +01:00
Jonathan Druart 7eb1ed012c
Bug 37398: Do not rely on the columns names but data type instead
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d2a6915010)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:25 +01:00
Lucas Gass ee18a0549d
Bug 37398: Adjust CSS for flatpickr
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 125d8ec1cf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:24 +01:00
Lucas Gass 9521ce51bf
Bug 37398: Add set to today function to calendar.inc
To test:
1. Try editing some items with a empty value in the flatpickr.
2. Make sure the empty date fields get a date set to today when you click on the empty field.
3. Try a datetime field, making sure the datetime is correctly set.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d5bd311d4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:24 +01:00
Lucas Gass 7e6d3f4c3f
Bug 37398: Add a unit test
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2f317a767)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:23 +01:00
Lucas Gass 2d4b406742
Bug 37398: Make sure subfield and subfield_date are defined
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d32218fb68)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:22 +01:00
Lucas Gass b5e8bcbd81
Bug 37398: Adjust CSS for wrapped flatpickr
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f049a13ef8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:21 +01:00
Lucas Gass d2bfa731c8
Bug 37398: Make date and date time fields have date picker by default
To test:
1. APPLY PATCH, restart_all
2. Pick a framework, I choose BKS in k-t-d
3. Make sure that a few date and datetime fields are exposed in the editor.
4. On additem.tt a date picker should be instantiated on the date or datetime fields.
5. Make sure the date pickers work on each field.
6. If it is a datetime field you should have the option to add hours and minutes. ( datelastseen )
7. Edit the framework and remove the dateaccessioned.pl plugin from any of these date fields.
8. Even without the dateaccessioned.pl plugin a date picker should be present on the field.
9. Add the dateaccessioned.pl plugin to a non date/datetime field.
10. Make sure the dateaccessioned.pl plugin works properly on the non date/datetime field.
11. Mark one of the date/datetime fields as mandatory, make sure it still acts as mandatory.
12. Hide date/datetime from the editor, make sure it hides properly.

+----------------------+-------------+
| COLUMN_NAME          | COLUMN_TYPE |
+----------------------+-------------+
| dateaccessioned      | date        |
| replacementpricedate | date        |
| datelastborrowed     | date        |
| datelastseen         | datetime    |
| onloan               | date        |
+----------------------+-------------+

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit aa4ee79f6e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:21 +01:00
Pedro Amorim 868cfccf44
Bug 36627: (QA follow-up): Rename borrowernumber -> patron_id
To test:
$ prove t/db_dependent/api/v1/erm_counter_logs.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 15803e4f29)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:20 +01:00
Katrin Fischer b2a45e2e5f
Bug 36627: Fix typo "embeded"
A search turned up more of these in other files. Fixed as well.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3b86455e02)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:19 +01:00
Jonathan Druart 3ce6813527
Bug 36627: (follow-up) Use patron_to_html in 'Imported by' column
We don't need those 2 lines

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5d6af90d76)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:19 +01:00
Pedro Amorim 891e4ef163
Bug 36627: (QA follow-up): Add missing tests
1) Apply patch
2) $ yarn api:bundle
3) $ prove t/db_dependent/Koha/ERM/EUsage/CounterLog.t
4) $ prove t/db_dependent/api/v1/erm_counter_logs.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a314ea750)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:18 +01:00
Pedro Amorim 685c34be80
Bug 36627: Add tests
k-t-d, from /kohadevbox/koha, run:
yarn run cypress run --spec "./t/cypress/integration/ERM/DataProviders_spec.ts"

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7faa42505f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:17 +01:00
Pedro Amorim d9235cee09
Bug 36627: Use patron_to_html in 'Imported by' column
For consistency, and to avoid 'null koha' for a file imported by
the koha user (no first name).

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f70a5ffc67)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:17 +01:00
Matt Blenkinsop 7265603c66
Bug 36627: Rename embed method to patron
This patch renames the embed method from borrowernumber to patron to fit with the use of 'patron' in the API

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7b75586ead)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:16 +01:00
Matt Blenkinsop bd9b473567
Bug 36627: Embed patron record for display
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit da475321a5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:15 +01:00
Matt Blenkinsop aa08e30cce
Bug 36627: Record who is importing sushi data
This patch adds functionality for storing the patron (or cronjob) that triggers a harvest. Currently every counter log is stored as being imported by the cronjob

Test plan:
1) In the usage statistics module in ERM, create a data provider (the details in the provider are not important)
2) Click into the provider and click into manual upload
3) Upload the file attached to this bug
4) Once the background job is completed click into the counter logs tab in the provider. The imported by columns should show a user with a clickable link

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 062e04c9c3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:15 +01:00
Janusz Kaczmarek 7c37b128ac
Bug 38483: C4::Heading::preferred_authorities is not used
C4::Heading::preferred_authorities seems to be not used for ages (maybe
never used?)

Test plan:
$ git grep preferred_authorities
-->   should return nothing

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c70b09dfc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:14 +01:00
Katrin Fischer f3252871ee
Bug 38662: Fix terminology "Members" and remove unneeded sub-heading
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f42df40680)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:13 +01:00
Pedro Amorim 5a9c5b4d27
Bug 38662: Remove redundant 'ERM' labels
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2b0286889d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:13 +01:00
Pedro Amorim 642021cf03
Bug 38662: Sort tables alphabetically
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4012f805b6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:12 +01:00
Pedro Amorim 9140c3e5b1
Bug 38662: Group tables by module name
Test plan:
1) Before applying patches, visit the additional fields admin page:
   <staff_url>/cgi-bin/koha/admin/additional-fields.pl
2) Notice the tables are not grouped by module, and not alphabetically sorted
3) Apply patches. Refresh

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a0c475bc5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:12:11 +01:00
Pedro Amorim a14af8ed5e
Bug 36662: Move test files to the correct folder structure
Trivial leftover house-keeping from bug 35581.

Test plan:
$ prove t/db_dependent/Koha/ILL/*

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b26b7d740f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 18:11:51 +01:00
Marcel de Rooy c374c92007
Bug 37784: (QA follow-up) Add few tables to Koha::Database::Columns
This resolves exceptions like:
Invalid table name accountlines at /usr/share/koha/C4/Reports/Guided.pm line 216.

Test plan:
Go to reports/dictionary.pl
Try to add a new definition for Serials.
Without this patch, you would crash (status 500).
Run t/Koha/Database/Columns.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 17:59:11 +01:00
Marcel de Rooy 9dc5842b8c
Bug 37784: (QA follow-up) Bail out to new definition
The code went back to step 3 but the error message is not there.
It is easier to go back to the start: no need to fetch columns.
And this is now an exception; it will only come up when trying
malicious things.

Also turned foreach and unless forbidden around. No need to go
into the loop when we found a forbidden field.

Test plan:
See first patch. You should see the message now.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 17:59:10 +01:00
Aleisha Amohia bff29bbd45
Bug 37784: Do not show forbidden columns in reports dictionary
This patch prevents forbidden columns from being selected using the reports dictionary.

To test:

1. Go to Reports -> View dictionary
2. Choose 'new dictionary'
3. After providing a name and description, select the 'patrons' table
4. Select the 'password' column and go Next
5. Notice it is possible to see a list of all the password hashes in the 'choose' selection box when asked to specify a value

6. Apply patch and restart services

7. Repeat steps 1-3
8. Notice the 'password' column and other forbidden columns are not available to be selected

9. Open the Inspector / developer tools in your browser and find the code for the columns selection
10. Change the value of one of the options in the code to "borrowers.password". So it may end up looking like this:

<option value="borrowers.password">Card number</option>

11. Choose that option from the dropdown and click Next.
12. Confirm you are redirected back to this page and warned about the column being used.

13. Ensure tests pass t/db_dependent/Reports/Guided.t

Sponsored-by: Reserve Bank of New Zealand
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 17:59:09 +01:00
Jonathan Druart 608331612d
Bug 38838: Clean C4::Reports::Guided->get_columns
reports/dictionary.tt and reports/guided_reports_start.tt display a list
of the columns available using optgroup to group the columns per table.

The template code is quite ugly because of the perl structure choose in
C4::Reports::Guided->get_columns

This patch removes $cgi and the 'first' variable that were not used.
Now we have an usual structure with the table names as keys and column
info in an arrayref.

Test plan:
Create a report and a new dictionary definition.
At step 3 you should see the list of the columns.
Note that they are now identical. The list when you create a dictionary
now show the description of the columns.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 10a41979e6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 17:59:09 +01:00
David Cook a06b676a5c
Bug 31165: Scrub "Public note" field for Course Reserves
When displaying the "Public note" for Course Reserves, we scrub the HTML
using the "note" scrubber type.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/course_reserves/course-reserves.pl
2. Click "New course"
3. Fill in required fields
4. In staff note and public note add the following:
<script>alert('boo!')</script><p>Hello!</p>
5. Click Save

6. Click "Add reserves"
7. Add "39999000001310" to Item barcode
8. Click "Submit"
9. Fill in all required fields
10. Add the following for Staff note and Public note:
<script>alert('boo2!')</script><p>Item!</p>
11. Click "Save"

12. Go back to your course reserve
13. Note the HTML is scrubbed on "Public note"
14. Go to http://localhost:8081/cgi-bin/koha/course_reserves/course-reserves.pl
15. Note the HTML is scrubbed on "Public note"

16. Go to http://localhost:8080/cgi-bin/koha/opac-course-reserves.pl
17. Note the HTML is scrubbed on "Notes"
18. Click on your course reserves
19. Note the HTML is scrubbed on "Notes"

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-24 17:59:03 +01:00
Paul Derscheid 223345f032 24.11.03: Update contributors.yaml 2025-03-23 15:12:06 +01:00
Paul Derscheid abd6464e4b
Bug 38108: DBRev 24.11.02.001
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:16 +01:00
Katrin Fischer 905aca5b33
Bug 38108: (follow-up) Amend system preference description with "staff interface"
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 707d3b3563)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:15 +01:00
Emily Lamancusa 5c5302b295
Bug 38108: (QA follow-up) Use say_success in dbrev
Use say_success instead of say when outputting a line that the
system preference was added successfully

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 606cd8d63e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:15 +01:00
Lucas Gass fe2892a9bd
Bug 38108: Add ability to show/hide table filters via system preference
To test:
1. APPLY PATCH, updatedatabase, restart_all
2. Search for the 'AlwaysShowHoldingsTableFilters' system preference. It should be set to 'Don't'.
3. Without changing the system preference, go to a record detail page.
4. The filters should not show by default.
5. Make sure that toggling the Hide filters/Show filters button still work as expected.
6. Set 'AlwaysShowHoldingsTableFilters' to 'Do'.
7. Now the filters should show by default when you load the table.
8. Make sure that toggling the Hide filters/Show filters button still work as expected.

Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 04f398890e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:14 +01:00
Lucas Gass 31a3848010
Bug 38108: Add system preference AlwaysShowHoldingsTableFilters
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9a55785c8b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:14 +01:00
Jonathan Druart af32ad1488
Bug 38632: Do not show all columns when displaying the filters
Yet another visibility bug fix for this specific table.
When the filters are displayed the table is destroyed and recreated.
We should not save the visibility changes made by DT and consider them
changes made by the user.
A temporary variable is used to store the user settings duringt this
action, then we restore them once it's done.

Test plan:
Go to the detail page of bibliographic record with items
Click on "show filters"
=> Only columns displayed should still be displayed
Retry but show/hide some columns before you display the filters
=> Only columns displayed should still be displayed

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0fefe2bed5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:13 +01:00
Lisette Scheer 81587b3abb
Bug 39172: Merging records no longer compares side by side
This patch updates the cataloging merge screen to restore side-by-side
comparison.

Both columns had ids added by the patch for formatting purposes.

To test:
1. Go to cataloging module
2. Do a search (in sandboxes/ktd 1 works)
3. Select 2 or more records to merge
4. Click the "merge selected" button
5. Observe there are 2 columns on top of each other instead of side by
   side
6. Apply the patch
7. Restart all & rebuild css
8. Repeat steps 1-4
9. Observe the columns are side by side again.
10. Sign-off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jason Vasche <jvasche@roundrocktexas.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4156022d8a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:12 +01:00
Andrew Fuerste Henry 4d0ae3adb4
Bug 39025: Use old_issue_id for issue details on patron account screens
To test:
1: Have an item that is checked out, overdue, and showing an accruing fine
2: On the patron account, check both Make A Payment and Transactions tabs, confirm that the fine shows Due Date, Checkout Date, and Checked Out From values
3: Check your item in
4: Reload the patron account, confirm that the fine no longer shows checkout data on either Make A Payment or Transactions
5: Apply patch
6: Reload pages, confirm Make A Payment and Transactions tabs now show values in Due Date, Checkin Date, Checkout Date, and Checked Out From

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 41a368f35e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:12 +01:00
Nick Clemens fdd1a7e89a
Bug 39108: Prevent 'Ignore' on found hold from triggering a new modal
When ignoring a waiting hold, we don't need to take any further action, we
shoudlsimply close the modal

This patch adds JS to prevent form submission

To test:
1 - place a hold
2 - check in an item that can fill the hold
3 - in the hold found modal, click Ignore
4 - the modal dismisses and nothing changes on the hold (this is the desired behavior)
5 - check in the item again, click Confirm Hold, confirm your hold is now Waiting
6 - check in the item again, confirm the modal says "Item is already waiting"
7 - click Ignore, confirm modal reloads
8 - click Ignore, confirm modal reloads
9 - click Ignore, confirm modal reloads
10 - Apply patch
11 - check in the item again, click Confirm Hold, confirm your hold is now Waiting
12 - check in the item again, confirm the modal says "Item is already waiting"
13 - click Ignore, nothign happens! Orange you glad I didn't say banana?

Signed-off-by: Amanda Campbell <acampbell@hmcpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 177d648ded)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:11 +01:00
Lucas Gass a2f062e159
Bug 39270: Check to make sure checkouts are not already booked
To test:

1. Find an item that is bookable, I turned on Bookable at the item type level for BK. I am using biblionumber=28 in k-t-d with 3 items
2. Book item with barcode ( 39999000001297 ). I did March 7 - April 1
3. Book item with barcode ( 39999000001259 ). I did March 7 - April 1
4. Now checkout 39999000001297 to the patron is was booked to. When asked about early collection say yes.
5. Now item with barcode ( 39999000001273 ) is not checked out or booked. It should be bookable
6. Try to book it, it is not available till April 2, though it should be available right now.
7. APPLY PATCH
8. Try the bookings again.
9. You should correctly not be able to book 39999000001297 or 39999000001259.
10. You should be able to book 39999000001273.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37c8c6606a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:11 +01:00
Nick Clemens 45433a1873
Bug 37920: Add cronjob loggging to writeoff_debts.pl
This patch adds the same logging as other cronjobs have

To test:
1 - Enable system preference CronjobLog
2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01
3 - Check the logs - no entries
4 - Apply patch
5 - Repeat 2
6 - Check the logs, two entries - one for the start and one for the end

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested on top of bug 39236. Works as advertised.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit de9c1a8ff2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:10 +01:00
Nick Clemens a2ab689aed
Bug 39236: writeoff_debts.pl needs adjustments
From bug 22435 - we need to use 'CREATE' as the account_offset type
From bug 31095 - we need to 'use Koha::Patrons;'

To test:
1 - Add a fine to a patron account
2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01
3 - Cronjob dies
4 - Apply patch
5 - Rerun
6 - Job succeeds!
7 - Confirm patron's fine is written off
8 - Sign off

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 93e2a0953d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:09 +01:00
Paul Derscheid 6de441e3f5
24.11.03: Update contributors.yaml
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-23 15:04:03 +01:00
Phil Ringnalda 5f0b655b97
Bug 38853: Make 'Cancel selected' on holds table work
Because 'Cancel selected' on the table of existing holds uses
$("#cancel_modal_form #inputs").empty; rather than empty();, it fails to
clear out whatever things are in there before it puts in the things it wants.
That leaves things in a confused state, and makes it fail to actually cancel
holds.

Test plan:
1. Without the patch, add a hold to any bib record
2. Select the checkbox for the hold you placed, then click 'Cancel selected'
   and confirm that you want to cancel
3. Note that there's no message box about a background job having been
   enqueued, and no matter how long you wait, the hold doesn't go away
4. Apply patch, repeat step 2, note that there's now a message box, and
   when the background job finishes, that the hold has been deleted.

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3bd4a9fad6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:12 +01:00
Pedro Amorim 9ed711178c
Bug 39175: Fix Attributes->Attribute
Bug introduced in FreeForm prior to adding it to core in this commit:
369dffb159 (diff-662970ddc6f6828afd23e6823399a4a32807c4a6c487a0aff86c9d116f60797dR806)

It should've been Koha::Illrequestattribute into Koha::ILL::Request::Attribute not Koha::ILL::Request::Attributes

To test, k-t-d:
1) Enable ILLModule syspref
2) Edit the only patron in k-t-d with the 'Interlibrary loan' category:
<staff_url>/cgi-bin/koha/members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=16
3) Add a valid e-mail address to 'Primary email:'
4) Create a new ILL request:
/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
5) Add any type, any valid patron cardnumber, any library. Click 'Create'.
6) Click 'Place request with partners'
7) Pick the only available partner library 'FRL-Walker'
8) Click 'Send email'.
9) Notice you get an error. Apply patch & restart plack. Repeat.
10) Confirm the there's no error and message was queue as expected:
$ select * from message_queue;

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d59a3db8d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:10 +01:00
Owen Leonard 8032575d45
Bug 39268: Fix tab switching on lists page
This patch fixes broken tab switching on the staff interface lists page.
It was broken by the upgrade to Bootstrap 5.

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

- If necessary, create multiple public and private lists.
- Confirm that switching between the "Your lists" tab and the "Public
  lists" tab works correctly.
- Try using URL parameters to load each tab:
  http://127.0.0.1:8081/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0
  http://127.0.0.1:8081/cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3054868fc4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:10 +01:00
Nick Clemens d5ba984909
Bug 39044: Pass budgets to template
This simply copies the fetch of budgets from the acqui/histsearch.pl script.

We should in the future make this a template or other method to avoid code duplication,
but we should fix the functionality first.

To test:
1 - Go to Acqusitions
2 - See the dropdown "Fund: All funds" in the order search section
3 - Click it
4 - Feel disappointed
5 - Apply patch and restart all
6 - Reload and click the dropdown
7 - Options! Feel warm and fuzzy

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c5f598d874)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:09 +01:00
Lucas Gass 47f24fa344
Bug 39244: Fix display of change password/duplicate buttons
To test:
1. Make or find some patron categoies that are not adult category type.
2. On patron pages notice that the Change password and duplicate
   buttons are missing from the toolbar.
3. APPLY PATCH
4. Try again, this time the pChange password and duplicate buttons
   should appear.
5. Make sure the 'Add guarantee' buttons still work.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9580e06e67)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:08 +01:00
Martin Renvoize 270c20b917
Bug 38375: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9bed52a868)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:08 +01:00
Martin Renvoize 7662a6f4a9
Bug 38375: Use perl 5.10+ \R
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 006485a036)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:07 +01:00
Lari Strand 3feb31a50c
Bug 38375: Splitting SIP2SortBinMapping syspref does not support all operating systems' line endings
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3407dc28a3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:06 +01:00
Jake Deery 39e76c8b72
Bug 38957: edifactmsgs data table sorts on date
This trivial patch addresses a missing order-by on
the edifact messages datatable since moving to API
based fetching

TO TEST:

a)  Read in a load of EDIFact messages in k.t.d
b)  Notice on the EDIFact messages table the order
    is seemingly arbitrary
c)  APPLY PATCH
d)  Notice the sorting is now by transfer date,
    descending

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 09d3fd9b95)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:06 +01:00
Emily Lamancusa 9b27a5476f
Bug 39183: Only check unresolved claims
To test:
1. Set up sysprefs:
   - Set any non-empty value for ClaimReturnedLostValue
   - Set AutoClaimReturnStatusOnCheckout to "found in library"
   - Set AutoClaimReturnStatusOnCheckin to "returned by patron"
2. Check out an item to a patron
3. On the patron's account page, click the "Claim Return" button next to
   that checkout
4. Check the item in. Note the message that the claim was auto-resolved.
5. Return to the patron's account page and open the Claims Returned tab
--> Note that the claim is resolved and hidden
6. Click the "Show all 1 claims" link to view the hidden claim. Make a
   note of the resolution code and timestamp.
7. Check the item out again
--> Note the message saying that the claim was resolved, even though it
    was already resolved previously
8. View the return claim again
--> Note that the timestamp and resolution code have changed
9. Apply patch and restart_all
10. Repeat steps 2-8 with a new item
--> Note you do not get a claim resolved message on checkout this time
--> Note that the timestamp and resolution code remain the same before
    and after the checkout

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b6325dfce)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:05 +01:00
Emily Lamancusa eb9d5882da
Bug 38793: Don't dismiss modal before submitting form
Remove the bs-data-dismiss attribute from the "cancel transfer" button
on the Wrong Transfer modal. The "cancel transfer" button's JS works by
adding a hidden input and then submitting the form - we don't want
Bootstrap to dismiss the modal before the embedded form has been
submitted.

Note: This bug seems to be browser-dependent. So far it has been
reproduced with Firefox, but not Chrome/Chromium or Microsoft Edge

To test:
1. Log into the staff client using Firefox
2. Set up system preferences:
   TransfersBlockCirc - Don't block
   AutomaticConfirmTransfer - Do
3. Find or create an item that belongs to a branch other than the
   logged-in branch
4. Check in the item to trigger a Return to Home transfer
5. Click OK on the modal to confirm the transfer
6. Check in the item again to trigger a Wrong Transfer modal
7. Click the "Cancel transfer" button on the modal
8. Navigate to the bib for that item and check the item status
--> The transfer wasn't cancelled - the item is still in transit
9. Apply patch and refresh the page
10. Repeat steps 6-8
--> Item shows as available - the transfer was cancelled successfully

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cdf12b9bda)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:04 +01:00
Katrin Fischer 3fd5434577
Bug 38766: (follow-up) Make confirmation message translatable
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit be1646fb80)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:04 +01:00
Emily Lamancusa 76a153fa4d
Bug 38766: Use uri filter for all parameters in referer link
Also fixes the confirmation message for deleting.

To test:
1. Go to Acquisitions and create some invoices
    i. Search for a vendor (can submit a blank search box)
    ii. Click on vendor name
    iii. Click "Receive shipments" button
    iv. In the "Receive a new shipment" section, enter any value in the
        "Vendor invoice" field and click "Next"
    v. Click the "My Vendor" breadcrumb and repeat iii-iv a few times
2. Go to Acquisitions > Invoices
3. Specify search filters for shipment to/from dates (that include the
   invoices you entered) and search for invoices
4. Try opening, closing, and deleting individual invoices using the
   Action menu
--> Internal server error! "The given date <date> does not match the
    date format (iso)".
--> Also, note that there is no confirmation dialog when deleting
5. Apply patch
6. Repeat steps 2-4
--> Confirm that invoices can be opened and closed using the drop-down
    menu with no issue
--> Confirm that both open and closed invoices can be deleted with no
    issue, and that a confirmation message displays before deleting

Note for QA: search for $KohaDates within invoices.tt, and confirm that
the $KohaDates filter is now only used for display, never for Internal
data storage/flow

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47f35a4017)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:03 +01:00
David Cook 508f21f18c
Bug 38826: Make check_api_auth $sessionID consistent
This change makes $sessionID consistently return using the session
ID and not sometimes the session object.

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' --cookie-jar /tmp/test.cookies
3. Note the Csrf-Token header value
4. Replace the <CSRF-TOKEN>, <USERID>, and <PASSWORD> tokens in the next step
using the appropriate values (eg the CSRF-TOKEN is from the previous step)
5. curl -v -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Csrf-Token: <CSRF-TOKEN>" -XPOST \
    'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    -d "login_userid=<USERID>&login_password=<PASSWORD>" \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
6. curl -XGET -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies > rec.marcxml
7. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
8. Note the Csrf-Token header value
9. curl -H "Content-Type: text/xml" -H "Csrf-Token: <CSRF-TOKEN>" \
    -XPOST -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies --data @rec.marcxml

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 04dbbcc2f2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:02 +01:00
Andrew Fuerste Henry d64a0c151e
Bug 38986: Restore Any in fund dropdown on suggestions homepage
This patch restores Any as a budget filter option on the suggestions homepage, but does not allow one to select Any when saving a suggestion

To test:
1 - have two suggestions, one with a fund assigned and one without
2 - go to /cgi-bin/koha/suggestion/suggestion.pl, use Fund filter, confirm it does not offer an Any option
3 - apply patch, reload page
4 - use Fund filter, confirm it shows Any as an option and both Any and None work properly
5 - confirm you cannot select Any when creating a new suggestion

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>

Bug 38986: Restore Any option to suggestions homepage filter

"Any" should show all suggestions, any fund value and null fund values. One should not be able to create a suggeestion set to "Any"
"None" should show only suggestions with no fund value selected. A new suggestion should default to "None"

To Test:
1: have two suggestions, one with a fund selected and one without
2: go to suggestions homepage, confirm the filter does not have an "Any" option
3: apply patch, reload page
4: confirm the fund filter on suggestion homepage now has both Any and None and they behave as described above
5: confirm the fund filter defaults to Any as you change the branch filter
6: create a new suggestion, confirm its fund defaults to None and cannot be set to Any

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit da6996c08e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:01 +01:00
Jonathan Druart 8a03b07601
Bug 36025: Fix failure when pref is off
Prevent JS error if ExtendedPatronAttributes is off
 "Uncaught TypeError: options.extended_attribute_types is undefined"

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Makes the Cypress tests pass.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 16f528e4b4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:01 +01:00
Jonathan Druart 0084e6672d
Bug 36025: Add cypress tests
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tests pass, with the followup patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 60332e7552)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:58:00 +01:00
Andreas Jonsson bcd89bb5a7
Bug 36025: Incorrect clause in patron search
This patch removes the search clause for
extended_attributes when there is no patron
attribute types which are searchable by default.

The clause was incorrectly added because the array
extended_attribute_types was rendered as [""]

This seems to be an issue with get_columns from DBIX Class and how that is cast when forcing an array
in the template. It returns an empty string for nothing, a scalar for a single value, and an array for multiple
values.

This patch now checks if the variable is set and has content, and wraps as an array if so. In the case of two attributes,
we do double the array, but this was true before as we always cast the return as an array.

Test plan:

* Make sure that no borrower attribute type is set to "searched by default"
  in Koha administration -> Patron attribute types.
* Enable the network monitring in the developer tools in your web browser
  (Ctrl + Shift + E in firefox or Ctrl + Shift + I and select the "Network"
  tab).
* Go to the patrons view members-home.pl (click patrons in top menu bar).
* Search for a string that will match multiple borrowers (to not be automatically
  redirected)
* Examine the ajax-request and make sure that "extended_attributes.code" is NOT
  part of the query.
* Also, in koha-testing-docker with selenium enabled,
  run 'perl t/db_dependent/selenium/patrons_search.t'
* Now set one patro attribute to searchable and searched by default and add a value for a patron, confirm search works
* Set a second patron attribute to searchable and searched by default and confirm searching works

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Did not run the selenium tests, as they have
been obsoleted.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 208a7cc3a4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:59 +01:00
Nick Clemens f2e36917d3
Bug 39282: (follow-up) Use generated budget and don't rely on existing data
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f97533c7a0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:59 +01:00
Nick Clemens 26cdd0fc70
Bug 39282: Use generated MARC record to create item and return itemnumber
When creating items from the form we need to use the MARC record we build from the HTML->XML->MARC

This patch simply uses the variable we create and ensures we pass the itemnumbers back

To test:
1 - prove -v t/db_dependent/Koha/MarcOrders.t
2 - Still failing
3 - Apply this patch
4 - Success!

Phew! We did it.

Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3f6d482410)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:58 +01:00
Nick Clemens cbb6728394
Bug 39282: Clarify use of budget codes and ids
When getting items from the form on addorderiso2709.pl we are getting actual budget id's,
we only deal with codes when fetching the values from the MARC.
The code here assigns an id into a variable called code - this patch clarifies that and
ensures that we fallback to using the id if one has been passed from the interface form

To test:
0 - Apply first two patches
1 - prove -v t/db_dependent/Koha/MarcOrders.t
2 - It fails
3 - Apply this patch
4 - It fails?

Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fd609d9bb3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:57 +01:00
Nick Clemens 67475d91db
Bug 39282: Ensure items are created using Item Information values if not using MarcItemFieldsToOrder
When using MarcFieldsToOrder and not MarcItemFieldsToOrder it is expected that all of the item
information will come from the second tab 'Item information' on addorderiso2709.pl

Currently we are not and blank items are beign created

To test:
 1 - Apply unit tests
 2 - prove -v t/db_dependent/Koha/MarcOrder.t
 3 - It fails
 4 - Set MarcItemFields to Order:
     price: 949$p
     quantity: 947$c
     budget_code: 947$f
 5 - Ensure MarcItemFieldsToOrder is blank
 6 - Find a basket in acquisitions
 7 - Add to basket from a file
 8 - Fill item information, set 'Matching' at top of form to 'Do not look for matchign records' and save
 9 - Orders are added
10 - Click on a title
11 - Items do not load and an error is generated, this is because items don't have any values
12 - Check the DB:
     SELECT * FROM items WHERE homebranch IS NULL\G
13 - Note items from order are listed
14 - Apply the rest of the patches
15 - Repeat 6-10
16 - This time the items load successfully

NOTE: This patch alone doesn't address all errors, but subsequent will, keeping separate to address
each issue individually, but test plan can be executed as a whole against all

Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5034c27628)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:57 +01:00
Nick Clemens ed42030841
Bug 39282: Unit tests for item creation
Signed-off-by: John Vinke <jvinke@austinseminary.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a68623009b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:56 +01:00
Matt Blenkinsop e94aef3e63
Bug 39007: Update API spec and unit test
Test plan:
1) Run prove t/db_dependent/api/v1/erm_sushi_services.t - FAIL
2) Apply patch
3) Repeat step 1 - PASS
4) Inspect patch diff and note that last_audit has been added to the API definition

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5d67151107)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:55 +01:00
Nick Clemens 0278f12acb
Bug 38459: Ensure cities field works in patron quick add
This patch adjust the selector for quick add and updates the change event for the city
dropdown to affect quickadd fields as well

To test:
 1 - Administration->Cities and towns
 2 - Define several cities
 3 - http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronQuickAddFields
 4 - Select city,state, zipcode and some other fields
 5 - Patrons->Quick add new patron
 6 - Note city field/dropdown does not show
 7 - Apply patch
 8 - Reload
 9 - City dropdown shows!
10 - State and zip are updated when city is selected!
11 - Celebrate!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b007966f44)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:55 +01:00
Emily Lamancusa b22e8d782f
Bug 38789: Add block class to WrongTransfer modal
To test:
1. Find or create an item belonging to a branch other than the logged-in
   branch
2. Check in the item and click OK in the "transfer to home" modal
3. Check the item in again
--> The Wrong Transfer modal should appear, but it doesn't!
4. Apply patch
5. Cancel the transfer or find a different item
6. Check in the item and click OK in the "transfer to home" modal
7. Check the item in again
--> The Wrong Transfer modal should appear
8. Click OK
9. Open the bib record for that item in a new tab
--> The item should have a status of "In transit"
10. Change the system preference TransfersBlockCirc to don't block
11. Check the item in again
--> The Wrong Transfer modal should still appear
12. Confirm that you can click outside the modal to dismiss it without
    choosing an option

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 46e025d08c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:54 +01:00
Owen Leonard 0ba6e56fee
Bug 35808: Remove obsolete responsive table markup from several pages in the OPAC
This patch removes span.tdlabel from several templates. The markup is
obsolete now that we use the DataTables responsive feature.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- Log in to the OPAC as a user with checkouts, suggestions, and tags.
- Check these pages to confirm that the tables on each one have the
  correct responsive behavior at varying browser widths:
  - OPAC home -> Most popular
  - Your account
  - Your account -> Checkout history
  - Your account -> Suggestions
  - Your account -> Tags
* The recalls history page is fixed in Bug 37158

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2627cfbe1d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:53 +01:00
Eric Garcia ad0d333cb1
Bug 33454: Improved breadcrumbs for patron lists
To test:
1. Apply patch
2. Tools -> Patron lists
3. Create a new patron list
4. Click on the name of your new list
5. Notice the breadcrumbs are changed to "Add patron to 'LIST NAME'"
6. Return to Patron lists
7. In your patron list select Actions -> Add patrons
8. Notice the breadcrumbs are the same

Signed-off-by: Fiona Borthwick <fiona.borthwick@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3c6ea779e7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:52 +01:00
Owen Leonard fe61e7c6ac
Bug 38221: Add Bootstrap styling to pagination in authority plugin search results
This patch updates the markup of pagination links in the authority
search popup so that they have Bootstrap styling consistent with other
pages (e.g. catalog search results).

The pagination markup has also been moved to a BLOCK so that it can be
reused instead of duplicated on the page.

To test, apply the patch and go to Cataloging -> New record (using the
basic MARC editor).

- Switch to tab 1 and click the tag editor link next to tag 100 subfield
  a.
- Perform a search in the popup window which will return multiple pages
  of results (an empty search will work with default testing data).
- Confirm that the pagination links are styled like catalog search
  results.
- Confirm that the search links work correctly and that the correct
  number is highlighted as you page through results.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a762f61faa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:52 +01:00
Owen Leonard 9298b8ee4d
Bug 37826: Remove the use of the script_name variable where it is unnecessary
Most of the places where a "script_name" variable used it is not
strictly necessary. Because it is also used inconsistently, I think it's
better to simply remove the use of the variable where it isn't strictly
necessary.

This patch removes creation of the template variable from several
scripts and updates the corresponding template with the URL itself.

To test, apply the patch and restart services. Test the following pages,
including the various permutations where they are present, e.g. New,
Edit, Delete.

- Administration -> Cities and towns -> Search via the header search
  form
- Administratoin -> Currencies and exchange rates -> Search via the
  header search form
- Administration -> Desks
- Administration -> Budgets
- Administration -> Authority types
- Administration -> Authority types -> MARC structure -> Subfields
- Administration -> Classification configuration
- Administration -> MARC bibliographic framework
- Administration -> MARC bibliographic framework -> MARC structure ->
  Subfields
- Administration -> Record matching rules
- Administration -> OAI repositories
- Administration -> Patron attribute types
- Administration -> System preferences -> Local use
- Administration -> Z39.50/SRU servers
- Acquisitions -> Vendor -> Contracts
- Acquisitions -> Vendor -> Basket -> Export as CSV
- Acquisitions -> Vendor -> Basket -> Edit basket
- Acquisitions -> Vendor -> Basket groups
- Tools -> Import patrons
- Tools -> Notices and slips

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a433d4f20)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:51 +01:00
Tomas Cohen Arazi ae9b983130
Bug 38684: Improve translatability in cat-toolbar.inc
This patch converts strings using

* *subscription(s)*
* *item(s)*

into different strings for the singular and plural forms. This helps
translating and is also more accurate for the end user.

To test:
1. Have a record with 2 items and 2 subscriptions
2. hover on the _Edit > Delete record_  dropdown item
   => FAIL: Mixed form string about items
3. Delete one item at a time, repeating 2
   => FAIL: Mixed form string at each step
4. Once items are deleted, repeat 2
   => FAIL: Mixed form string about subscriptions
5. Delete one subscription at a time, repeating 2
   => FAIL: Mixed form string at each step
6. Apply this patch
7. Repeat 1-5
   => SUCCESS: Different message in singular and plural forms
   => SUCCESS: The message is correct
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 03392b660e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:50 +01:00
Emily Lamancusa 65401fbbb8
Bug 38735: Add preferred_name to default search fields for new installations
To test:
1. Attach patch first, and then start up KTD or sandbox to see the
   behavior for a new installation
2. Go to Administration > System Preferences and search for
    DefaultPatronSearchFields
3. Click to edit
--> Confirm preferred_name is checked in the modal that displays
4. Edit a patron to give them a preferred name that is different from
   their first name
5. Search for the patron by the newly set preferred_name
--> Confirm the patron correctly autocompletes and appears in the search
    results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit deccd6eb7e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:50 +01:00
Lari Taskula dad4363826
Bug 35975: Show biblionumber when download cart as BibTeX
To test:
1. In OPAC, add a record to your cart
2. Go to your cart
3. Click Download -> BibTeX
4. Observe downloaded file in your favorite text editor
5. Observe Koha::Hash(xxx) within file contents
6. Apply patch
7. Repeat steps 3 and 4
8. Observe Koha::Hash has been replaced with biblionumber

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f66379c075)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:49 +01:00
Owen Leonard ea3e032c1e
Bug 38753: Missing table cells breaks OPAC charges table
This patch adds a couple of instances of the empty cell required by
DataTables to enable responsive behavior. The mismatch between table
headers and table cells causes DataTables to fail.

To test you must log in to the OPAC as a user with charges and credit.

- Apply the patch and go to Patrons in the staff interface.
- Find and view a patron record. Click "Accounting" in the sidebar menu.
- Use the "Create manual invoice" and "Create manual credit" tabs to
  create at least one charge and a credit which is greater than the
  charges.
- Log in to the OPAC as that user and go to their Charges tab.
- The charges table shoud look correct, with DataTables sorting
  indicators on the table headers to indicate that DataTables is
  working.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b49cac544f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:48 +01:00
Magnus Enger 7ca2800567
Bug 38617: Fix warning about auto increment and biblioitems
To reproduce:
- Delete a bibliographic, noting the biblionumber (let's call it X)
- Run this in the database:
    UPDATE deletedbiblioitems SET biblionumber = X;
- Go to About Koha > System information
- Notice the warning compares two tables that are not equivalent:
  "The following IDs exist in both tables biblio and deletedbiblioitems"

To test:
- Apply the patch
- Reload the System information
- The warning should now read:
  "The following IDs exist in both tables biblioitems and deletedbiblioitems"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 44e15f5b99)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:48 +01:00
Owen Leonard bc595b1cf4
Bug 38349: Fix style of sidebar form submit button on tags review page
This patch fixes the markup of the sidebar form on the tags
review page and removes an incorrect "btn-sm" class from the
submit button.

To test, apply the patch and go to Tools -> Tags.

In the sidebar form, confirm that the submit button has the same yellow
"primary" style as other submit buttons, and that it fills the width of
the sidebar.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f6c4663d85)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:47 +01:00
Owen Leonard 3d61004716
Bug 38285: Replace instances of obsolete Bootstrap class "pull-right"
This patch fixes instances where the pre-Bootstrap-5 class "pull-right"
was missed during the upgrade. Most cases were on dropdown menus, and
in all of these cases the class can be removed because Bootstrap 5 menus
have better responsive behavior.

Other changes: Added "dropdown-item" classes to some menu items which
lacked it; Added some custom style for the "Filter" form in the patron
permissions toolbar.

To test, apply the patch and rebuild the staff interface CSS. Test that
the following menus look correct and work correctly:

- Catalog -> Bibliographic details page -> Holdings table: The "Edit"
  secondary menu shown for each item (requires that the LocalCoverImages
  system preference be enabled.
- Administration -> Z39.50 servers: The "Actions" menu for each server
  in the list of servers.
- Circulation -> Article requests: The "Actions" menu for each title and
  under each tab (New, Pending, and Processing).
- Tools -> Patron lists: "Actions" menu.
- Administration -> Plugins: "Actions" menu (requires that you have at
  least one plugin installed).
- Reports -> Saved SQL reports: The secondary menu on each saved
  report's "Run" button .
- Cataloging -> Rotating collections: "Actions" menu.
- Serials -> Subscription search results: In the "Open" tab, the
  secondary menu on the "Serial receive" button on each subscription. In
  the "Closed" tab, the "Actions" menu.
- Acquistions -> Suggestions: The secondary menu on each title's
  "Edit" button.
- Tools -> HTML customizations: The secondary menu on the "New
  entry" button; The secondary menu on each entry's
  "Edit" button; Edit entry -> The secondary menu on the "Save" button.
- Cataloging -> Stock rotation: The "Manage" menu on each rota.

A non-menu change:
- Patrons -> Patron details -> More -> Set permissions: CSS has been
  added to correctly align the "Filter" menu.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b6c04435c5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:46 +01:00
Jonathan Druart 05ad9af434
Bug 37761: Add focus on patron search when on the tab
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4fb4b7527e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:45 +01:00
Sukhmandeep Benipal 6043a37c65
Bug 37761: Fix redirection on the tabs and buttons
To test:
- Apply the patch and enable the CurbsidePickup system preference if
  necessary.
- Properly testing requires testing data. You can run this command to
  REPLACE your curbside pickup data with sample data:

  bash <(curl -s https://gitlab.com/-/snippets/2572579/raw/main/test_curbside_pickups.sh)

- Go to Circulation -> Curbside pickups.
- Confirm that the tabs look correct. The first tab should be active
  by default.
- Confirm that the right content is displayed when you click each tab.
- Under the "Schedule pickup" tab, search for a patron.
- After you submit the search the page should reload and the "Schedule
  pickup" tab should be open.
- Go on each tab and try each button to verify you're staying on the
  same tab.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ffb344c580)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:45 +01:00
Owen Leonard 23f28132b9
Bug 37761: Use tab WRAPPER for circulation curbside pickups tabs
The tabs on Circulation -> Curbside pickups look broken because they
were not updated to use the tab WRAPPER markup. This patch revises the
template so that the tabs look correct and makes additional changes to
ensure that the correct tab is preselected.

To test:
- Apply the patch and enable the CurbsidePickup system preference if
  necessary.
- Properly testing requires testing data. You can run this command to
  REPLACE your curbside pickup data with sample data:

  bash <(curl -s https://gitlab.com/-/snippets/2572579/raw/main/test_curbside_pickups.sh)

- Go to Circulation -> Curbside pickups.
- Confirm that the tabs look correct. The first tab should be active
  by default.
- Confirm that the right content is displayed when you click each tab.
- Under the "Schedule pickup" tab, search for a patron.
- After you submit the search the page should reload and the "Schedule
  pickup" tab should be open.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1311b8c01c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:44 +01:00
Alexander Wagner 73da62c0fe
Bug 38711: Wrong font-weight in tables during printing from staff interface
Fix last columns of tables to be printed in `bold`. This affects
various functions of Koha e.g. Notices and Slips, Pages etc.

1. Go to `Home / Tools / Additional content / Pages`
2. Select `Add new entry using text editor`
3. Add the following html

```html
<table>
   <tbody>
      <tr>
         <td>col 11</td>
         <td>col 12</td>
      </tr>
      <tr>
         <td>col 21</td>
         <td>col 22</td>
      </tr>
</tbody>
</table>
```

4. Save
5. Use the `Staff`-URL from `Additional content: Pages`
   to open the page in a new tab
6. Select `File / Print`
   (or fire up the dev console via F12 and apply the Print-css)
7. The entries `col 12` and `col 22` appear in bold face.
8. Apply the patch
9. Reload the page
10. The entries `col 12` and `col 22` appear in normal font.

Sponsored-by: Deutsches Elektronen-Synchrotron DESY, Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ec0ced1652)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:43 +01:00
Emily Lamancusa 9ab00220f5
Bug 38748: Pass the correct branchcode value to transfer slip
To test:
1. Find or create an item belonging to a library other than the
   logged-in library
2. Check the item in and print slip
--> The transfer slip says "Transfer to" but the library name is blank
3. Apply patch and restart_all
4. Cancel the transfer or find a different item
5. Check the item in and print slip
--> The library name now appears on the slip

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4ee3accfb3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:43 +01:00
Owen Leonard 787284c359
Bug 38667: Point of sale transaction history should not appear to be sortable
This patch adds configuration options to the Point of sale "Transactions
to date" and "Older transactions" tables so that they don't appear to be
sortable. Both have an option that makes their sorting fixed.

To test, apply the patch and go to Point of Sale.

- Enable 'EnablePointOfSale' and 'UseCashRegisters' system preferences.
- Add a least one cash register (Administration -> Cash registers).
- Add a least one debit type (Administration -> Debit types). Check "Can
  be sold."
- Go to the Point of Sale page.
  - Under "Items for purchase" click "Add" next to an item.
  - Under "Collect payment," fill out the form, including the cash
    register selection, and submit.
- Click "Transaction history for..." in the sidebar menu. (You may have
  to click "Cash summary for..." and then the name of the register you
  used in your transaction.
  - Check that the "Transactions to date" and "Older transactions"
    tables do not have sorting indicators in the table headers.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eaeb05b5e1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:42 +01:00
David Nind 7cd5464d10
Bug 36609: Update index type labels for search engine configuration
This fixes the labels used for the type options when configuring
Elasticsearch search fields so that they use:
- sentence case
- the full name, instead of abbreviations (to make it clearer
  for translators)

Test plan:
1. Go to Administration > Catalog > Search engine
   configuration (Elasticsearch).
2. In the search fields tab, select the type column dropdown list
   for any field. Note the labels used for these options:
   - <empty entry> (the default option)
   - Std. Number
   - Call Number
3. Apply the patch.
4. Refresh the page.
5. Repeat step 2 and note that the option labels are now:
   - Default (instead of being blank)
   - Identfier (instead of Std. Number)
   - Call number (instead of Call Number)
6. Sign off D:

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f549427e3d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:41 +01:00
Owen Leonard ebb0420365
Bug 38665: Fix markup error in Additional fields template title
The logic of the title tag construction should not result in a caret
preceding the first element on the Additional fields main page.

To test, apply the patch and go to Administration -> Additional fields.
There should be no caret appearing at the start of the page title
information:

Additional fields > Administration > Koha

Other pages (listing additional fields, adding additional fields, etc)
should have the correct title, e.g.

New field > Table 'aqbasket' > Additional fields > Administration > Koha

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ca170081b8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:41 +01:00
Owen Leonard 698d48e775
Bug 38077: Fix minor spacing issue in self checkout login page
This patch adjusts the markup and CSS of the self checkout login screen
so that form layout is consistent and readable. I have adjusted the
template conditional so that it re-uses more form elements like
<legend>.

To test, apply the patch and enable WebBasedSelfCheck if necessary.

- Set the SelfCheckoutByLogin system preference to 'cardnumber'
- Go to the self-checkout page (/cgi-bin/koha/sco/sco-main.pl)
  - The login form should be labeled "Log in to your account" followed
    by the label, form field, and submit button arranged vertically.
- Set the SelfCheckoutByLogin preference to "username and password"
- Reload the self-checkout page. The form should look the same with the
  addition of the password field.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4d67788ad1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:40 +01:00
Phil Ringnalda 9fff5c9680
Bug 38462: Remove unused code for pagination in OPAC authority search
The remote branch for bug 13618 started out when OPAC authority search did its
own pagination in a template block, then bug 2735 replaced that with
pagination_bar, the template var passed from the script, then at some point
before bug 13618 landed the second time, a rebase error put the template block
back in. And since it's not at all obvious it is dead code unless you look for
where "pagination" rather than "pagination_bar" is used, we've kept updating
it, and bug 36032 thought the way it used >> instead of > for next ought to be
fixed while one that was actually used was fixed.

Time to get rid of it, before we 'fix' it again.

Test plan:
 1. Without the patch, in the OPAC go to Authority Search and do a search that
    will return pages of results, like the letter a
 2. Note that the button for the next page uses ">" rather than the "Next >>"
    in the block this patch removes
 3. Apply patch, click the browser Back button, refresh page
 4. Verify that when you search for something that returns more than one
    page of results, the page navigation hasn't changed from what it was
    before the patch, telling you that what the patch removes was unused

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8c9fd0f5d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:39 +01:00
David Nind 0ec0afb8d6
Bug 38771: (follow-up) Fix the authentication log not enabled message
This corrects the display of the "Log not enabled" message for the
authentication module in the log viewer.

If either AuthFailureLog or AuthSuccessLog system preferences are
set to "Don't log":
- the "Log not enabled" warning icon is now shown
- clicking the triangle icon now links to the two system
  preferences

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 86e8835da0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:38 +01:00
Roman Dolny 678af00b32
Bug 38771: Typo 'AuthScuccessLog' system preference
Typo in system preference 'AuthScuccessLog' -> 'AuthSuccessLog'.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2f5c51383a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:38 +01:00
Roman Dolny ebb624abf0
Bug 38772: Typo 'minPasswordPreference' system preference
Typo in system preference 'minPasswordPreference' -> 'minPasswordLength'
in opac/opac-password-recovery.pl

There is no 'minPasswordPreference' system preference in database.
Bug 23816 added the capability to override minPasswordLength.

Test plan:
==========
1. Check 'minPasswordPreference' appearances:
   git grep -i 'minPasswordPreference' **/*
--> Note: only one in opac-password-recovery.pl; no one in sysprefs.sql
2. Apply the patch.
3. Repeat p. 1. Note there is not 'minPasswordPreference' at all.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b8db36d2a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:37 +01:00
Yanjun Li 76851bd358
Bug 38302: Add delete confirmation dialog
To test:

1. Create a list in the staff interface
2. Go to lists
3. See "Your lists" tab and find "Delete" button in "Actions" col, click "delete", no confirmation dialog pop up
4. Create another list
5. Go to lists and view the list detail
6. See "Edit" dropdown and click "Delete Lists" button, see confirmation dialog pop up
7. Apply patch
8. Try step 1 through 3 again
9. "Delete" button in "actions" column has the same confirmation dialog, and delete function works

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0a5591bdaa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:36 +01:00
Pedro Amorim 21efe4376e
Bug 38782: mock_userenv in API tests
Reorder logic slightly for each to only create the counter_file after the mock_userenv has taken place

prove t/db_dependent/api/v1/erm_custom_reports.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1e7c49ab98)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:36 +01:00
Pedro Amorim 9e6ce8b2e7
Bug 38782: Apply same fix for CounterFile.t
prove t/db_dependent/Koha/ERM/EUsage/CounterFile.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidy (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a297c42394)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:35 +01:00
Pedro Amorim a984732e8e
Bug 38782: Remove concat in background process
The ud_provider->{report_type} is only defined on ->harvest_sushi, meaning it'll never be defined here.
We don't need this anyway. The filename should be the filename of the file being manually uploaded. We only need this concat logic for COUNTER files being generated by Koha following a SUSHI harvest, and that works.
This also gets rid of a warning when running the tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0231911c98)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:34 +01:00
Pedro Amorim feb0c7d0cf
Bug 38782: Mock userenv->{number}
prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidy (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3e8b9b851)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:34 +01:00
Pedro Amorim d63389ea43
Bug 36039: (QA follow-up): Improve audit messages
Improve messages clarity.
Show success message if no schema diff was found from audit.
Code refactor to ensure the title+message shown in UI is the same as the one shown in CLI and are all translatable.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7834d25fb4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:33 +01:00
Pedro Amorim a231a87980
Bug 36039: (QA follow-up): Address i18n for print messages
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 42c1e109af)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:32 +01:00
Martin Renvoize 3cf64a6f98
Bug 36039: (follow-up) Move view logic to script/template
This patch updates the module as suggested by David to handle just the
diff code and leaves the display logic up to the templates and script.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: JesseM <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 534fba2691)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:31 +01:00
Pedro Amorim 0ac5a0175f
Bug 36039: New 'datatabase audit' tab in about page
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: JesseM <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6940167048)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:31 +01:00
Pedro Amorim 47eee4806b
Bug 36039: Move audit_database script logic to a dedicated module
Test plan #1 ensure same script functionality (same as bug 34064):
0. Apply patch
1. vi ./installer/data/mysql/kohastructure.sql
2. Comment out some columns, change NULL status, or whatever you like
3. perl misc/maintenance/audit_database.pl \
    --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql
4. Note that the output includes SQL commands to change the database
to match the new kohastructure.sql

5a. Try using koha-foreach and note that the database name appears above
the database comparison
5b. koha-foreach "perl misc/maintenance/audit_database.pl \
    --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql"

Test plan #2:
1. After doing test plan #1, access the new 'database audit' tab, visit:
<staff_url>/cgi-bin/koha/about.pl?tab=database
2. Ensure the output is the same as test plan #1

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: JesseM <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 09bb85409d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:30 +01:00
Lucas Gass f0a7d8e843
Bug 37398: Fix test in basic_workflow.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2350a2ada8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:29 +01:00
Lucas Gass dde1caa25c
Bug 37398: Add CSS for the important class
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9b7dcb46ea)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:28 +01:00
Jonathan Druart c55433be78
Bug 37398: Adjust tests
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3fe252f6a8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:28 +01:00
Jonathan Druart a99c7df46c
Bug 37398: Do not rely on the columns names but data type instead
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d2a6915010)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:27 +01:00
Lucas Gass 7515709b47
Bug 37398: Adjust CSS for flatpickr
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 125d8ec1cf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:26 +01:00
Lucas Gass c769f4fc61
Bug 37398: Add set to today function to calendar.inc
To test:
1. Try editing some items with a empty value in the flatpickr.
2. Make sure the empty date fields get a date set to today when you click on the empty field.
3. Try a datetime field, making sure the datetime is correctly set.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d5bd311d4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:26 +01:00
Lucas Gass 7dfc7e9e6e
Bug 37398: Add a unit test
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2f317a767)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:25 +01:00
Lucas Gass 35dc15c27c
Bug 37398: Make sure subfield and subfield_date are defined
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d32218fb68)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:24 +01:00
Lucas Gass ef2cff9e76
Bug 37398: Adjust CSS for wrapped flatpickr
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f049a13ef8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:24 +01:00
Lucas Gass 83aeae0f4d
Bug 37398: Make date and date time fields have date picker by default
To test:
1. APPLY PATCH, restart_all
2. Pick a framework, I choose BKS in k-t-d
3. Make sure that a few date and datetime fields are exposed in the editor.
4. On additem.tt a date picker should be instantiated on the date or datetime fields.
5. Make sure the date pickers work on each field.
6. If it is a datetime field you should have the option to add hours and minutes. ( datelastseen )
7. Edit the framework and remove the dateaccessioned.pl plugin from any of these date fields.
8. Even without the dateaccessioned.pl plugin a date picker should be present on the field.
9. Add the dateaccessioned.pl plugin to a non date/datetime field.
10. Make sure the dateaccessioned.pl plugin works properly on the non date/datetime field.
11. Mark one of the date/datetime fields as mandatory, make sure it still acts as mandatory.
12. Hide date/datetime from the editor, make sure it hides properly.

+----------------------+-------------+
| COLUMN_NAME          | COLUMN_TYPE |
+----------------------+-------------+
| dateaccessioned      | date        |
| replacementpricedate | date        |
| datelastborrowed     | date        |
| datelastseen         | datetime    |
| onloan               | date        |
+----------------------+-------------+

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit aa4ee79f6e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:23 +01:00
Pedro Amorim 397ca582ed
Bug 36627: (QA follow-up): Rename borrowernumber -> patron_id
To test:
$ prove t/db_dependent/api/v1/erm_counter_logs.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 15803e4f29)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:22 +01:00
Katrin Fischer 9552571770
Bug 36627: Fix typo "embeded"
A search turned up more of these in other files. Fixed as well.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3b86455e02)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:21 +01:00
Jonathan Druart 55fd58fd96
Bug 36627: (follow-up) Use patron_to_html in 'Imported by' column
We don't need those 2 lines

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5d6af90d76)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:21 +01:00
Pedro Amorim 091dcca219
Bug 36627: (QA follow-up): Add missing tests
1) Apply patch
2) $ yarn api:bundle
3) $ prove t/db_dependent/Koha/ERM/EUsage/CounterLog.t
4) $ prove t/db_dependent/api/v1/erm_counter_logs.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a314ea750)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:20 +01:00
Pedro Amorim 87a6bad652
Bug 36627: Add tests
k-t-d, from /kohadevbox/koha, run:
yarn run cypress run --spec "./t/cypress/integration/ERM/DataProviders_spec.ts"

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7faa42505f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:19 +01:00
Pedro Amorim 1acb7108b5
Bug 36627: Use patron_to_html in 'Imported by' column
For consistency, and to avoid 'null koha' for a file imported by
the koha user (no first name).

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f70a5ffc67)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:18 +01:00
Matt Blenkinsop 6a0b086db0
Bug 36627: Rename embed method to patron
This patch renames the embed method from borrowernumber to patron to fit with the use of 'patron' in the API

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7b75586ead)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:17 +01:00
Matt Blenkinsop e6aecb4275
Bug 36627: Embed patron record for display
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit da475321a5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:16 +01:00
Matt Blenkinsop d692b92feb
Bug 36627: Record who is importing sushi data
This patch adds functionality for storing the patron (or cronjob) that triggers a harvest. Currently every counter log is stored as being imported by the cronjob

Test plan:
1) In the usage statistics module in ERM, create a data provider (the details in the provider are not important)
2) Click into the provider and click into manual upload
3) Upload the file attached to this bug
4) Once the background job is completed click into the counter logs tab in the provider. The imported by columns should show a user with a clickable link

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 062e04c9c3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:16 +01:00
Janusz Kaczmarek 0e84acf5f4
Bug 38483: C4::Heading::preferred_authorities is not used
C4::Heading::preferred_authorities seems to be not used for ages (maybe
never used?)

Test plan:
$ git grep preferred_authorities
-->   should return nothing

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c70b09dfc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:15 +01:00
Katrin Fischer d1403a9992
Bug 38662: Fix terminology "Members" and remove unneeded sub-heading
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f42df40680)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:14 +01:00
Pedro Amorim b90ae7a461
Bug 38662: Remove redundant 'ERM' labels
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2b0286889d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:14 +01:00
Pedro Amorim d01a56efca
Bug 38662: Sort tables alphabetically
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4012f805b6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:13 +01:00
Pedro Amorim 399445dfa6
Bug 38662: Group tables by module name
Test plan:
1) Before applying patches, visit the additional fields admin page:
   <staff_url>/cgi-bin/koha/admin/additional-fields.pl
2) Notice the tables are not grouped by module, and not alphabetically sorted
3) Apply patches. Refresh

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a0c475bc5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:12 +01:00
Pedro Amorim 7b37841272
Bug 36662: Move test files to the correct folder structure
Trivial leftover house-keeping from bug 35581.

Test plan:
$ prove t/db_dependent/Koha/ILL/*

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b26b7d740f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-03-19 23:57:03 +01:00
Paul Derscheid 7707a62f91
Update release notes for 24.11.02 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-26 19:49:30 +01:00
Paul Derscheid dcd9f344b8
Increment version for 24.11.02 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-26 19:34:43 +01:00
Paul Derscheid 8ab34091c8
Merge remote-tracking branch 'upstream/24.11.x' into 24.11.x-security
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-26 19:24:37 +01:00
Marcel de Rooy 722c25cde0
Bug 36081: (QA follow-up) Resolve IsNotDebit exception in ArticleRequests.t
Resolve (when running ArticleRequests.t):
Exception 'Koha::Exceptions::Account::IsNotDebit' thrown 'Account line 326 is not a debit'

This occurs after switching from ArticleRequest->new to TestBuilder.
TestBuilder creates an account line that has a credit_type_code and
a debit_type_code. (This could be fixed further somewhere else.)
For now, just setting debit_id to NULL.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 20:43:23 +01:00
Jonathan Druart 8c5ef89980
Bug 36081: Fix some failing tests
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 20:43:23 +01:00
Jonathan Druart d9c0df63da
Bug 36081: Mock format
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 20:43:22 +01:00
Jonathan Druart e20810db55
Bug 36081: Force TestBuilder to generate a valid format value
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 20:43:21 +01:00
Jonathan Druart 59a2a2c80e
Bug 36081: Use multivalue_preference
C4::Context->multivalue_preference is not used so far and split on |
However the values of "multiple" sysprefs are separated by... comma!

Let support both here.

This patch also removes silly JS code in the template.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 20:43:20 +01:00
Marcel de Rooy ee6abf031f
Bug 36081: Check SupportedFormats server side
Test plan:
Add article request with format via OPAC.
Run t/db_dependent/Koha/ArticleRequest.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tests in t/db_dependent/Koha/ArticleRequest.t pass. I can add an
article request with a type. If I allow PHOTOCOPY but change the
HTML in the OPAC form so SCAN is submitted I get a nice (but
somewhat generic) error.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 20:43:16 +01:00
David Cook 3e0c804801
Bug 39170: Improve validation of report ID
This change improves the validation of the report ID passed by the user.

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Create a SQL report
3. Go to /cgi-bin/koha/tools/scheduler.pl
4. Add in a Time, Date, and Email
5. Choose your report from the list
6. Click "Save"
7. Note that your report is saved

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 19:30:48 +01:00
Owen Leonard 255c516764
Bug 37266: [24.11.x] patron_lists/delete.pl should have CSRF protection
This patch adds CSRF protection to patron list deletions.

Also changed: The "Delete selected lists" button is now in a floating
toolbar.

To test, apply the patch and go to Tools -> Patron lists.

- If necessary, create a few patron lists.
- Test the two methods for list deletion available on the page:
  - Check one or more checkboxes and then click the "Delete selected
    lists" at the top of the page.
  - Click the "Actions" button for an individual list and choose "Delete
    list."
- Open the checkout page for a patron.
  - Under the "Patron lists" tab, add the patron to a list.
  - Click the "Actions" button for an that list and choose "Delete
    list."
  - When you are taken to the patron lists page the list should have
    been deleted.
- Perform the same test on the patron details page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-24 19:30:42 +01:00
David Cook d8ed07594f
Bug 38469: Replace single quotes with double quotes to prevent XSS
This change replaces single quotes with double quotes to prevent XSS
for particular operations on the circ returns page.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/circ/returns.pl?print_slip=1&reserve_id=1
2. Note that a pring slip is generated
(you may need to allow popups)

3. To test the XSS is patched, try the proof-of-concept from the
bug report

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:21 +01:00
David Cook 6d2b0c4a28
Bug 38488: Add Template::Toolkit filter for C4::Scrubber
This change adds a Template::Toolkit filter which is invoked
via " | scrub_html type => 'note' ".

Test plan:
0. Apply the patch
1. prove t/Koha/Plugins/HtmlScrubber.t

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:20 +01:00
Phil Ringnalda 70781686fd
Bug 38961: XSS in vendor search
acqui/booksellers.tt and admin/currency.tt use | $HtmlTags without first
filtering the string they wrap.

Test plan:
1. Without the patch, load the URL in comment 1, note the alert()
2. Apply patch, load the URL in comment 1, no alert()

Sponsored-by: Chetco Community Public Library
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan, works as advertised.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:20 +01:00
Tomas Cohen Arazi 937a412362
Bug 28478: Make opac-*detail.pl scripts use Koha::Biblio->opac_suppressed()
This patch makes the following scripts use the new method for checking
suppression:

* opac/opac-ISBDdetail.pl
* opac/opac-MARCdetail.pl
* opac/opac-detail.pl

In the `opac-detail.pl` case, it is a simple change by removing MARC
data traversal in favor of the new method. The code checking
suppression gets moved up so we don't process or make any other
calculations if the record is suppressed.

The other two scripts where completely missing the check and thus
leaking suppressed records.

To test:
1. Pick two records, one marked as suppressed, and the other not
   suppressed.
2. Try acessing them in the OPAC detail page.
=> SUCCESS: Suppressed records are suppressed, and not suppressed ones
are not.
3. Try the same records on the ISBD and MARC view
=> FAIL: They are not suppressed!
4. Apply this patch
5. Repeat 2
=> SUCCESS: Suppression is still respected
6. Repeat 3
=> SUCCESS: Suppression is respected on the ISBD and MARC views
7. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Remember to activate OPAC suppression with
OpacSuppression.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:20 +01:00
Tomas Cohen Arazi 2e0bcc4191
Bug 28478: Add Koha::Biblio->opac_suppressed()
This patch adds a convenient method at the Koha::Biblio level, as a
wrapper for the extrator added on this bug. Following the established
pattern we adopted a while back.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass! All use cases covered!
3. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:20 +01:00
Tomas Cohen Arazi b503cfe2be
Bug 28478: Add get_opac_suppression extractor
This patch adds an extractor method for the historically hardcoded field
942$n. This way we have a single place in which we code the extraction
and sanitization of its value.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC.t
=> SUCCESS: Tests pass! All use cases are covered!
3. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:20 +01:00
Marcel de Rooy 538005a28c
Bug 37816: (QA follow-up) Avoid repetition, typo and pipe test
Combining three regexes into one. Typo replcing.
Adding a test with pipe in pwd.

Test plan:
Run t/SIP/Sip.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:20 +01:00
Magnus Enger 8e2c03cc20
Bug 37816: Stop SIP2 from logging passwords
Koha's SIP2 server does a lot of logging, including all incoming
requests, in full. This means that passwords are logged, both for
the user the SIP2 client uses for logging into Koha, as well as
for the end users who provide a password to e.g. check something
out. This patch replaces passwords with three asterisks in
log strings, before they are written to the log.

To test, in ktd:
- Run the new tests:
  $ prove t/db_dependent/SIP/Sip.t
- Tail the SIP2 logs:
  $ sudo tail -f /var/log/koha/kohadev/sip*.log
- Telnet into the SIP2 server:
  $ telnet localhost 6001
- Try logging in by pasting this into the telnet session:
  "9300CNterm1|COmypassword|CPCPL|"
- Verify that "mypassword" is replaced by "***" in the logs
- Try different values for the password, including the correct password
  which is "term1" in ktd
- Try other SIP2 messages that include password fields (AC, AD, CO)

Update 2024-12-03: Fix issues pointed out by QA.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:19 +01:00
Julian Maurice 551ab16e1f
Bug 38454: Flush memory cache before every API request
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:19 +01:00
Phil Ringnalda 8a66a7edb8
Bug 38467: (follow-up) Update cpanfile
For use_rfc3986() to work, we need at least Template::Toolkit 2.27.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:19 +01:00
Phil Ringnalda b9f8a947da
Bug 38467: (follow-up) Fix test
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:19 +01:00
Jonathan Druart 6a5033466b
Bug 38467: Add test
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:19 +01:00
David Cook 37c9513cb7
Bug 38467: Make uri and url filters rfc3986 when using C4::Template
This change invokes Template::Filters->use_rfc3986 in the C4::Template
module.

Test plan:
0. Apply the patch
1. Note that "uri" and "url" filters now escape single quotes

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:18 +01:00
Lari Taskula 19cbf9701f
Bug 28907: REST - Drop support for allow-owner functionality
...and allow-guarantor functionality. Replaced by $c->auth->public($patron_id)
and/or $c->auth->public_guarantor($patron_id), where $patron_id is the patron's
id that owns the requested resource.

Old method, was applicable to both privileged and public routes:

  api/v1/swagger/paths/route.yaml

  x-koha-authorization:
    allow-owner: true
    allow-guarantor: true

New method, use public routes with no x-koha-authorization:

  GET /public/route/{patron_id}
  Koha/REST/V1/Controller#public_action:

  sub public_action {
      my $c = shift->openapi->valid_input or return;
      my $patron_id = $c->param( 'patron_id' );
      try {
          # Throws an exception that will render a response of 401 if not
          # authenticated and 403 if trying to access another user's resources
          $c->auth->public($patron_id); #or $c->auth->public_guarantor($patron_id)
          ...
          # other code
          ...
      }
      catch {
          $c->unhandled_exception($_);
      }
  }

  Another example of retrieving $patron_id when patron_id is not a request
  parameter:
  GET /public/another/object/{another_object_id}

  my $patron_id = Another::Object->find($another_object_id)->borrowernumber;
  try {
      # 403 if $another_object_id does not belong to API user
      $c->auth->public($patron_id);
      ...

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:18 +01:00
Lari Taskula 390814e215
Bug 28907: REST - Remove allow-owner from public article requests cancel route
To test:
1. prove t/db_dependent/api/v1/article_requests.t
2. Apply patch
3. prove t/db_dependent/api/v1/article_requests.t

Observe success in both cases.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:18 +01:00
Lari Taskula cb283f3b8e
Bug 28907: REST - Remove allow-owner from public checkout availability route
To test:
1. prove t/db_dependent/api/v1/checkouts.t
2. Apply patch
3. prove t/db_dependent/api/v1/checkouts.t

Observe success in both cases.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:18 +01:00
Lari Taskula 195136df34
Bug 28907: REST - Remove allow-owner from public patron hold cancellation
To test:
1. prove t/db_dependent/api/v1/patrons_holds.t
2. Apply patch
3. prove t/db_dependent/api/v1/patrons_holds.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:18 +01:00
Lari Taskula 48f8bdff0e
Bug 28907: REST - Remove allow-owner from public guarantors can see charges and checkouts
To test:
1. prove t/db_dependent/api/v1/patrons.t
2. Apply patch
3. prove t/db_dependent/api/v1/patrons.t

Observe success in both cases.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:18 +01:00
Lari Taskula 5d5bdf0415
Bug 28907: REST - Remove allow-owner from public checkouts route
To test:
1. prove t/db_dependent/api/v1/checkouts.t
2. Apply patch
3. prove t/db_dependent/api/v1/checkouts.t

Observe success in both cases.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:17 +01:00
Lari Taskula 24e08da733
Bug 28097: REST - Remove allow-owner from public password route
To test:
1. prove t/db_dependent/api/v1/patrons_password.t
2. Apply patch
3. prove t/db_dependent/api/v1/patrons_password.t

Observe success in both cases.

https://bugs.koha-community.org/show_bug.cgi?id=28907
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:17 +01:00
Lari Taskula c692261d4b
Bug 28907: Add Koha::REST::Plugin::Auth::PublicRoutes
To test:
1. prove t/db_dependent/Koha/REST/Plugin/Auth/PublicRoutes.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:17 +01:00
Lari Taskula 10e9863670
Bug 28907: Add REST exceptions for public routes auth
To test:
1. perl -c Koha/REST/Plugin/Exceptions.pm
2. perl -c Koha/Exceptions/REST.pm

More tests coming in following patches.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:17 +01:00
Jonathan Druart 358f634dc1
Bug 38829: Sanitize GetLateOrMissingIssues inputs
Signed-off-by: Magnus Enger <magnus@libriotech.no>
The new test fails without this patch, and passes
when it is applied.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:17 +01:00
Jonathan Druart c0e61487d7
Bug 38829: Add a test
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added a shebang line.
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-18 19:17:12 +01:00
Sam Lau 6a546d69f0
Bug 37427: Fix club search to display all clubs when search field is empty, consistent with patron search behavior
To test:
1) Create multiple patron clubs
2) Find a bib
3) Click Holds, then Clubs
4) Without entering any text, press the search button
5) Note that the list of clubs is not shown.
6) Apply patch and restart_all
7) Press the search button again, the entire list of clubs should be shown.
8) Ensure original search functionality still works

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 375b3e6cbf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:54 +01:00
Owen Leonard fb7ed498e9
Bug 37311: (follow-up) Use Bootstrap badge classes for some statuses
Rather than add a style to a whole table row I think we should use BS5's
badge classes to style debug mode and default configuration information.

To test you should have at least one SMTP server set as default and at
least one with debug mode turned on.

Go to Administration -> SMTP servers and view the table of SMTP servers.
Any server with debug mode turned on should show "On" styled as a yellow
badge with black text. A server set as default should show "Default"
styled as a green badge with white text.

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8145d526e9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:53 +01:00
Owen Leonard f3d2dd1d0c
Bug 37311: Tone down the SMTP servers administration page
This patch makes some structural and style changes to the SMTP servers
page to show information in a way that doesn't imply that the user has
to take action on it.

I also added an "Edit" link to the "current default configuration"
information section so that users wouldn't have to search through the
list of servers to find the right edit link..

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)

- Go to Administration -> SMTP servers.
- If necessary, add multiple SMTP servers:
  - One in debug mode
  - One which isn't in debug mode
  - One which is the default
- Confirm that the list of SMTP servers looks good and that it's still
  easy to tell which servers are in debug mode and which is the default.
  - Confirm that the new "Edit" link in that area works correctly.
- Confirm that the display of the current default configuration looks
  good.
  - Test how this information looks when editing an existing server.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6babf9371e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:52 +01:00
Jake Deery 8c312bbe8a
Bug 37360: (follow-up) added bool type to modborrowers
This follow-up patch adds a bool type to modborrowers, so that the
options can be translated within the template files.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 59563159be)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:51 +01:00
Jake Deery d235c57e83
Bug 37360: Add protected as a borrower mod option
This patch adds protected status as a batch borrower modification
option, if the user performing the modification is a superlibrarian.

TO TEST:

a)  login as a superlibrarian
b)  attempt to batch modify these k.t.d user barcodes:
    1)  23529000035676
    2)  23529001000463
    3)  23529000050113
c)  notice that there is no protected option
d)  APPLY PATCH
e)  repeat step b
f)  notice that protected is now an option
g)  set all borrowers to protected (yes)
    1)  notice that the status has changed, in each individual user
	record
h)  set all borrowers to unprotected (no)
    1)  notice that the status has changed, in each individual user
	record
i)  set the proctedted status back to yes, but also set some other
    random options (e.g. city to Cork)
    1)  notice that the city and protected status are both updated
j)  use the disabled checkbox next to protected
    1)  notice that this always sets the protected status to zero
k)  SIGN OFF

Signed-off-by: Catrina <catrina@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ea156c99b8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:51 +01:00
Caroline Cyr La Rose afa1390c92
Bug 38611: Change 'Staff' to 'Staff interface' in HTML customization locations
This patch changes the HTML customization location group 'Staff' to
'Staff interface' to make it less ambiguous for translation.

To test:
1. Go to Tools > HTML cutomizations > New entry
2. Look at the possible locations
   --> Note that there are two groups, OPAC and Staff
3. Apply patch
4. Refresh the page and open the drop-down again
   --> The groupings are now called OPAC and Staff interface

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 480bb45281)
2025-02-13 10:04:50 +01:00
Tomas Cohen Arazi 8bef4aa38f
Bug 38726: (follow-up) Some more {Mm}arc ordering cases
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f50978c256)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:50 +01:00
Tomas Cohen Arazi 22baa957f8
Bug 38726: Fix marc vs. MARC in admin-home.tt template
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4696d31441)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:49 +01:00
Owen Leonard 0b76ccdf01
Bug 38701: Fix HTML validity errors in invoice template
This patch makes some markup corrections to acqui/invoice.tt so that it
passes an HTML validity check.

- Moves incorrectly placed </td>
- Change <span> to <div> and remove invalid </br>
- Correct instances of "<th class="replacementprice"/>" (th cannot be
  self-closed)
- Add id attribute to inputs to correspond to existing labels
- Change "all_fund_dropdown" markup so that it validates but still works
  with the active/inactive fund display.

To test, apply the patch and go to Acquisitions -> Invoices. Perform an
invoice search which will return results. In the results click the
invoice number to view the invoice.

- Test the "show inactive" checkbox corresponding to the "Shipping fund"
  dropdown. Checking and unchecking it should work correctly to show and
  hide inactive funds.
- Run the page source through https://validator.w3.org and confirm that
  there are no errors coming from this template.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 79109af571)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:49 +01:00
Martin Renvoize 4fbc783947
Bug 38521: (follow-up) Update heading level
It became apparent to me that we weren't following best practice for
working up headings levels on this page whilst reviewing this bug.

This patch updates the 'Reports dictionary' section heading to match the
other similar headings on the page from h5 to h2.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 24f86c28cd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:48 +01:00
Andrew Fuerste Henry f330b27d69
Bug 38521: Add classes to reports homepage
To test:
1 - inspect the page, see lack of distinct classes on separate sets of links
2 - apply patch
3 - reload page, confirm it looks and acts the same
4 - inspect page, confirm classes for each set of links

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 731a64d82a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:48 +01:00
Pedro Amorim 75893b2710
Bug 38675: Add correct dropdown item class
Test plan:
1) Install at least 2 ILL backends, i.e.:
  https://github.com/PTFS-Europe/koha-ill-backend-plugin/releases/tag/v2.0.5
  https://github.com/PTFS-Europe/koha-ill-reprintsdesk/releases/tag/rc-v3.0.1
2) Enable ILLModule. Create a regular 'Standard' ILL request:
  <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Pick a type, add '42' (default koha admin user on k-t-d) to cardnumber and pick a library. Click 'Create'.
4) Look at the top toolbar buttons. Click the 'Switch provider' button. You should see 'ReprintsDesk' and 'PluginBackend', but the styling is wrong.
5) Apply patch. Repeat.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6adf023988)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:47 +01:00
Lucas Gass 1f7127bf67
Bug 38367: Fix offset on plugin-dsiabled.tt
To test:
1. Go to your koha-conf.xml and turn plugins off: <enable_plugins>0</enable_plugins>
2. Go to Administration -> Plugins
3. The text is not correctly offset. ( Bootstrap class is col-sm-offset-3 and should be offset-sm-3 in Bootstrap 5  )
4. APPLY PATCH
5. Try again, the offset should look right.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 19d028ce77)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:47 +01:00
Matt Blenkinsop e2e9b90608
Bug 38422: Allow plugin cover images in OPAC lists
This patch updates the template to allow cover images from plugins in the OPAC list page. It adds a data-isbn and data-title attribute to the cover images element and also moves the element below the setting of the title so that we can pass that directly.

It also adds the script call to allow the plugin method to work on the page

Test plan:
1) View the patch diff and note that the data attributes have been added correctly
2) View the patch diff and note that the <a> tag has been moved below the setting of the img_title template variable
3) View the patch diff and note that the CoverImagePlugins variable has been set correctly (compare to the intranet file detail.tt for reference if needed)
4) Confirm that no changes have been made to any elements beyond adding the data attributes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54e393d770)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:46 +01:00
Owen Leonard 2c7bfbba8e
Bug 37634: Missing "USE Koha" causes JS errors and missing "Last patron" menu
This patch adds "[% USE Koha %]" to templates which lack it. Without
this, the "Last patron" menu item doesn't work and will cause a JS error
on many pages. The patch also removes some USE entries which were
duplicates.

To test, apply the patch and test all 176 different pages to confirm
they all work correctly. I mean, maybe. Or maybe sample a few to confirm
they work?

- Go to Administration -> System preferences and enable "showLastPatron"
- If the preference was not enabled, you probably need to go to
  Circulation and open a patron account for checkout so that there is a
  "last patron" to show.
- Test a sampling of pages affected by this patch:
  - Acquisitions -> Acquisitions home page
  - Administration -> Cities and towns
  - Catalog -> Item search
  - Cataloging -> Label creator
  - Patrons -> Patron account -> Set permissions
  - Reports -> Items lost
  - Serials -> Serials home page
  - Tools -> Calendar
- Pages which had duplicate lines (not necessarily "USE Koha"):
  - Acquisitions -> Vendor -> Receive shipments
  - Administration -> Manage jobs
  - Administration -> Record overlay rules
  - Catalog -> Search results
  - Catalog -> Bibliographic detail page -> Items
  - Circulation -> Holds queue
  - Patrons -> Patron detail page -> Accounting -> Transactions tab
  - Serials -> Subscription details -> Create/edit routing list
  - OPAC -> Search results -> Request article

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 210b93abac)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:46 +01:00
Owen Leonard ff400e8e89
Bug 38350: Fix style of sidebar form clear buttons
This patch fixes markup and CSS for sidebar form which contain a submit
button and a clear button. The submit button is supposed to be wider
than the clear button for visual emphasis.

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

- Go to Patrons and confirm that the sidebar filter form looks correct.
  If necessary, resize your browser window to confirm that the "Search"
  button expands as the page gets wider. Confirm that the clear button
  works as expected.
- Perform the same tests on these pages:
  - Acquisitions -> Vendor -> Receive shipments
  - ILL requests
  - Guided reports -> Saved reports

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f41bc1160e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:45 +01:00
Brendan Lawlor c0f72df9ff
Bug 38649: Fix autocheckout for circulation Fast Add only
In addition to checking the referrer for the URL domain and path
we should also check the query string of the referrer to make sure
it was from a circulation fast add.

It should include frameworkcode=FA&circborrowernumber

To test:
1. From anywhere on the additem.pl page where you are adding or editing an item
2. Click on Checkout in the menu bar and enter a patron's barcode
3. When circulation.pl loads it triggers a blank issue slip to be printed
4. Apply patch and repeat steps 1-3, no slip is triggered to print
5. Go to Circulation Checkout for a patron and enter a non existing barcode like 1337
6. Click '+ Add record using fast cataloging'
7. Fill in required fields and click 'Add item'
8. Confirm the item is auto checked out

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 431109830c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:44 +01:00
Jonathan Druart 16f7ffd1c4
Bug 38465: (bug 36454 follow-up) Fix curbside pickup's patron autocomplete
js-date-format.inc already include those 2 JS files. If had them in
curbside pickups template because it was the first using dayjs.
Now it's included in js_includes.inc.

Test plan:
Configure curbside pickup for your library and go to circ/curbside_pickups.pl
Last tab, search for a patron
Without this patch you get a JS error:
 Uncaught TypeError: m.tz is not a function
With this patch applied the patron autocomplete is fixed

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit decb8780ac)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:44 +01:00
Fridolin Somers efa22a1343
Bug 38653: Remove call on system preference 'OPACLocalCoverImagesPriority'
This is in opac/opac-search.pl a call on system preference
OPACLocalCoverImagesPriority. This preference does not exists elsewhere
and dates back to Koha 3.8 from Bug 1633

This patch removes the call and fixes folding of if.

Check this returns empty : git grep OPACLocalCoverImagesPriority

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bf82831913)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:43 +01:00
Owen Leonard 4af3232d54
Bug 38347: Fix style of sidebar form submit button on bookings to collect page
This patch fixes the markup of the sidebar form on the bookings to
collect page, and adds the correct "btn btn-primary" class to the submit
button.

NOTE: This patch contains indentation changes, so please ignore
whitespace when viewing the diff.

To test, apply the patch and go to Circulation -> Bookings to collect.

In the sidebar form, confirm that the submit button has the same yellow
"primary" style as other submit buttons, and that it fills the width of
the sidebar.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6219271cd0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:43 +01:00
Jonathan Druart 914d772125
Bug 38624: Remove unused browserid_include.js
`git grep browserid_include.js` does not return any results, this file
does not seem to be used anywhere

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8557a5aef1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:42 +01:00
Owen Leonard 33ad30f63e
Bug 38657: Prevent cover image from being from being obscured by the search results toolbar
On the OPAC search results page we're including the Chocolat image
viewer CSS after our global CSS file. This means that rules which
are intended to override the default Chocolat CSS aren't working. The
fix is to move the line which includes the Chocolat CSS.

To test, apply the patch and enable the LocalCoverImages and
OPACLocalCoverImages system preferences.

- If necessary, add a local cover image to a bibliographic record.
- Go to the OPAC and perform a search which will return multiple
  record including the record with the cover image.
- Click the cover image to trigger the image viewer.
- The image viewer should not appear to be "behind" the search results
  toolbar.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9edea9b7a3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:42 +01:00
Lucas Gass ef2a04b437
Bug 38512: Fix display of recalls in items table
1. Turn on  UseRecalls
2. Set circ rules to allow for recalls ( Recalls allowed(total) and Recalls allowed(count))
3. Check something out to a patron, choose a record with multiple items on it
4. With another patron recall the item from the OPAC
5. Choose "Recall next available item"
6. Now go back to the item table and see that all items on the bib say something like: "Recalled by koha (42) on 11/21/2024"
7. APPLY PATCH
8. Do steps 3 - 6 again and now the items should correctly show as available.
9. Place a recall again but choose 'Recall a specific item'.
10. Look at the table again, it should accuretly show the recall in the status column. "recalled by koha (42) on 11/21/2024"
11. Turn off UseRecalls, make sure the table still loads properly.

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 52dd7302d2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:41 +01:00
Owen Leonard 0071c4e736
Bug 38519: Improve contrast of Bootstrap alerts and text background classes
This patch updates staff interface CSS in order to improve visibility
and contrast in Bootstrap alerts and text with background classes.

Some of these changes are made via our custom _variables.scss file which
sets overrides of default Bootstrap classes. I was not able to figure
out a good way to customize the .text-bg-* classes via that method so
I've inserted those changes into staff-global.scss.

The patch also removes our custom .note class because it can be replaced
with .alert.alert-info.

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

- Clear your browser cache if necessary.
- View places where the updated classes can be found:
  - For example: Administration -> Authorized values. Click a
    category which has no saved values, e.g. Asort1. There should be two
    "info" classed alerts: One showing "NOTE: If you changed an
    authorized value..." and one showing "There are no authorized
    values..."
- Other examples of pages which are updated to use "alert alert-info"
  instead of the "note" class:
  - Patron search where the search is limited by permissions, e.g.
    Acquisitions -> Vendor -> Basket -> Add user.
  - Administration -> Search engine configuration: "Warning: Any changes
    to the configuration will only take effect..."
- See also pages where a count of something uses the text-bg-info class:
  - Bibliographic detail page when the record has holds
  - Patron module home page when there are pending modifications
  - Tools home page when there are tags or comments pending approval
  - A patron checkout screen when the Claims tab is present (
    BundleLostValue or ClaimReturnedLostValue prefs are set).

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bffacd5509)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:41 +01:00
Owen Leonard a7746591b9
Bug 38644: Remove CSS rule to hide breadcrumbs in mobile view
I think the original intent was to simplify the mobile view and avoid
offering a menu that was a very small target, but those issues should be
addressed, if necessary, without compromising accessibility. This patch
removes the CSS rule which hides the breadcrumb menu when the screen is
less than 767 pixels wide.

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

- Clear your browser cache if necessary.
- View any page in the OPAC which has a breadcrumbs menu.
- Resize your browser window until it is very narrow to confirm that the
  breadcrumb menu stays visible.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ce6609ff80)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:40 +01:00
Emily Lamancusa d0c60f793b
Bug 38588: (follow-up) OK button needs to resubmit returns.pl
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ee7a4aa4ee)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:39 +01:00
Emily Lamancusa 9a9448b5fd
Bug 38588: Don't generate a second transfer when printing transfer slip
When an item is checked in that should automatically return to its home
branch, AddReturn generates the appropriate transfer. In some cases, the
Print Slip button generates a second transfer, which now causes an
exception to be thrown.

In returns.pl, the op cud-dotransfer is used when a transfer was not
initiated previously and the librarian has confirmed they want to
initiate and send a transfer. The op cud-transfer is used when a
transfer has already been generated and the page needs to send or
cancel the transfer.

This patch updates the op from the modal to ensure that the correct of
the two options is generated according to whether a transfer was already
initiated or not.

To test:
1. Find or create an item that belongs to a branch other than the
   logged-in branch
2. In a new tab, check in the item - this should trigger a Return to
   Home transfer (keep the bib record tab open for later)
3. Click "Print Slip"
--> Internal server error - 'Active item transfer already exists'
4. Apply patch and restart_all
5. Check in item again and cancel the transfer
6. Check in item again to generate new transfer
7. Click "Print Slip"
--> Checkin page loads correctly
--> Refresh bib record and confirm item shows as in-transit
8. Enable syspref ShowAllCheckins
9. Repeat steps 5-7
--> Ensure item displays correctly in checkins table
--> Refresh bib record and confirm item still shows as in-transit
10. Repeat steps 5-7, except this time click "Yes" instead of "Print
    Slip"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
10. Set syspref TransfersBlockCirc to Don't Block, and set
    AutomaticConfirmTransfer to Enable
11. Check in the item again and cancel the transfer
12. Check in the item to generate new transfer
13. Click away from the modal without selecting a response
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
14. Check out the item to a customer
15. Check the item in and click "Yes"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
16. Repeat steps 14-15, clicking "Print Slip" instead of "Yes"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
17. Repeat steps 14-15, clicking away from the modal without selecting a
    response
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b94b6546d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:39 +01:00
Tomas Cohen Arazi 0332618ee9
Bug 38386: Make compare_es_to_db.pl not retrieve the records from ES
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 18c3e26db4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-13 10:04:34 +01:00
Lucas Gass 3b051f362d
Bug 39003: Fix the tab template variable in opac-user.pl
To test:
1. SuspendHoldsOpac to 'allow'
2. Make some holds for a patron
3. Log in as that patron and go to 'Summary'
4. Click the 'Holds' tab
5. No suspend column
6. APPLY PATCH, restart_all
7. Try again, the column should show.
8. Turn off SuspendHoldsOpac, the column should be hidden.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 81446a7ce7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:59:51 +01:00
Emily Lamancusa 6f9e1363a9
Bug 38919: hold-found1 modal needs block class
After the upgrade to Bootstrap 5, modals need either the block or
noblock class in order to be shown. The class was missing from the modal
that appears when an item is checked in after it is already waiting for
a hold.

To test:
1. Place a hold on an item for pickup at the logged-in branch
2. Check in the item and confirm the hold
3. Check in the item again
--> There is no notification that the item is already assigned to a
waiting hold, just a "Not checked out" message
4. Apply patch
5. Navigate away from the page (we can't simply refresh the page because
   we don't want to resubmit the request just yet)
6. Check in the item again
--> A modal appears notifying of the waiting hold

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 747a60f33a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:58:41 +01:00
David Cook 8d3fbe4e1b
Bug 38985: Only test normalized_isbn for OPAC Syndetics covers
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 24b50df7fb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:57:23 +01:00
Lucas Gass 9c08759421
Bug 38985: Add correct check before adding Syndetics covers
To test:
1. Enable Syndetics.
2. Do a search that should turn up Syndetics. ( In k-t-d a search of 'ee' works for me. Turning up biblionumber 55 )
3. Visit the record detail page and notice the Syndetics cover loads.
4. APPLY PATCH
5. Try again, this time the Syndetics covers should load.
6. Since these are now in an include make sure Syndetics covers load on opac results, opac detail, staff results, and staff detail.
7. Try with Syndetics and other cover image services enabled.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 59d48106e9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:57:14 +01:00
Tomas Cohen Arazi 665d5dcc46
Bug 38779: Add built record sources assets on install
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1de253eb50)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:56:03 +01:00
David Cook ee04bdf3d7
Bug 38913: (QA follow-up) test UTF-8 exceptions in large MARC records
MARC records with over 99999 bytes are invalid by spec, and when you use
UTF-8 encoded characters in your MARC records, there is the potential
to generate fatal errors in MARC::File::USMARC when it runs
"marc_to_utf8" from "MARC::File::Encode" during its "decode" operation.

That is, if you MARC::File::USMARC->encode a MARC record
with over 99999 bytes (including a number of UTF-8 bytes), there
is the potential when you run MARC::File:USMARC->decode on that same
data that you'll generate a fatal exception.

The main patch in bug 38913 wraps the function doing the decode,
so that a bad record doesn't crash processing.

Without the patch, this unit test will fail. With the patch, this
unit test will pass.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9d41abc1e7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:52:49 +01:00
Janusz Kaczmarek af06851871
Bug 38913: (bug 38416 follow-up) Elasticsearch indexing explodes with oversized records
After Bug 38416 Elasticsearch indexing explodes with oversized
records, especially with UTF encoded data.

In Koha::SearchEngine::Elasticsearch::marc_records_to_documents a
following snippet has been introduced:

my $usmarc_record = $record->as_usmarc();
my $decoded_usmarc_record = MARC::Record->new_from_usmarc($usmarc_record);

But if $record is oversized (> 99999 bytes), it is OK for MARC::Record
object, but not for $record->as_usmarc. The produced ISO 2709 string
is not correct and hence cannot be properly converted back to
MARC::Record object by new_from_usmarc.

The result in this case can be like:

UTF-8 "\x85" does not map to Unicode at /usr/share/perl5/MARC/File/Encode.pm line 35.

Since it is done without any eval / try, the whole reindex procedure
(for instance rebuild_elasticsearch.pl) is being randomly interrupted
with no explanation.

Test plan:
==========
Hard to reproduce. But the explanation together with discussion in Bug
38416 (from 2024-12-15) explains and justifies the need of this added
eval.

1. Have a standard KTD installation with Elasticsearch.
2. Use the provided test record - add it to Koha with
   ./misc/migration_tools/bulkmarcimport.pl -b -file test.xml -m=MARCXML
   (have patience).
   During load process you should see a message like:
   UTF-8 "\xC4" does not map to Unicode at /usr/share/perl5/MARC/File/Encode.pm line 35.
3. The record should get biblionumber 439. Check in librarian interface with
   http://<your_addreess>:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=439
   that the record has been imported.
   However, you should not be able to make a search for this record.
4. Try to reindex with:
   ./misc/search_tools/rebuild_elasticsearch.pl -b -bn 439
   You should get a message like:
   UTF-8 "\xC4" does not map to Unicode at /usr/share/perl5/MARC/File/Encode.pm line 35.
   Again, no search results.
5. Apply the patch ; restart_all.
6. Repeat reindex with:
   ./misc/search_tools/rebuild_elasticsearch.pl -b -bn 439
   There should be no warning now and you should be able to find the record.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan. Works as advertised.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c7127fabf4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:52:48 +01:00
Tomas Cohen Arazi ce4522db14
Bug 38101: Make ES indexer split big fields into chunks
This patch makes the `_process_mappings()` method split the index values
in the event of them being bigger than the allowed 32766 bytes size.

To test:
1. Have KTD running with ES:
   $ ktd --proxy --es7 up -d
2. Perform a search
3. Pick the first result for edition
4. Find a cool Wiki page with lots of paragraphs
5. Copy all of the paragraphs and put them on a 500$a field for the record.
6. Repeat 2
=> FAIL: The record is not found
7. Reindex manually:
   $ ktd --shell
  k$ perl misc/search_tools/rebuild_elasticsearch.pl --biblios --where "biblionumber=3"  -v -v
=> FAIL: You get something like:
```
[22229] Committing final records...
One or more ElasticSearch errors occurred when indexing documents at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Indexer.pm line 148.
[22229] There were errors during indexing
Record #3 Document contains at least one immense term in field="note.raw" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped.  Please correct the analyzer to not produce such terms.  The prefix of the first immense term is: '[10, 109, 117, 115, 116, 97, 102, 97, 32, 102, 117, 101, 32, 101, 108, 32, 115, 101, 103, 117, 110, 100, 111, 32, 104, 105, 106, 111, 32, 100]...', original message: bytes can be at most 32766 in length; got 32771 (illegal_argument_exception) : max_bytes_length_exceeded_exception (bytes can be at most 32766 in length; got 32771)
[22229] Total 1 records indexed
```
8. Apply this patch
9. Repeat 7
=> SUCCESS: No error!
10. Repeat 2
=> SUCCESS: The record is indexed and can be found!
11. Sign off :-D

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6998f5b7e1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:50:22 +01:00
Tomas Cohen Arazi a4c56630b6
Bug 38101: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 41bc498298)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:50:21 +01:00
Emmi Takkinen d0989f9103
Bug 38935: Actions column not translatable in itemsearch.tt
Column "Actions" was not translatable in itemsearch.tt. This
patch makes column translatable. This also fixes typo in this
columns id.

Test plan:
1. Change language as something else than english.
2. Navigate to "Item search" page and search for items.
=> Note that column "Actions" still reads "Actions"
3. Apply this patch.
4. Make new item search.
=> Column should now have correct translation.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e9fd263f7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:47:12 +01:00
Tomas Cohen Arazi 1abaf3bbe8
Bug 38813: Make the 'curbside pickups' tab display selected if so
This patch fixes a wrong condition check in `usermenu.inc` for
determining if the tab should be active.

It currently checks for `ermview`, probably a copy and paste error.

This patch adds a new `curbside_pickups_view` parameter that is passed
instead.

Note: I tidied the code block I changed, inline to avoid extra commits.

To test:
1. Enable the `CurbsidePickup` system preference
2. Log into the OPAC
=> SUCCESS: There's a 'Curbside pickups' tab
3. Click on the tab
=> SUCCESS: The 'Curbside pickups' section gets displayed
=> FAIL: The tab remains inactive
4. Apply this patch
5. Restart plack:
   $ ktd --shell
  k$ koha-plack --restart kohadev
6. Repeat 3
=> SUCCESS: The 'Curbside pickups' section gets displayed
=> SUCCESS: The tab is rendered as active
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 414f085781)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:46:04 +01:00
Emily Lamancusa c3da280daf
Bug 38155: (QA follow-up) Fix TT filters and scalar context
data-referer is the url for the current search page, to redirect
back after performing the operation. Since it is a url, variables within
this link all need to use the uri filter, not html or KohaDates.

Also specify scalar context when splitting the input parameter to
prevent param in list context warnings.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f01f2b31d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:44:06 +01:00
Brendan Lawlor 95754e9b33
Bug 38155: Fix Acquisitions Reopen selected invoices button
This patch updates the reopen selected invoices link button to use
the form-submit.js method from bug 36246. The link needs to have a single
data-invoiceid parameter, so the js on invoices.tt creates a comma
separated list from the checkboxes.

The list of invoiceid is split into an array in invoice.pl

To test:
1. Add some invoices for a vendor using the 'receive shipments' button
2. Go to Acquisitions->Invoices
3. Select multiple invoices using the checkboxes
4. Click the 'Close selected invoices' button
5. Confirm it works
6. Go to the Closed invoices tab
7. Select multiple invoices using the checkboxes
8. Click the 'Reopen selected invoices' button
9. Confirm it works
6. Confirm reopening individual invoices from the Actions button still works

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8b038c880c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:44:04 +01:00
Brendan Lawlor 06b50565a0
Bug 38155: Fix Acquisitions close selected invoices button
This patch updates the closed selected invoices link button to use
the form-submit.js method from bug 36246. The link needs to have a single
data-invoiceid parameter, so the js on invoices.tt creates a comma
separated list from the checkboxes.

The list of invoiceid is split into an array in invoice.pl

To test:
1. Add some invoices for a vendor using the 'receive shipments' button
2. Go to Acquisitions->Invoices
3. Select multiple invoices using the checkbox
4. Click the 'Close selected invoices' button
5. Confirm it works
6. Confirm closing individual invoices from the Actions button still works

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e15d90563f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:44:01 +01:00
Tomas Cohen Arazi 5a8ebd6951
Bug 38678: Fix wrong attribute mapping in Koha::Old::Biblio
Because the mapping was defined in the wrong direction, it is not
possible to filter results in `GET /deleted/biblios` neither on the
`deleted_on` attribute, or even the fallback to DB fields when mappings
don't exist, on `timestamp`.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/deleted_biblios.t
=> FAIL: A 200 returns a 500 instead
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass, behavior is correct
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5d59ec0baa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:40:55 +01:00
Tomas Cohen Arazi eb14a81d15
Bug 38678: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 51e42cde54)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-02-04 21:40:48 +01:00
Lisette Scheer 5251d89715
Bug 38530: ILL request table won't load
This patch updates the js-patron-format include to show text if the library can't be fetched due to lack of permissions.
To test:
Before applying the patch
1. Create 2 library groups
2. Give both groups the "Limit patron visibility to libraries within this group for members." attribute
3. Assign 1 library to each group.
4. Turn on ILL in the system preferences
5. Create an ILL for a patron in group 1.
6. Create a staff member for the library in group 2 with only the following permissions:
catalogue
ill
list_borrowers
7. Log in as the new staff member.
8. Observe the table never loads.
9. Apply the patch.
10. Refresh the page as the new staff member.
11. Observe the table loads and the patron says "A patron from another library"
12. Log back in as the superlibrarian and confirm you can still see the patron information.
13. Sign off

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a839ff666)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:49 +01:00
Lucas Gass 65c1d6ccf8
Bug 38659: Fix select_manager function when there are no tabs
To test:
1. Have multiple staff you have permissions to be a purchase suggestion
   manager.
2. Make some suggestions.
3. Edit a suggestion, go down to 'Select manager'.
4. Select a new manager, notice the new one name is not populated.
5. Save the record, the manager is not changed to the new one.
6. APPLY PATCH
7. Try again steps 3-6, but this time the manager field should populate
   and the new manager should be saved when you save the suggestion.
8. Go through the test plan on Bug 38183.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2a17ad69ea)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:48 +01:00
Caroline Cyr La Rose d79e07cc87
Bug 38707: Patron restriction types from installer files not translatable
This patch makes translatable the default patron restriction
types that come installed with Koha.

To test:

1) Search for "Manual restriction" in the translation files

`git grep "Manual restriction" misc/translator/po/fr-CA-installer.po`

--> No results

2) Apply patch

3) Update translations

`gulp po:update --lang fr-CA`

4) Repeat step 1

--> Manual restrictions (as well as the other restriction types
    i.e. Overdues, Suspension, Discharge, and Notice failure
    suspension) is in the .po file

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d350979d6b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:47 +01:00
Nick Clemens b87e8393b3
Bug 38382: Fresh connection when connexion CSRF token expires
This patch simply generates a new user agent when reauthenticating when the CSRF token
for the session has expired.

To test:
1 - Edit Koha/Token.pm, line 275
from:    { MaxAge => $params->{MaxAge} // ( CSRF_EXPIRY_HOURS * 3600 ) },
to:      { MaxAge => $params->{MaxAge} // ( CSRF_EXPIRY_HOURS ) },
2 - This will make your CSRF tokens expire after 8 seconds
3 - vim /etc/koha/sites/kohadev/connexion.cnf
4 - Set content:
    host:
    port: 8888
    koha:http://localhost:8081
    log:/var/log/koha/kohadev/connexion.log
    match:ISBN
    user:kohauser
    password:kohapass
    overlay_action:replace
    nomatch_action:create_new
    item_action:always_add
    import_mode:direct
    framework:BKS
    overlay_framework:
    debug:1
5 - Save the sample file from this bug into your kohaclone (or copy and paste into a file your koha test site can reach)
6 - On the command line:
    perl misc/bin/connexion_import_daemon.pl -c /etc/koha/sites/kohadev/connexion.cnf
7 - In another terminal:
    cat bug_33418.test  | nc -v localhost 8888
8 - Successful request
9 - Wait 10 seconds (more than 8 anyways)
10 - Repeat 7
11 - Unsuccessful request - Invalid CSRF token
12 - Ctrl+C to stop the connexion daemon
13 - Apply patch
14 - repeat 6
15 - repeat 7, success
16 - Wait more than 8 seconds
17 - repeat 7, success!
18 - repeat again until you are satisfied
19 - Sign off!

WNC amended and tidied

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e758492d99)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:47 +01:00
Jonathan Druart d7c1b03683
Bug 38596: (bug 36640 follow-up): Restore previous order sequence behaviour - OPAC
See commit e76c5c0145
    Bug 36640: Restore previous order sequence behaviour

Test plan:
Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=1
Click on the header to modify the order, click again, then again.
It should always be asc or desc, and you should see the corresponding
arrows.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9fe1563fa0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:46 +01:00
Andrew Fuerste Henry e2617e7174
Bug 38531: add diff when reverting hold
To test:
1 - place, capture, and revert a hold
2 - view action logs for your hold via SQL so you can see the diff column
3 - confirm reversion of waiting hold generates a MODIFY line in logs with no diff
4 - apply patch, restart_all
5 - capture and revert your hold again
6 - confirm logs include diff showing change to found and priority

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d86c662451)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:45 +01:00
Lucas Gass 0b2d31c19c
Bug 37992: Make memberresultst thead sticky
1. Run empty patron search
2. Assuming there are enough results, when scrolling down the #searchheader with "select all" button would get hidden. But no, it's sticky so it follows you and stays visible. This is expected.
3. The table header (thead) with filters for each column is not sticky. This is a regression.
(It was sticky in 23.11, but not anymore in 24.05 and main)
4. APPLY PATCH and regenerate CSS.
5. The thead should again be sticky.
6. Test in at least Chrome and Firefox.

Notes:
-Setting top to 40px, which covers the height of the #searchheader
-To avoid border styles not working with the sticky element I am unsetting border-collapse.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 481f8ce3db)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:45 +01:00
Martin Renvoize 760950253c
Bug 37993: (QA follow-up) Fix tooltip and disabled display
This patch re-arranges the button markup slightly to properly style the
disabled 'Create EDI Order' button when there are no EAN's defined for
the library. It also moves the tooltip to the container btn-group
element to ensure the tooltip works even though the button itself is
disabled.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1c864c5df7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:44 +01:00
Martin Renvoize d32e0c497f
Bug 37993: (QA follow-up) Fix Typo
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 186824d9a6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:43 +01:00
Nick Clemens f422f18102
Bug 37993: (QA follow-up) Add a hint/warning when no EANs are defined
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cc6479735c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:43 +01:00
Nick Clemens 5bca7392bf
Bug 37993: (QA follow-up) Use submit form link asset guideline JS16
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2ce02805b3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:42 +01:00
Matt Blenkinsop fbd09c11ef
Bug 37993: (QA follow-up): Add missing data for breadcrumbs
The vendor name was missing from the breadcrumbs, this patch adds it back in

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 55d7ec38e7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:41 +01:00
Martin Renvoize 4dcaef65ca
Bug 37993: Remove edi_ean page
In the previous patch we replace the only link to the edi_ean selection
page with a select list embedded in the page.  As such, we no longer
need this page at all.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0146359332)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:41 +01:00
Martin Renvoize a7b9e08e02
Bug 37993: Replace edi_ean link with dropdown
The edi_ean page is a slim page with a single select input for selecting
the appropriate library and ean.  This patch replaces the link to that
page with a simple select in the menu on the original page instead.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7454a1d380)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:40 +01:00
Lucas Gass 48a3db2dad
Bug 38429: Add dropdown to Add guarantee button if multiple categories are allowed
To test:
1. Have multiple patron categories that are set to 'Can be guarantee'.
2. Go to a patron record and click '+ Add guarantee'
3. Look at how the patron category is set.
4. It defaults to the first one alphabetically, by code.
5. APPLY PATCH
6. Try steps 1 -2 again, this time you should get a dropdown to pick which category of guarantee you want.
7. Add some patron categories that can be gaurantees with library limitations. Make sure they only show for the correct libraries.
8. Set only patron category to be a gaurantee. The dropdown should now be a button.

Signed-off-by: Laura ONeil <laura@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 264887a87f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:39 +01:00
Mason James 19a379a2e3
Bug 33018: debian package tidy-up (2)
remove unrequired module

	modified:   cpanfile

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7283fa84b9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:39 +01:00
Mason James d913968816
Bug 33018: debian package tidy-up
this patch removes unneeded package dependencies

to test:
 - apply patch
 - build and install koha-common package, note success

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Not tested, I trust Mason to the right thing.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d5ba5c2879)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:38 +01:00
Kyle M Hall 34df58a5b9
Bug 38486: For SIP allow noblock checkouts reguardless of normal patron checkout blocks
The purpose of no block checkouts in SIP is to indicate that the SIP machine has made an offline ( "store and forward" ) transaction.
The patron already has the item. As such, the item must be checked out to the patron or the library risks losing the item do to lack of tracking.
As such, no block checkouts should not be blocked under any circumstances.

The sub C4::SIP::ILS::Transaction::Checkout::do_checkout already honors this, but it is wrapped by
C4::SIP::ILS::checkout which has additional checks that do not.

Test Plan:
1) Apply the unit test patch
2) prove t/db_dependent/SIP/Transaction.t will fail
3) Apply the second patch
4) prove t/db_dependent/SIP/Transaction.t will pass!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4d40fd7ab9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:34 +01:00
Kyle M Hall 5997e2a859
Bug 38486: Fix unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 87cc6a9cc8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:33 +01:00
Fridolin Somers 89c8824408
Bug 38544: OPAC Modal login not generated when OPAC login is disabled
When OPAC login is disabled (system preference opacuserlogin),
the modal login should not exist in HTML.

Note the access to opac-user.pl shows a message and not auth form.

You may look at commit with : git diff --ignore-space-change

Test plan :
1.1) Set system preference opacuserlogin to "Allow"
1.2) Go to OPAC main page
1.3) Check you see in source : div id="loginModal"
1.4) Click on "Log in to your account"
1.5) Check you see the modal login
2.1) Set system preference opacuserlogin to "Don't allow"
2.2) Go to OPAC main page
2.3) Check you do not see in source : div id="loginModal"

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a045ac1e96)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:32 +01:00
Jonathan Druart 07bb1730fc
Bug 38450: Fix some translation pickups
_("This %s is picked").format(foo)
_("This %s is NOT picked".format(bar))

Both constructs are valid, but our translation script does not pick the
second one.

I found very few occurrences (using `git grep '.".format('`) that are
displayed on the UI. I don't have the time right now to deep dive into
the translation script to fix this problem, easier to adjust the
occurrences.

How to prevent that in the future however? We could raise a warning from
the QA script.

Test plan:
Do not apply this patch
Generate the strings (`gulp po:update --lang LANG`)
cd misc/translator/po && git commit -a -m"wip"
Apply this patch, regenerate the strings
cd misc/translator/po && git diff

Notice the changes, you should see new translations added to the .po
files.
Ideally translate them, install the templates and confirm that the new
strings are translated on the UI.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit be6ebd4b9a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:32 +01:00
Jonathan Druart e9d0db48db
Bug 38750: (bug 38385 follow-up) Unblock update process when nothing to do
When we go to installer/install.pl and there is nothing to do we get a "Try again" button and never manage to finish the update.

https://snipboard.io/TplscJ.jpg

Test plan:
Go to installer/install.pl
Login
Click next
=> Without this patch you are stuck with a "Try again" button
=> With this patch applied you get a success screen
 "Everything went okay. Update done."

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 75d9a38805)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:31 +01:00
Matt Blenkinsop df35003e45
Bug 38268: (follow-up) Prevent callbacks from being duplicated
This patch moves the logic up one level into the confirmModal function
to prevent future regressions

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1fc336d6bd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:30 +01:00
Phil Ringnalda 9f41e794d9
Bug 38268: Callers of confirmModal need to remove the modal as the first step in their callback function
Templates that use confirmModal to show a pretty confirm() need to
remove the modal in their callback function, or they are at risk of
having the first callback called for subsequent calls that think they
will get their own callback called. opac-user.tt is already fixed,
opac-shelves.tt is currently affected, and opace-suggestions.tt,
opac-tags.tt, and sco/sco-main.tt are at risk of being affected if
anyone adds another confirmModal caller.

Test plan:
 1. Without the patch, open the OPAC, log in, search for something that
    will return several results
 2. Select all - Add to list - New list
 3. Lists - {your list name}
 4. Click the checkboxes for the first two items
 5. Instead of clicking Remove from list, accidentally click Delete list
 6. In the confirmation popup, realize it was a mistake and click No, do
    not delete
 7. Click Remove from list
 8. Poof, your whole list is gone
 9. Apply patch
10. Repeat steps 1-7, but instead of the whole list being deleted, see
    that only the selected two items were removed
11. Now intentionally click Delete list and click Yes, delete, you'll
    see that it is deleted rather than getting a message about nothing
    being removed like you would have gotten without the patch if you
    started by removing an item
12. On any bib detail page, click Add tag(s) and add one
13. Your account - Tags, check the checkbox for the tag, Remove selected
    tags, Yes, delete tag and verify that it was deleted
14. Purchase suggestions - New purchase suggestion, fill in a title and
    submit your suggestion, click the checkbox for your suggestion,
    Delete selected, Yes, delete suggestion and verify it was deleted
15. In the staff interface, find and copy the barcode for any item that can
    be checked out, then go to /cgi-bin/koha/sco/sco-main.pl with the
    OPAC hostname and port, not the staff, and log in
16. Paste the barcode in the input, click Submit, then click Finish, and
    in the confirmation popup click Print recept and end session, and
    verify that it tries to print

Sponsored-by: Chetco Community Public Library
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6b470caa92)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:29 +01:00
Owen Leonard eef1c7ea99
Bug 31450: Make additional contents publication date required
HTML customizations and news will not display without a publication
date, so we should make it required. This patch adds client-side
validation of the field to check that it's filled.

To test, apply the patch and go to Tools -> News (or HTML
customizations, or Pages).

- Click "New entry"
- Try to submit this new entry without entering a publication date.
- You should be prevented from submitting the form.
- Fill in the publication date and confirm that the form submits
  correctly.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1b1e96a17c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:28 +01:00
Owen Leonard 346ad1746a
Bug 38683: OPAC cover images are only shown on fist result page
This patch corrects the OPAC search results template so that cover
images will be added on more than just the first page of results.

To test, apply the patch and enable a cover image system preference e.g.
OPACAmazonCoverImages. Perform a search in the OPAC which will return
multiple pages of results. Page through several pages of results to
confirm that cover images appear on each page.

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 57a068ca6f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:28 +01:00
Mathieu Saby bbe88ece22
Bug 32722: Make several subfields and a field non mandatory in default UNIMARC biblio framework
801 should not be mandatory except in data exchange context (IFLA Manual)
In UNIMARC several subfields are mandatory only if the field is used.
This possibility is not available in MAR21, and Koha is currently not
able to manage this information in a useful way : it blocks the
validation of a record if the mandatory subfield is void, regardless
of the mandatory status of the field.
In consequence those subfields must be declared non mandatory in default framework.

Test plan:

1/ Open a UNIMARC Koha without patch. Try to create a record with
minimal information : 200$a and 100$a. A lot a alerts are displayed,
preventing Koha to add the record
2/ Apply the patch
3/ Run reset_all or restart KTD (to remake a fresh koha from scratch)
4/ Try to create a record with minimal information : 200$a and a 100$a.
There should only be 2 alerts, regarding 099$t and 942$c field.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 30a1c4bb45)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:27 +01:00
Martin Renvoize db4393f69d
Bug 38070: Revert class change so notices print one per page
This patch reverses the bootstrap 5 find and replace for the 'message'
class.

In this file the message class didn't refer to the bootstrap themeing
but rather is used for applying `page-break-after: always` to these
elements.

Test plan
1) Line up some print notices
2) Run gather_print_notices.pl with html file output
3) Open the output file
4) Print the page to invoke the page break css
5) Note that with the patch each notice is on it's own page, without the
   patch all the notices run one after the other on the same page.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5089f6672a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:26 +01:00
Lucas Gass bbd68caf02
Bug 38452: Use lc() for case insensitivity
To test:
1. Create an item give it a barcode like 'abc123';
2. Try creating a 2nd item with a barcode: 'ABC123', you get an error 'Error saving item: Barcode must be unique.'
3. Checkin the item 'ABC123', the 'abc123' item successfully checks in.
4. The case doesn't seem to matter elsewhere in Koha ( check-in, checkout, searching, batch tools )
5. Try the inventory tool and use 'ABC123'. The barcode is not found.
6. APPLY PATCH, restart_all
7. Try the inventory tool again with both 'abc123' and 'ABC123', they should now both work.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 70ea004f02)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:20 +01:00
Paul Derscheid 4fec57bf41
Move 241101000.pl into db_revs and set execute bit
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-14 13:48:30 +01:00
Paul Derscheid 61b23b91b7
Correct layout for updated release notes for 24.11.01 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-10 11:36:23 +01:00
Paul Derscheid 413934601d
Update release notes for 24.11.01 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-06 13:51:19 +01:00
Paul Derscheid 74cf5110e9
Increment version for 24.11.01 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-06 13:42:01 +01:00
Paul Derscheid 6ddf187a57
Merge remote-tracking branch 'upstream/24.11.x' into 24.11.x-security
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-06 13:38:40 +01:00
David Cook 852254b3cc
Bug 38470: Add missing double quotes to some Javascript
This change adds some double quotes where quotes were missing,
and replaces single quotes with double quotes, which prevents XSS.

Test plan:
0. Apply the patch
1. Create a subscription
2. Using the ID from the subscription, go to this page:
http://localhost:8081/cgi-bin/koha/serials/subscription-detail.pl?
print_routing_list_issue=1&subscriptionid=<SUBSCRIPTIONID>

3. Note that you're able to generate a print slip
(You may need to allow popups)

4. To check the security vulnerability is fixed, try the proof-of-concepts
attached to the bug report

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-05 20:04:19 +01:00
David Cook ef9053aae2
Bug 38468: Add double quotes to some template strings
This change adds double quotes to some template strings where
quotes are missing all together or single quotes are used incorrectly.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test
2. Click on "Gairm"
3. Use the search result navigation box to go to the next result
   On the left of the page. Just bellow the breadcrumb and
   left of the record title.
4. Note that everything loads correctly

5. To test that the security hole has been fixed, try some of the
proof-of-concept attacks provided for biblionumber and searchid

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-05 20:04:08 +01:00
David Cook e779a5d760
Bug 37727: Prevent CSV Formula injection via DataTables
This change prevents CSV Formula injection on DataTables exports
by escaping formula with a single quote prefix as per OWASP recommendations.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl
?op=edit_form&destination=circ&borrowernumber=51
2. Add the following in a "Circulation note"
=SUM(1+1)
3. Go to http://localhost:8081/cgi-bin/koha/members/member.pl
?quicksearch=1&circsearch=1&searchmember=koha
4. Click "Export" and choose "Excel" and "CSV"
5. Open those downloaded files in Excel
6. Note that the =SUM(1+1) function is prefixed with a single quote,
and is not automatically executed

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. The problematic "cell" is exported as "'=SUM(1+1)".
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-05 20:03:37 +01:00
Marcel de Rooy cc32488b4a
Bug 38758: Add subtest to Letters.t
Test plan:
Run t/db_dependent/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b2f3f8b6ea4ae63d762dc51274a2b2c4065acdf0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-30 12:22:42 +01:00
Marcel de Rooy 34a01f1894
Bug 38758: Add strftime as TT virtual method
Test plan:
Try things like [% borrower.dateexpiry.strftime('%d-%m-%y') %] in
a notice. Also test datetime fields like borrower.lastseen.
Add locale support with strftime('%d %B', 'nl_NL') etc.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 9a2042c3e9cb975273e6c17e111b4baeb5278006)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-30 12:22:31 +01:00
Paul Derscheid 1846baab52
Bug 38522: DBIC schema update 2024-12-13 12:24:44 +01:00
Andrew Fuerste Henry 47edc459e2
Bug 38522: (follow-up) Edit db_rev and preserve comment
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1a4820322e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 16:37:53 +01:00
Martin Renvoize 0dc6a25738
Bug 38622: Update sample patron data with preferred_name
This patch updates the sample_date, as used in koha-testing-docker, with
the new preferred_name field.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a5e3b45019)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:13:58 +01:00
Paul Derscheid ce331152c0
Revert "Bug 38622: Update sample patron data with preferred_name"
This reverts commit d52992f85c.
2024-12-12 14:13:20 +01:00
Martin Renvoize d52992f85c Bug 38622: Update sample patron data with preferred_name
This patch updates the sample_date, as used in koha-testing-docker, with
the new preferred_name field.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a5e3b45019)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:05:23 +01:00
Owen Leonard 21b90b5ec7
Bug 38620: Remove obsolete reference to hc-sicky on OPAC tags page
This patch removes code intended to include the hc-sticky js library.
hc-sticky is not longer included in Koha.

To test, apply the patch and make sure the TagsEnabled system preference
is turned on.

Log in to the OPAC and go to the tags page. Everything should work
correctly. There should be no errors in the developer console.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4cb222217f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:58 +01:00
Matthias Meusburger 7c367d64b4
Bug 38605: Fix Harvester.pm use of days parameter
Dates were incorrectly handled during the first days of the month because of
the use of non-zero-padded days values.

(t/db_dependent/Koha/OAIHarvester.t failed)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 73fbdbb1f8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:56 +01:00
Emmi Takkinen ce964ef098
Bug 38602: Do not check if columns bookings.creation_date and bookings.modification_date from information_schema
If one has multiple databases in use adding columns
bookings.creation_date and bookings.modification_date is added
just to first updated database and skipped in other updates.
This happens because we check if these columns already exist
in database from information_schema. We should instead make
this check with method column_exists.

To test:
1. Apply this patch.
3. Drop columns bookings.creation_date and bookings.modification_date:
ALTER TABLE bookings DROP COLUMN creation_date;
ALTER TABLE bookings DROP COLUMN modification_date;
2. Revert your database back to version 24.0600028:
UPDATE systempreferences SET value = "24.0600014" WHERE variable = "version";
3. Run updatedatabase.pl.
=> Check that columns were added.

If you happen to have two databases:
1. Check if you have columns in your bookings table:
SELECT DISTINCT TABLE_SCHEMA, TABLE_NAME FROM
INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN
('creation_date', 'modification_date');
=> Note that columns exist only in one of the databases.
2. Make sure you're using database missing columns
from booking table.
3. Apply this patch.
4. Revert back to version 24.0600028.
5. Run updatedatabase.pl
=> Check that columns were now added to database.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a84195d7da)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:51 +01:00
Jonathan Druart 78132e7333
Bug 38595: Fix broken table settings behaviour on some tables at the OPAC
Problem highlighted by bug 38436. There is a JS error on some views
with tables at the OPAC.

  Uncaught TypeError: table_settings.columns is undefined

Test plan:
Go to the 3 views modified by this patch and confirm that the JS error
in the console is gone when this patch is applied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4733ca89a6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:49 +01:00
Jonathan Druart 068b17861c
Bug 38594: Remove unused TablesSettings.GetColumns
This is no longer used, and should not.

Test plan:
  git grep TablesSettings.GetColumns
should not return any results

  git grep GetColumns
should not return results related to this method

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 827126e316)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:48 +01:00
Jonathan Druart a8bebbefad
Bug 38594: Fix table settings on the course reserves tables - OPAC
We are passing the columns settings, but KohaTable is expecting the
table settings.

Test plan:
Hide some columns for the course reserves table at the OPAC
Define a course, add 1+ items
Go to the OPAC, "Course reserves"
Notice that with this patch the columns are correctly hidden by default.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 41c718382c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:46 +01:00
Jonathan Druart 9917aa3f35
Bug 38543: Do not include rowGroup asset files
rowGroup plugin is now part of the datatables.min.js bundle. We no
longer need to include its css and js files, and they no longer exist
anyway!

[2024/11/27 08:52:37] [WARN] File not found : lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css at /kohadevbox/koha/Koha/Template/Plugin/Asset.pm line 107
[2024/11/27 08:52:37] [WARN] File not found : lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js at /kohadevbox/koha/Koha/Template/Plugin/Asset.pm line 84.

Test plan:
Confirm that the checkouts are grouped "today" and "previous" on the
checkout page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b82e00416)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:43 +01:00
Owen Leonard c39a9917ac
Bug 38536: Patrons requesting modifications: Expand correct panel
This patch updates the JavaScript on the patrons requesting modification
page in order to make it work following the upgrade to Bootstrap 5. The
automatic panel expansion is broken.

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

- Log in to the OPAC and submit changes to your personal details.
- Do this again as a different user so that there is more than one
  pending request.
- From the staff interface home page, follow the link for "Patrons
  requesting modifications"
- Upon loading, the "Update patron records" page should automatically
  expand the first panel.
- Locate the patron record for the second of the patrons you requested
  updates for.
- From that patron's detail page, follow the "Review pending
  modifications" link.
- The panel containing that patron's information should expand by
  default.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a42686d891)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:40 +01:00
Katrin Fischer f0775513bc
Bug 38522: DBRev 24.11.00.002
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 855638123e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:38 +01:00
Andrew Fuerste Henry e025474615
Bug 38522: update kohastructure.sql
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 73c7acd33f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:35 +01:00
Andrew Fuerste Henry 44426aab39
Bug 38522: Increase erm_agreements.license_info length
to test:
1- try to save an agreement with 81+ characters in License Info
2- it does not save
3- apply patch, updatedatabase
4- repeat 1, it works!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2512392b2a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:27 +01:00
Jonathan Druart 0a114ddba9
Bug 38476: Make DT 'Configure' button a link
So that we can open in a separate bug using right click.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d53784de3a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:17 +01:00
Matt Blenkinsop 8e79b027db
Bug 38466: Fix error messages in KBART import
Test plan:
1) Download the file attached to this bug and save it as a .txt file
2) In the ERM module, create a local package
3) Go to the local titles page and click Import from KBART file
4) Select your package and the saved file and click import
5) The import will fail with just a console error
6) Apply patch and run a restart_all and a yarn js:build
7) Repeat step 4, it should now display an error saying the file must be either TSV or CSV
8) Convert the file to either of those two formats and repeat step 4
9) The file should now import successfully, with a message saying that there is an additional column "bestppn" that will not be imported

Signed-off-by: msaby <mathsabypro@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 68be4dd747)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:06 +01:00
Lucas Gass d347c26cb4
Bug 38362: Fix printing lists on opac/opac-shelves.pl
To test from the OPAC:
1 - create a list with more than 10 items
2 - print the list -> there is a pagination and that only 10 items
  are printed
3 - Apply patch
4 - print the list again -> every items are being printed

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied: added a few spaces.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8d0e7ff906)
2024-12-12 12:51:58 +01:00
Katrin Fischer 8d8a66d344
Bug 37292: DBRev 24.11.00.001
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c6c3e8f9c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-11 17:31:14 +01:00
Paul Derscheid 9407c76d51
Revert "Bug 37292: DBRev 24.12.00.002"
This reverts commit 0df147125d.
2024-12-11 17:30:46 +01:00
Michał Kula 6cee99c7a0
Bug 37393: fix "In bundle:" link not showing for items in staff interface
The cause was erroneous check `[% IF bundlesEnabled %]` before the parent bundle information is requested+shown. The `bundlesEnabled` variable checks if the current biblio ITSELF is of collection type, so should only be used for whether to show the button to add new items to the bundle items, NOT for querying whether current item is part of a bundle, as the items that make up the bundle aren't of collection type themselves.

The second fixed problem was that `bundle_host` didn't contain `.biblio` subitem (which'd contain the actual host biblio title) as the JavaScript code assumed, and it wasn't possible to request it with the API either.

Test plan: please follow the reproduction instructions from bug and ensure that the described issue is gone.

If you run into an error 400 on the detail page, you need to refresh API definitions, in kts shell you'drun:

redocly bundle --ext json api/v1/swagger/swagger.yaml --output api/v1/swagger/swagger_bundle.json
koha-plack --restart kohadev

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7df4eda9ec)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 16:59:15 +01:00
Phil Ringnalda f715a2078e
Bug 37293: MARC bibliographic framework text for librarians and OPAC limited to 100 characters
The database columns for liblibrarian and libopac in marc_tag_structure and
marc_subfield_structure are 255 characters, but the HTML maxlength in
/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt and
/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt
limit tags to 100 characters and subfields to 80 characters.

Test plan:
 1. Apply patch, restart_all
 2. Administration - MARC bibliographic framework - for Default, Actions -
    MARC Structure
 3. For the 000 tag, Actions - Edit tag
 4. In both the "Description in staff interface" and "Description in OPAC"
    paste the 255 character string

1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 12

    and click Save changes
 5. Verify that the display shows all 255 characters, then Actions - Edit tag
    and verify that the two inputs reloaded with all 255 characters, and that
    you cannot type a 256th character, then click Cancel
 6. For the 000 tag, Actions - Edit subfields
 7. Paste the same string in both the staff interface and OPAC inputs, Save
    changes, verify that all 255 characters show, click Edit subfields, verify
    that all 255 characters reloaded in the inputs, verify that you cannot
    type a 256th character

Sponsored-by: Chetco Community Public Library
Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a9044f4b34)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 16:14:02 +01:00
Katrin Fischer 0df147125d
Bug 37292: DBRev 24.12.00.002
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c6c3e8f9c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 15:25:53 +01:00
Tomas Cohen Arazi 9def7d040c
Bug 37292: Add an index on oauth_access_tokens.expires
This patch adds a needed index to the column.

To test:
1. On a fresh KTD, run:
   $ ktd --shell
  k$ koha-mysql kohadev
   > SHOW CREATE TABLE oauth_access_tokens;
=> FAIL: There's no 'KEY' entry for the `expires` column
2. Apply this patch
3. Run:
  k$ updatedatabase
=> SUCCESS: A message tells the index was added
4. Repeat 1
=> SUCCESS: The index was actually added to the DB
5. Run:
  k$ reset_all
6. Repeat 1
=> SUCCESS: The index is created at install time too!
7. Run:
  k$ updatedatabase
=> SUCCESS: Nothing explodes, no message about index being created
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e63ece6ae)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 15:25:41 +01:00
Emmi Takkinen fe6ce9642a
Bug 31470: Do not change relationship value when adding a patron guarantor
Adding new id "relationship" led to unexpected behaviour
in relationship handling. If one edits patron with
non-patron guarantor and added patron guarantor, non-patron
guarantors relatioship field was set as empty value which is
first option on select field. This patch removes code which
sets relationship select field to use first value of option
automatically when patron guarantor is added.

Also thi patch add missing id to mandatory relatioship field.

To test:
1. Add or edit patron.
2. Add non-patron guarantor for patron and select some value
as their relationship.
3. Then add a patron guarantor.
=> Note that non-patron guarantors relationship is empty.
4. Apply this patch.
5. Repeat steps 1 to 3.
=> Relationship shouldn't change.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit efaa21c80d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 10:23:48 +01:00
Emmi Takkinen 417e051944
Bug 31470: Add id "relationship" to memberentrygen.tt, change id "relationship" in auth-finder-search.inc
In members.js line 112 variable guarantor_relationship is selected
with id "relationship". However id "relationship" is used in
auth-finder-search.inc, not in memberentrygen.tt.

One way to see what kind of effect incorrect selector has (and how I
originally stumbled into this), is to add into "IntranetUserJS" a line
which changes non-patron guarantors relationship default selected value
as other than empty. Script has to change "relationship" instead of
"new_guarantor_relationship" because selector input for patron
guarantors relationship actually uses default selected value from
non-patron guarantors relationship.

This patch changes two things. Firstly it adds id "relationship" to
memberentrygen.tt so that member.js can fetch correct value
to variable guarantor_relatioship. Secondly it changes id "relationship"
in auth-finder-search.tt as "special_relationship" to avoid confusion.

To test memberentrygen.tt:
1. Make sure you have some value(s) in syspref "borrowerRelationship"
   e.g. "guarantor".
2. Add following line to "IntranetUseJS": $('.relationship
   option:eq(1)').attr('selected', 'selected');
3. Add guarantee patron and note that non-patron guarantors relationship
   is now "guarantor".
4. Add patron guarantor and note that relationship value is empty.
5. Apply this patch and refresh page.
6. Repeat step 4.
   => Note that now relationship value is "guarantor".

To test auth-finder-search.inc:
1. Add authority e.g. Chronological Term
2. Modify field 551$a, click "Tag editor" icon from right
3. Searc pop-up is opened.
   => Make sure that field "Special relationship" is highlighted when
      you hover mouse over label.
   => Make sure that after performing a search, search value in
      "Special relationship" field persists.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a605c070c7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 10:23:33 +01:00
Paul Derscheid 3878fb7e01 Revert "Bug 31470: Add id "relationship" to memberentrygen.tt, change id "relationship" in auth-finder-search.inc"
This reverts commit 5229252af2.
2024-12-10 10:13:44 +01:00
Paul Derscheid 1dc5ccfe15 Revert "Bug 31470: Do not change relationship value when adding a patron guarantor"
This reverts commit 88c4e486ca.
2024-12-10 10:13:27 +01:00
Emmi Takkinen 88c4e486ca Bug 31470: Do not change relationship value when adding a patron guarantor
Adding new id "relationship" led to unexpected behaviour
in relationship handling. If one edits patron with
non-patron guarantor and added patron guarantor, non-patron
guarantors relatioship field was set as empty value which is
first option on select field. This patch removes code which
sets relationship select field to use first value of option
automatically when patron guarantor is added.

Also thi patch add missing id to mandatory relatioship field.

To test:
1. Add or edit patron.
2. Add non-patron guarantor for patron and select some value
as their relationship.
3. Then add a patron guarantor.
=> Note that non-patron guarantors relationship is empty.
4. Apply this patch.
5. Repeat steps 1 to 3.
=> Relationship shouldn't change.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit efaa21c80d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-06 12:45:09 +01:00
Emmi Takkinen 5229252af2 Bug 31470: Add id "relationship" to memberentrygen.tt, change id "relationship" in auth-finder-search.inc
In members.js line 112 variable guarantor_relationship is selected
with id "relationship". However id "relationship" is used in
auth-finder-search.inc, not in memberentrygen.tt.

One way to see what kind of effect incorrect selector has (and how I
originally stumbled into this), is to add into "IntranetUserJS" a line
which changes non-patron guarantors relationship default selected value
as other than empty. Script has to change "relationship" instead of
"new_guarantor_relationship" because selector input for patron
guarantors relationship actually uses default selected value from
non-patron guarantors relationship.

This patch changes two things. Firstly it adds id "relationship" to
memberentrygen.tt so that member.js can fetch correct value
to variable guarantor_relatioship. Secondly it changes id "relationship"
in auth-finder-search.tt as "special_relationship" to avoid confusion.

To test memberentrygen.tt:
1. Make sure you have some value(s) in syspref "borrowerRelationship"
   e.g. "guarantor".
2. Add following line to "IntranetUseJS": $('.relationship
   option:eq(1)').attr('selected', 'selected');
3. Add guarantee patron and note that non-patron guarantors relationship
   is now "guarantor".
4. Add patron guarantor and note that relationship value is empty.
5. Apply this patch and refresh page.
6. Repeat step 4.
   => Note that now relationship value is "guarantor".

To test auth-finder-search.inc:
1. Add authority e.g. Chronological Term
2. Modify field 551$a, click "Tag editor" icon from right
3. Searc pop-up is opened.
   => Make sure that field "Special relationship" is highlighted when
      you hover mouse over label.
   => Make sure that after performing a search, search value in
      "Special relationship" field persists.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a605c070c7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-06 10:31:55 +00:00
1133 changed files with 46937 additions and 11309 deletions

View File

@ -1,25 +0,0 @@
{
"env": {
"browser": true,
"jquery": true
},
"extends": [
"eslint:recommended",
"prettier"
],
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"semi": [
"error",
"always"
]
},
"prettier/prettier": "error"
}

20
.github/workflows/close-pr.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: close pull request
on:
pull_request_target:
types: [opened, reopened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
sparse-checkout: "README.txt"
sparse-checkout-cone-mode: false
- name: close
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.number }}
run: |
gh pr close ${{ env.PR }} --comment "(Automated Close) Please do not file pull requests here, this repo is merely a clone of https://git.koha-community.org/Koha-community/Koha and we use Bugzilla at https://bugs.koha-community.org to submit patches to its codebase.\n\nSee https://wiki.koha-community.org/wiki/Submitting_A_Patch for more information. Note that you can use [`koha-testing-docker`](https://gitlab.com/koha-community/koha-testing-docker) to easily set-up a full development environment, which includes the `git bz` command to easily push your patches with a single command, instead of manually fiddling with patch files!\n\nIf you have any more questions or need help, do not hesitate to ask in our Mattermost chat: https://chat.koha-community.org. Thank you."
gh pr lock ${{ env.PR }}

804
.mailmap
View File

@ -1,390 +1,416 @@
Abby Robertson <abbyrobnz@gmail.com>
Adam Styles <adam.styles@esa.edu.au>
Agustín Moyano <agustinmoyano@theke.io>
Ahmed <ahmed@inlibro.com>
Alan Millar <amillar>
Al Banks <ahbanks>
Albert Oller <ago@bywatersolutions.com>
Albert Oller <ago@bywatersolutions.com> Albert Oller <root@ThinkPad-W520.localdomain>
Alberto Martinez <martinez.alberto@icloud.com>
Aleisha Amohia <aleisha@catalystacademy.net.nz> <aleishaamohia@hotmail.com>
Alexandra Horsman <alex@catalystacademy.net.nz> <dhorsman@xtra.co.nz>
Alex Arnaud <alex.arnaud@biblibre.com>
Alex Arnaud <alex.arnaud@biblibre.com> = <=>
Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com> A. Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
Allen Reinmeyer <allen.reinmeyer@liblime.com> Allen Reinmeyer <acr@arwen.metavore.com>
Ambrose Li <ambrose.li@gmail.com> acli <acli>
Amit Gupta <amit.gupta@osslabs.biz> amit gupta <amit.gupta@osslabs.biz>
Andrew Arensburger <arensb@gmail.com> <arensb>
Andrew Elwell <andrew.elwell@gmail.com> <Andrew.Elwell@gmail.com>
Andrew Fuerste-Henry <andrewfh@dubcolib.org> <andrewfh@dubcolib.org>
Andrew Nugged <nugged@gmail.com>
Antoine Farnault <toins@biblibre.com> <toins>
Arnaud Laurin <alaurin@biblibre.com> <alaurin>
Arnaud Laurin <alaurin@biblibre.com>
Artur Norrby <artur.norrby@gmail.com>
Aude Charillon <aude.charillon@ptfs-europe.com> <aude.charillon@ptfs-europe.com>
Ava Li <rubyli208@gmail.com>
Azucena Aguayo <Azucena.Aguayo@uvu.edu>
Baptiste Bayche <baptiste.bayche@inlibro.com> <baptiste.bayche@inlibro.com>
<bart@catalystacademy.net.nz> <bart.tj@gmail.com>
Barton Chittenden <barton@bywatersolutions.com>
Benedict P. Barszcz <kb2qzv>
Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> <knakk-koha@vagrant-saucy64>
Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> <bensinober@gmail.com>
Bernardo González Kriegel <gonzalez@di.unc.edu.ar> <bgkriegel@gmail.com>
Bernardo González Kriegel <gonzalez@di.unc.edu.ar>
BibLibre Team <koha@biblibre.com> <dev_patches@biblibre.com>
BibLibre Team <koha@biblibre.com>
BibLibre Team <koha@biblibre.com> <root@jbilou.biblibre.local>
Brandon Haveman <brandon_h27@hotmail.com>
Brendan Gallagher <brendan@bywatersolutions.com>
Brendan Gallagher <brendan@bywatersolutions.com> <info@bywatersolutions.com>
Briana Greally <brianagreally@gmail.com>
Brice Sanchez <brice.sanchez@sys-tech.net> <koha-preprod@sys-tech.net>
Brice Sanchez <brice.sanchez@sys-tech.net>
Bruno Toumi <btoumi>
ByWater Solutions Team <staff@bywatersolutions.com>
Caroline Cyr La Rose <caroline@inlibro.com>
Charles Farmer <charles.farmer@inlibro.com>
Charles Farmer <charles@inlibro.com>
Chloe Alabaster <chloealabaster@gmail.com>
Chris Cormack <chris@bigballofwax.co.nz>
Chris Cormack <chris@bigballofwax.co.nz> <chris.cormack@liblime.com>
Chris Cormack <chris@bigballofwax.co.nz> <chris@figwit.metavore.com>
Chris Cormack <chris@bigballofwax.co.nz> <chris@snaga.liblime.co.nz>
Chris Cormack <chris@bigballofwax.co.nz> <crc@arwen.metavore.com>
Chris Cormack <chris@bigballofwax.co.nz> <crc@liblime.com>
Chris Cormack <chrisc@catalyst.net.nz>
Chris Cormack <chrisc@catalyst.net.nz> <chrisc@git.koha-community.org>
Chris Cormack <chris@katipo.co.nz> <chris>
Chris Cormack <chris@katipo.co.nz> <rangi>
Chris Hall <chrish@catalyst.net.nz> <chris.hall@catalyst.net.nz>
Chris Nighswonger <chris.nighswonger@gmail.com> <root@fbcit.campus.foundations.edu>
Chris Nighswonger <cnighswonger@foundations.edu>
Chris Nighswonger <cnighswonger@foundations.edu> <cnighswonger@cnighswonger-dt.(none)>
Chris Nighswonger <cnighswonger@foundations.edu> Koha User <koha@dev.(none)>
Chris Nighswonger <cnighswonger@foundations.edu> <chris.nighswonger@gmail.com>
Christophe Croullebois <christophe.croullebois@biblibre.com>
Christophe Torin <christophe.torin@univ-rennes2.fr>
Claudia Forsman <claudia.forsman@gmail.com>
Colin Campbell <colin.campbell@ptfs-europe.com>
<connor.dewar@catalystacademy.net.nz> <connor.dewar@gmail.com>
Daniel Banzli <daniel.buenzli@erratique.ch>
Daniel Barker <daniel@catalystacademy.net.nz> <daniel.barker.nz@gmail.com>
Danyon Sewell <danyonsewell@catalyst.net.nz> <danyonsewell@catalyst.net.nz>
Darrell Ulm <darrellulm@smfpl.org> Darrell Ulm <darrellulm@kohavmware>
Darrell Ulm <darrellulm@smfpl.org> Darrell Ulm <darrellulm@smfpl.org>
Darrell Ulm <darrellulm@smfpl.org> koha <koha@smfpl.org>
Darrell Ulm <darrellulm@smfpl.org> root <root@newkoha32.local>
David Cook <dcook@prosentient.com.au>
David Gustafsson <glasklas@gmail.com> <root@f1ebe1bec408>
David Schmidt <davewood@gmx.at>
David Schuster <dschust1@gmail.com>
David Strainchamps <lavide>
Dobrica Pavlinušić <dpavlin@rot13.org>
Donna Bachowski <donna@bywatersolutions.com>
Dorian Meid <dnmeid>
doXulting <doxulting>
D Ruth Bavousett <David.Bavousett@liblime.com>
D Ruth Bavousett <dbavousett@ptfs.com>
D Ruth Bavousett <dbavousett@ptfs.com>
D Ruth Bavousett <dbavousett@ptfs.com> <koha-dev@ptfs.com>
D Ruth Bavousett <druthb@gmail.com>
D Ruth Bavousett <jdb@arwen.metavore.com>
D Ruth Bavousett <ruth@bywatersolutions.com>
D Ruth Bavousett <ruth@bywatersolutions.com>
Duncan Tyler <duncan@catalyst.net.nz> <duncan@duncan-SoT.wgtn.cat-it.co.nz>
Elliott Davis <tdavis@uttyler.edu> <root@test.bywatersolutions.com>
Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Emily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
<emma@catalystacademy.net.nz> <emmaheath.student@wegc.school.nz>
Emma Nakamura Smith <emma.nakamura.smith@gmail.com>
Emma Nakamura Smith <emma.nakamura.smith@gmail.com> Your Full Name <your_email>
Emmi Takkinen <emmi.takkinen@outlook.com>
Eric Phetteplace <phette23@gmail.com>
Esther Melander <esther@bywatersolutions.com> <esther@bywatersolutions.com>
Father Vlasie <fv@spots.school>
Fernando Canizo <conan@lugmen.org.ar>
Finlay Thompson <finlay@katipo.co.nz> <finlayt>
<francesca@catalystacademy.net.nz> <francescalamoore@gmail.com>
Francisco M. Marzoa Alonso <fmmarzoa>
Frédéric Demians <f.demians@tamil.fr> <f.demians@tamil.fr>
Frédéric Demians <f.demians@tamil.fr> <frederic@tamil.fr>
Frédéric Demians <f.demians@tamil.fr> <(frederic@tamil.fr)>
Frédéric Durand <frederic.durand@univ-lyon2.fr>
Frédérick Capovilla <frederick.capovilla@libeo.com>
Frédérick Capovilla <frederick.capovilla@sys-tech.net> koha <koha@koha.sys-tech.net>
Frédérick Capovilla <frederick.capovilla@sys-tech.net> preprod34 <preprod34@koha.ccsr.qc.ca>
Frédérick Capovilla <frederick.capovilla@libeo.com> <fredericiapovilla@sys-tech.net>
Frère Sébastien Marie <semarie@latrappe.fr> Frère Sébastien Marie <semarie-koha@latrappe.fr>
Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers <fridolin.somers@biblibre.com> Admin User Koha <koha@localhost>
Fridolin Somers <fridolin.somers@biblibre.com> <fridolyn.somers@biblibre.com>
Fridolin Somers <fridolyn.somers@progilone.fr>
Friedrich zur Hellen <hellen>
Galen Charlton <gmc@esilibrary.com>
Gavin McCullagh <gmccullagh>
Genevieve Plantin <genevieve.plantin@inlibro.com> <genevieve@inlibro.com>
Genevieve Plantin <genevieve.plantin@inlibro.com> <genevieve.plantin@inlibro.com>
Greg Barniskis <gbarniskis@gmail.com>
Gus Ellerm <gel1163@stacmail.net>
Gynn Lomax <gynn@katipo.co.nz> truth_nz <truth_nz>
Hayley Pelham <hayleymapley@catalyst.net.nz>
Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com>
Hebah Amin-Headley <hebah@bywatersolutions.com> <hebah@bywatersolutions.com>
Helene Hickey <hickeyhe@wgc.school.nz>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> hdl <hdl>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> Henri-Damien LAURENT <henridamien@koha-fr.org>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> <root@descartes.biblibre.com>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> <root@henridamienlaurent.dyndns.org>
Hinemoea Viault <hinemoea.viault@inlibro.com> <hinemoea@inlibro.com>
Holger Meißner <holger.meissner@hs-gesundheit.de> <h.meissner.82@web.de>
Holly Cooper <hc@interleaf.ie>
Hugo Agud <hagud@orex.es> Signed-off-by: Hugo Agud <hagud@orex.es>
H. Passini <hpassini>
Ian Walls <hsl@nyumc.org>
Ian Walls <ian.walls@bywatersolutions.com>
Ian Walls <koha.sekjal@gmail.com> <sekjal@Samael.local>
Indranil Das Gupta <indradg@l2c2.co.in> Indranil Das Gupta (L2C2 Technologies) <indradg@l2c2.co.in>
Jake Deery <jake.deery@ptfs-europe.com>
Jake Deery <jake.deery@ptfs-europe.com> PerplexedTheta <jahdobble@llownd.net>
Jake Deery <jake.deery@ptfs-europe.com>
Jane Wagner <jwagner@ptfs.com> <dev2@debKOHA2.corporate.ptfs.com>
Janusz Kaczmarek <januszop@gmail.com>
Jared Camins-Esakov <jcamins@cpbibliography.com> <camins@numismatics.org>
Jared Camins-Esakov <jcamins@cpbibliography.com> <jcamins@bywatersolutions.com>
Jared Camins-Esakov <jcamins@cpbibliography.com> <koha@cpbibliography.com>
Jared Camins-Esakov <jcamins@cpbibliography.com>
Jatara Barnes <jendayi30@gmail.com>
Jérémy Breuillard <jeremy.breuillard@biblibre.com>
Jérôme Charaoui <jcharaoui@cmaisonneuve.qc.ca>
Jérome Vizcaino <plugz>
Jesse Weaver <pianohacker@gmail.com> <pianohacker@gmail.com>
Joe Atzberger <joe.atzberger@liblime.com>
Joe Atzberger <joe.atzberger@liblime.com> <atz4sip@arwen.metavore.com>
Joe Sikowitz <joe@flo.org>
Johan Larsson <johan.larsson@ub.gu.se>
Johanna Räisä <johanna.raisa@gmail.com>
John Copeland <chansey.killer@catalystacademy.net.nz> <chansey.killer@hotmail.com>
John Copeland <spartan0042@catalystacademy.net.nz> <spartan0042@hotmail.com>
Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jono Mingard <jono@catalystacademy.net.nz> <reason.koan@gmail.com>
Jorgia Kelsey <jorgia@catalystacademy.net.nz> <jorgia_m_kelsey@hotmail.com>
Josef Moravec <josef.moravec@gmail.com> kohamaster <preprod@kohaVM>
Joshua Ferraro <jmf@liblime.com> <koha-test@koha.hclibrary.org>
Joshua Ferraro <jmf@liblime.com> <jmf@arwen.metavore.com>
Joshua Ferraro <jmf@liblime.com> <koha-test@koha.hclibrary.org>
Joshua Ferraro <jmf@liblime.com> <joshferraro>
Joshua Ferraro <jmf@liblime.com> <jmf@liblime.com>
Joshua Ferraro <jmf@liblime.com> <koha-pro@koha-01.hclibrary.org>
Joshua Ferraro <jmf@liblime.com> <root@mail.oplin.org>
Joshua Ferraro <jmf@liblime.com> <root@snaga.liblime.co.nz>
Joshua Ferraro <jmf@myacpl.org> <kados>
Joy Nelson <joy@bywatersolutions.com>
Juan Romay Sieira <juan.sieira@xercode.es>
Julian Fiol <julian.fiol@biblibre.com>
Julian Maurice <julian.maurice@biblibre.com> koha <koha@cmspub1.di.u-psud.fr>
Julian Maurice <julian.maurice@biblibre.com> koha <koha@kohaprep1.di.u-psud.fr>
Justin Vos <justinvos@live.com>
<kate@catalystacademy.net.nz> <kate.h@paradise.net.nz>
Katrin Fischer <katrin.fischer.83@web.de> <katrin.fischer@web.de>
Katrin Fischer <katrin.fischer@bsz-bw.de>
Katrin Fischer <katrin.fischer@bsz-bw.de> <Katrin.Fischer@bsz-bw.de>
Katrin Fischer <katrin.fischer@bsz-bw.de> Koha <koha@koha-dev.de>
Kelly McElligott <kelly@bywatersolutions.com>
Kenza Zaki <kenza.zaki@biblibre.com> <root@kenza-VirtualBox>
Kevin Carnes <kevin.carnes@ub.lu.se>
Koha Translators <root@translate.koha-community.org>
Kris Wehipeihana <kriswehipeihana@catalyst.net.nz>
Kyle M Hall <kyle@bywatersolutions.com> <migrations@bywatersolutions.com>
Kyle M Hall <kyle@bywatersolutions.com> <“staff@bywatersolutions.com”>
Kyle M Hall <kyle@bywatersolutions.com> John Doe <you@example.com>
Kyle M Hall <kyle@bywatersolutions.com> koha <koha@false.(none)>
Kyle M Hall <kyle@bywatersolutions.com> koha <koha@localhost.(none)>
Kyle M Hall <kyle@bywatersolutions.com> <koha@mtpl.bywatersolutions.com>
Kyle M Hall <kyle@bywatersolutions.com> <kyle@bywatersolutions.com>
Kyle M Hall <kyle@bywatersolutions.com> <kyle.m.hall@gmail.com>
Lari Strand <lmstrand@gmail.com> <lmstrand@gmail.com>
Larry Baerveldt <larry@bywatersolutions.com>
Laura Escamilla <laura.escamilla@bywatersolutions.com>
Leire Diez <leire@scanbit.net>
Liz Rea <liz@catalyst.net.nz>
Liz Rea <lrea@nekls.org> <liz@nekls.org>
Liz Rea <lrea@nekls.org> <lrea@nekls.org>
Liz Rea <wizzyrea@gmail.com> Liz Rea <wizzyrea@gmail.com>
Liz Rea <wizzyrea@gmail.com> Liz <wizzyrea@gmail.com>
Liz Rea <wizzyrea@gmail.com> root <root@lists.nekls.org>
Liz Rea <wizzyrea@gmail.com> root <root@liz-koha.nekls.org>
Lyon 3 Team <koha@univ-lyon3.fr>
Lyon 3 Team <koha@univ-lyon3.fr> Lyon3 Team <preprod@koha.(none)>
Lyon 3 Team <koha@univ-lyon3.fr> <koha@univ-lyon.fr>
Magnus Enger <magnus.enger@kul.oslo.kommune.no> <digitalutvikling@gmail.com>
Magnus Enger <magnus.enger@kul.oslo.kommune.no>
Magnus Enger <magnus@enger.priv.no>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl> <marcel@libdevelop.rijksmuseum.nl>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl> <M.de.Rooy@rijksmuseum.nl>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl> <root@master.rijkskoha.nl>
Marc Véron <veron@veron.ch>
Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca
Martin Aubeut <martin.aubeut@gmail.com> <martin.aubeut@gmail.com>
Martin Renvoize <martin.renvoize@ptfs-europe.com> <martin@dev1.vm.bytemark.co.uk>
Mason James <mason.james@liblime.com>
Mason James <mason@katipo.co.nz> sushi <sushi>
Mason James <mason@katipo.co.nz> szrj1m <szrj1m>
Mason James <mason@kohaaloha.com>
Mason James <mtj@kohaaloha.com> <mason.loves.sushi@gmail.com>
Mason James <mtj@kohaaloha.com>
Mason James <mtj@liblime.com> <mason@snaga.liblime.com>
Mason James <mtj@kohaaloha.com>
Mason James <mtj@kohaaloha.com> QA Manager <patches@koha.org>
Mason James <mtj@kohaaloha.com> <szrj5m>
Matthias Le Gac <matthias@babel.inlibro.net> matthias le gac <matthias@babel.inlibro.net>
Matthias Le Gac <matthias@babel.inlibro.net> <matthias@babel.inlibro.net>
Matthias Meusburger <matthias.meusburger@biblibre.com>
Maxime Beaulieu <maxime.beaulieu@inlibro.com>
Maxime Beaulieu <maxime.beaulieu@inlibro.com> <mbeaulieu@inlibro.com>
Maxime Pelletier <maxime.pelletier@libeo.com>
Meenakshi R <meenakshi.r@osslabs.biz>
Merllissia Manueli <mel@catalystacademy.net.nz> <manuelimel@gmail.com>
Mengü Yazıcıoğlu <kohadevinim@devinim.com.tr>
Michael Hafen <mdhafen@washk12.org> <mdhafen@tech.washk12.org>
Michel Lerenard <zifox>
Michelle Spinney <mspinney@clamsnet.org> Michelle <mspinney@clamsnet.org>
Mike Hansen <wolfpac444> <wolfpac444>
Mike Mylonas <dragon28@ihug.co.nz> <dragon28>
MJ Ray <mjr@phonecoop.coop>
MJ Ray <mjr@phonecoop.coop> <slef>
Morag Hills <moraghills@catalystacademy.net.nz> <the.invinnysible.one@gmail.com>
Morgane Alonso <morgane.alonso@biblibre.com>
Nahuel Angelinetti <nahuel.angelinetti@biblibre.com>
Nazlı Çetin <nazli@devinim.com.tr>
Nguyen Duy Tinh <duy-tinh.nguyen@biblibre.com>
Nicholas Van Oudtshoorn <vanoudt@gmail.com>
Nick Clemens <nick@bywatersolutions.com> <nick@bywatersolutions.com>
Nick Clemens <nick@bywatersolutions.com> Koha instance kohadev-koha <kohadev-koha@kohadevbox>
Nick Clemens <nick@bywatersolutions.com> root <root@f1ebe1bec40>
Nicolas Morin <nicolas.morin@biblibre.com> <nicolas.morin@biblibre.com>
Nicole C. Engard <nce@kohavm76.liblime.com> <nce@kohavm76.liblime.com>
Nicole C. Engard <nce@liblime.com> <nce@liblime.com>
Nicole C. Engard <nicole@bywatersolutions.com>
Nicole C. Engard <nengard@gmail.com>
Nicole C. Engard <nicole@bywatersolutions.com> <nengard@bywatersolutions.com>
Nicole C. Engard <nicole@bywatersolutions.com> <nce@arwen.metavore.com>
Nicole C. Engard <nicole.engard@liblime.com> <nce@liblime.com>
Nicole C. Engard <nicole.engard@liblime.com> <nicole.engard@liblime.com>
Nuño López Ansótegui <nunyo@masmedios.com> <nunyo@masmedios.com>
Olivier Vezina <olivier.vezina@inLibro.com>
Olwen Williams <olwen@katipo.co.nz> <olwen>
Olwen Williams <olwen@katipo.co.nz> <fisheye>
Owen Leonard <oleonard@myacpl.org>
Owen Leonard <oleonard@myacpl.org> <oleonard>
Owen Leonard <oleonard@myacpl.org> <oleonard@oleonard-desktop.(none)>
Paola Rossi <paola.rossi@cineca.it>
Pat Eyler <pate@eyler.org> <pate>
Paul Poulain <paul.poulain@biblibre.com>
Paul Poulain <paul.poulain@biblibre.com> <paul@localhost.(none)>
Paul Poulain <paul.poulain@biblibre.com> <paul@koha-fr.org>
Paul Poulain <paul.poulain@biblibre.com> <tipaul>
Pawel Skuza <pawelzc>
Petter Goksøyr Åsen <petter.goksoyr.asen@kul.oslo.kommune.no> <boutrosboutrosboutros@gmail.com>
Petter Goksøyr Åsen <petter.goksoyr.asen@kul.oslo.kommune.no>
Philippe Audet-Fortin <philippe.audet-fortin@inlibro.com>
Philippe Blouin <philippe.blouin@inlibro.com>
Philippe Blouin <blou@inlibro.com>
Pierre Cauchois <cauchoip>
Pierrick Le Gall <pierreck@ineo.com> <plg>
Polytechnic University Koha Installation <poly-pro@builder.(none)>
Pongtawat Chippimolchai <pongtawat@punsarn.asia>
Rachel Hamilton-Williams <rachel@katipo.co.nz> <rachelkatipo>
Radek Šiman <radek.siman@centrum.cz>
Raewyn Adams <raewyn.adams@bopdhb.govt.nz>
Remi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com>
Richard Anderson <ri_chard>
Robert Lyon <bob_lyon@katipo.co.nz> <bob_lyon>
Robin Sheat <robin@catalyst.net.nz>
Rochelle Healy <rochelle@catalystacademy.net.nz> <Rochelle_healy@hotmail.com>
Roger Buck <saas>
<romanwilton@catalystacademy.net.nz> <romanwilton@gmail.com>
Russel Garlick <russel.garlick@liblime.com> <russel@ahinui.local>
Ryan Higgins <rch@balrog.liblime.com> <rch@false.(none)>
Ryan Higgins <rch@liblime.com> <rych>
Sabrina Kiehl <kiehl@mpis.mpg.de> <kiehl@mpis.mpg.de>
Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>
Sally Healey <sally.healey@cheshiresharedservices.gov.uk>
Salman Ali <salman.ali@inLibro.com>
Sam Sanders <sam-sanders@catalystacademy.net.nz> <sam-sanders@live.com>
Samuel Crosby <scrosby000@gmail.com>
Savitra Sirohi <savitra.sirohi@osslabs.biz>
Serge Renaux <sergerenaux>
Séverine Queune <severine.queune@bulac.fr>
Séverine Queune <severine.queune@gmail.com>
Shaun Evans <shaunevans>
Shi Yao Wang <shi-yao.wang@inlibro.com>
Shi Yao Wang <shiyao@inlibro.com>
Silvia Simonetti <s.simonetti@cineca.it>
Simith D'Oliveira <simith@inlibro.com>
Simon Blake <simon@katipo.co.nz> <simon>
Sonia Lemaire <sonia.lemaire@biblibre.com>
Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Srdjan Janković <srdjan@catalyst.net.nz>
Stan Brinkerhoff <stan@brinkerhoff.org> <stan@brinkerhoff.org>
Stan Brinkerhoff <stan@brinkerhoff.org> <stan@koha-dev.hsd1.vt.comcast.net>
Stéphane Delaune <stephane.delaune@biblibre.com>
Stephen Hedges <shedges@myacpl.org> <shedges>
Steve Tonnesen <tonnesen>
Stina Hallin <stina.hallin@ub.lu.se> <stina.hallin@ub.lu.se>
The Minh Luong <theminh@inlibro.com>
The Minh Luong <the-minh.luong@inlibro.com>
Thibaud Guillot <thibaud.guillot@biblibre.com>
Thomas Dukleth <git@agogme.com> <git@agogme.com>
Thomas Dukleth <git@agogme.com> <thd>
Thomas Wright <thomasw@catalystacademy.net.nz> <tomsStudy@gmail.com>
Todd Goatley <tgoatley@gmail.com>
Tomás Cohen Arazi <tcohen@psi.unc.edu.ar>
Tomás Cohen Arazi <tomascohen@unc.edu.ar>
Tomás Cohen Arazi <tomascohen@theke.io> <tomascohen@gmail.com>
Tomás Cohen Arazi <tomascohen@theke.io>
<tom@catalystacademy.net.nz> <thomas.houlker@hibs.school.nz>
Tümer Garip <tgarip1957>
Victor Grousset <victor@tuxayo.net>
Vitor Fernandes <vfernandes@keep.pt>
Wajasu <matted-34813@mypacks.net>
Waylon Robertson <genji@katipo.co.nz> <genjimoto>
Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
Zeno Tajoli <z.tajoli@cineca.it> <tajoli@cilea.it>
Zeno Tajoli <z.tajoli@cineca.it> <zeno@mail.cile>
Zeno Tajoli <z.tajoli@cineca.it> <ztajoli@gmail.com>
Сергій Дубик {Serhij Dubyk} <serhijdubyk@gmail.com>
शंतनू {Shantanoo} <shantanoo@gmail.com>
American Numismatics Society <sponsor> America Numismatic Society <sponsor>
Association KohaLa <sponsor> Association KohaLa - https://koha-fr.org/ <sponsor>
<bart@catalystacademy.net.nz> <bart.tj@gmail.com>
<connor.dewar@catalystacademy.net.nz> <connor.dewar@gmail.com>
<emma@catalystacademy.net.nz> <emmaheath.student@wegc.school.nz>
<francesca@catalystacademy.net.nz> <francescalamoore@gmail.com>
<kate@catalystacademy.net.nz> <kate.h@paradise.net.nz>
<romanwilton@catalystacademy.net.nz> <romanwilton@gmail.com>
<tom@catalystacademy.net.nz> <thomas.houlker@hibs.school.nz>
Abby Robertson <abbyrobnz@gmail.com>
Adam Styles <adam.styles@esa.edu.au>
Agustín Moyano <agustinmoyano@theke.io>
Ahmed <ahmed@inlibro.com>
Al Banks <ahbanks>
Alan Millar <amillar>
Albert Oller <ago@bywatersolutions.com>
Albert Oller <ago@bywatersolutions.com> Albert Oller <root@ThinkPad-W520.localdomain>
Alberto Martinez <martinez.alberto@icloud.com>
Aleisha Amohia <aleisha@catalystacademy.net.nz> <aleishaamohia@hotmail.com>
Alex Arnaud <alex.arnaud@biblibre.com>
Alex Sassmannshausen <alex.sassmannshausen@openfifth.co.uk> <alex.sassmannshausen@ptfs-europe.com>
Alexandra Horsman <alex@catalystacademy.net.nz> <dhorsman@xtra.co.nz>
Allen Reinmeyer <allen.reinmeyer@liblime.com> Allen Reinmeyer <acr@arwen.metavore.com>
Ambrose Li <ambrose.li@gmail.com> acli <acli>
Amit Gupta <amit.gupta@osslabs.biz> amit gupta <amit.gupta@osslabs.biz>
Andrew Arensburger <arensb@gmail.com> <arensb>
Andrew Auld <andrew.auld@openfifth.co.uk> <andrew.auld@ptfs-europe.com>
Andrew Auld <andrew.auld@openfifth.co.uk> <andrew.auld@openfifth.co.uk>
Andrew Elwell <andrew.elwell@gmail.com> <Andrew.Elwell@gmail.com>
Andrew Fuerste-Henry <andrew@bywatersolutions.com> <andrew@bywatersolutions.com>
Andrew Fuerste-Henry <andrewfh@dubcolib.org> <andrewfh@dubcolib.org>
Andrew Isherwood <andrew.isherwood@openfifth.co.uk> <andrew.isherwood@ptfs-europe.com>
Andrew Nugged <nugged@gmail.com>
Antoine Farnault <toins@biblibre.com> <toins>
Arnaud Laurin <alaurin@biblibre.com>
Arnaud Laurin <alaurin@biblibre.com> <alaurin>
Artur Norrby <artur.norrby@gmail.com>
Aude Charillon <aude.charillon@openfifth.co.uk> <aude.charillon@ptfs-europe.com>
Aude Charillon <aude.charillon@openfifth.co.uk> <aude.charillon@openfifth.co.uk>
Ava Li <rubyli208@gmail.com>
Azucena Aguayo <Azucena.Aguayo@uvu.edu>
Baptiste Bayche <baptiste.bayche@inlibro.com> <baptiste.bayche@inlibro.com>
Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Barton Chittenden <barton@bywatersolutions.com>
Benedict P. Barszcz <kb2qzv>
Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> <knakk-koha@vagrant-saucy64>
Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> <bensinober@gmail.com>
Bernardo González Kriegel <gonzalez@di.unc.edu.ar>
Bernardo González Kriegel <gonzalez@di.unc.edu.ar> <bgkriegel@gmail.com>
BibLibre Team <koha@biblibre.com>
BibLibre Team <koha@biblibre.com> <dev_patches@biblibre.com>
BibLibre Team <koha@biblibre.com> <root@jbilou.biblibre.local>
Brandon Haveman <brandon_h27@hotmail.com>
Brendan Gallagher <brendan@bywatersolutions.com>
Brendan Gallagher <brendan@bywatersolutions.com> <info@bywatersolutions.com>
Briana Greally <brianagreally@gmail.com>
Brice Sanchez <brice.sanchez@sys-tech.net>
Brice Sanchez <brice.sanchez@sys-tech.net> <koha-preprod@sys-tech.net>
Bruno Toumi <btoumi>
ByWater Solutions Team <staff@bywatersolutions.com>
Caroline Cyr La Rose <caroline@inlibro.com>
Catrina Berka <catrina@bywatersolutions.com> Catrina <catrina@bywatersolutions.com>
Catrina Berka <catrina@bywatersolutions.com> <catrina@bywatersolutions.com>
Charles Farmer <charles.farmer@inlibro.com>
Charles Farmer <charles@inlibro.com>
Chloe Alabaster <chloealabaster@gmail.com>
Chloe Zermatten <chloe.zermatten@openfifth.co.uk> <chloe.zermatten@ptfs-europe.com>
Chloe Zermatten <chloe.zermatten@openfifth.co.uk> <chloe.zermatten@openfifth.co.uk>
Chris Cormack <chris@bigballofwax.co.nz>
Chris Cormack <chrisc@catalyst.net.nz>
Chris Cormack <chris@bigballofwax.co.nz> <chris.cormack@liblime.com>
Chris Cormack <chris@bigballofwax.co.nz> <chris@figwit.metavore.com>
Chris Cormack <chris@bigballofwax.co.nz> <chris@snaga.liblime.co.nz>
Chris Cormack <chris@bigballofwax.co.nz> <crc@arwen.metavore.com>
Chris Cormack <chris@bigballofwax.co.nz> <crc@liblime.com>
Chris Cormack <chris@katipo.co.nz> <chris>
Chris Cormack <chris@katipo.co.nz> <rangi>
Chris Cormack <chrisc@catalyst.net.nz> <chrisc@git.koha-community.org>
Chris Hall <chrish@catalyst.net.nz> <chris.hall@catalyst.net.nz>
Chris Nighswonger <cnighswonger@foundations.edu>
Chris Nighswonger <chris.nighswonger@gmail.com> <root@fbcit.campus.foundations.edu>
Chris Nighswonger <cnighswonger@foundations.edu> <cnighswonger@cnighswonger-dt.(none)>
Chris Nighswonger <cnighswonger@foundations.edu> Koha User <koha@dev.(none)>
Chris Nighswonger <cnighswonger@foundations.edu> <chris.nighswonger@gmail.com>
Christophe Croullebois <christophe.croullebois@biblibre.com>
Christophe Torin <christophe.torin@univ-rennes2.fr>
Claudia Forsman <claudia.forsman@gmail.com>
Colin Campbell <colin.campbell@openfifth.co.uk> <colin.campbell@ptfs-europe.com>
Colin Campbell <colin.campbell@ptfs-europe.com> <colin.campbell@openfifth.co.uk>
D Ruth Bavousett <David.Bavousett@liblime.com>
D Ruth Bavousett <dbavousett@ptfs.com>
D Ruth Bavousett <druthb@gmail.com>
D Ruth Bavousett <jdb@arwen.metavore.com>
D Ruth Bavousett <ruth@bywatersolutions.com>
D Ruth Bavousett <dbavousett@ptfs.com> <koha-dev@ptfs.com>
Daniel Banzli <daniel.buenzli@erratique.ch>
Daniel Barker <daniel@catalystacademy.net.nz> <daniel.barker.nz@gmail.com>
Danyon Sewell <danyonsewell@catalyst.net.nz> <danyonsewell@catalyst.net.nz>
Darrell Ulm <darrellulm@smfpl.org> Darrell Ulm <darrellulm@kohavmware>
Darrell Ulm <darrellulm@smfpl.org> Darrell Ulm <darrellulm@smfpl.org>
Darrell Ulm <darrellulm@smfpl.org> koha <koha@smfpl.org>
Darrell Ulm <darrellulm@smfpl.org> root <root@newkoha32.local>
David Cook <dcook@prosentient.com.au>
David Gustafsson <glasklas@gmail.com> <root@f1ebe1bec408>
David Roberts <david.roberts@openfifth.co.uk> <david.roberts@ptfs-europe.com>
David Schmidt <davewood@gmx.at>
David Schuster <dschust1@gmail.com>
David Strainchamps <lavide>
Dobrica Pavlinušić <dpavlin@rot13.org>
Donna Bachowski <donna@bywatersolutions.com>
Dorian Meid <dnmeid>
Duncan Tyler <duncan@catalyst.net.nz> <duncan@duncan-SoT.wgtn.cat-it.co.nz>
Elliott Davis <tdavis@uttyler.edu> <root@test.bywatersolutions.com>
Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Emily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Emma Nakamura Smith <emma.nakamura.smith@gmail.com>
Emma Nakamura Smith <emma.nakamura.smith@gmail.com> Your Full Name <your_email>
Emmi Takkinen <emmi.takkinen@outlook.com>
Eric Phetteplace <phette23@gmail.com>
Esther Melander <esther@bywatersolutions.com> <esther@bywatersolutions.com>
Father Vlasie <fv@spots.school>
Felicie Thiery <felicie.thiery@biblibre.com> <felicie.thiery@biblibre.com>
Fernando Canizo <conan@lugmen.org.ar>
Finlay Thompson <finlay@katipo.co.nz> <finlayt>
Francisco M. Marzoa Alonso <fmmarzoa>
Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers <fridolyn.somers@progilone.fr>
Fridolin Somers <fridolin.somers@biblibre.com> Admin User Koha <koha@localhost>
Fridolin Somers <fridolin.somers@biblibre.com> <fridolyn.somers@biblibre.com>
Friedrich zur Hellen <hellen>
Frère Sébastien Marie <semarie@latrappe.fr> Frère Sébastien Marie <semarie-koha@latrappe.fr>
Frédéric Demians <f.demians@tamil.fr> <f.demians@tamil.fr>
Frédéric Demians <f.demians@tamil.fr> <frederic@tamil.fr>
Frédéric Demians <f.demians@tamil.fr> <(frederic@tamil.fr)>
Frédéric Durand <frederic.durand@univ-lyon2.fr>
Frédérick Capovilla <frederick.capovilla@libeo.com>
Frédérick Capovilla <frederick.capovilla@libeo.com> <fredericiapovilla@sys-tech.net>
Frédérick Capovilla <frederick.capovilla@sys-tech.net> koha <koha@koha.sys-tech.net>
Frédérick Capovilla <frederick.capovilla@sys-tech.net> preprod34 <preprod34@koha.ccsr.qc.ca>
Galen Charlton <gmc@esilibrary.com>
Gavin McCullagh <gmccullagh>
Genevieve Plantin <genevieve.plantin@inlibro.com> <genevieve@inlibro.com>
Genevieve Plantin <genevieve.plantin@inlibro.com> <genevieve.plantin@inlibro.com>
Greg Barniskis <gbarniskis@gmail.com>
Gus Ellerm <gel1163@stacmail.net>
Gynn Lomax <gynn@katipo.co.nz> truth_nz <truth_nz>
H. Passini <hpassini>
Hayley Pelham <hayleymapley@catalyst.net.nz>
Hebah Amin-Headley <hebah@bywatersolutions.com> <hebah@bywatersolutions.com>
Helene Hickey <hickeyhe@wgc.school.nz>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> hdl <hdl>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> Henri-Damien LAURENT <henridamien@koha-fr.org>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> <root@descartes.biblibre.com>
Henri-Damien LAURENT <henridamien.laurent@biblibre.com> <root@henridamienlaurent.dyndns.org>
Hinemoea Viault <hinemoea.viault@inlibro.com> <hinemoea@inlibro.com>
Holger Meißner <holger.meissner@hs-gesundheit.de> <h.meissner.82@web.de>
Holly Cooper <hc@interleaf.ie>
Hugo Agud <hagud@orex.es> Signed-off-by: Hugo Agud <hagud@orex.es>
Héctor Eduardo Castro Avalos <hector.hecaxmmx@gmail.com>
Ian Walls <hsl@nyumc.org>
Ian Walls <ian.walls@bywatersolutions.com>
Ian Walls <koha.sekjal@gmail.com> <sekjal@Samael.local>
Indranil Das Gupta <indradg@l2c2.co.in> Indranil Das Gupta (L2C2 Technologies) <indradg@l2c2.co.in>
Jacob O'Mara <jacob.omara@openfifth.co.uk> <jacob.omara@ptfs-europe.com>
Jake Deery <jake.deery@ptfs-europe.com>
Jake Deery <jake.deery@ptfs-europe.com>
Jake Deery <jake.deery@openfifth.co.uk> PerplexedTheta <jahdobble@llownd.net>
Jake Deery <jake.deery@openfifth.co.uk> <jake.deery@ptfs-europe.com>
Jane Wagner <jwagner@ptfs.com> <dev2@debKOHA2.corporate.ptfs.com>
Janet McGowan <janet.mcgowan@openfifth.co.uk> <janet.mcgowan@ptfs-europe.com>
Janne Seppänen <janne.seppanen@lahti.fi> Janne <janne.seppanen@lahti.fi>
Janne Seppänen <janne.seppanen@lahti.fi> <janne.seppanen@lahti.fi>
Janusz Kaczmarek <januszop@gmail.com>
Jared Camins-Esakov <jcamins@cpbibliography.com>
Jared Camins-Esakov <jcamins@cpbibliography.com> <camins@numismatics.org>
Jared Camins-Esakov <jcamins@cpbibliography.com> <jcamins@bywatersolutions.com>
Jared Camins-Esakov <jcamins@cpbibliography.com> <koha@cpbibliography.com>
Jatara Barnes <jendayi30@gmail.com>
Jesse Maseto <jesse@bywatersolutions.com> JesseM <jesse@bywatersolutions.com>
Jesse Maseto <jesse@bywatersolutions.com> <jesse@bywatersolutions.com>
Jesse Weaver <pianohacker@gmail.com> <pianohacker@gmail.com>
Joe Atzberger <joe.atzberger@liblime.com>
Joe Atzberger <joe.atzberger@liblime.com> <atz4sip@arwen.metavore.com>
Joe Sikowitz <joe@flo.org>
Johan Larsson <johan.larsson@ub.gu.se>
Johanna Räisä <johanna.raisa@gmail.com>
John Copeland <chansey.killer@catalystacademy.net.nz> <chansey.killer@hotmail.com>
John Copeland <spartan0042@catalystacademy.net.nz> <spartan0042@hotmail.com>
Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Field <jonathan.field@openfifth.co.uk> <jonathan.field@ptfs-europe.com>
Jono Mingard <jono@catalystacademy.net.nz> <reason.koan@gmail.com>
Jorgia Kelsey <jorgia@catalystacademy.net.nz> <jorgia_m_kelsey@hotmail.com>
Josef Moravec <josef.moravec@gmail.com> kohamaster <preprod@kohaVM>
Joshua Ferraro <jmf@liblime.com> <koha-test@koha.hclibrary.org>
Joshua Ferraro <jmf@liblime.com> <jmf@arwen.metavore.com>
Joshua Ferraro <jmf@liblime.com> <koha-test@koha.hclibrary.org>
Joshua Ferraro <jmf@liblime.com> <joshferraro>
Joshua Ferraro <jmf@liblime.com> <jmf@liblime.com>
Joshua Ferraro <jmf@liblime.com> <koha-pro@koha-01.hclibrary.org>
Joshua Ferraro <jmf@liblime.com> <root@mail.oplin.org>
Joshua Ferraro <jmf@liblime.com> <root@snaga.liblime.co.nz>
Joshua Ferraro <jmf@myacpl.org> <kados>
Joy Nelson <joy@bywatersolutions.com>
Juan Romay Sieira <juan.sieira@xercode.es>
Julian Fiol <julian.fiol@biblibre.com>
Julian Maurice <julian.maurice@biblibre.com> koha <koha@cmspub1.di.u-psud.fr>
Julian Maurice <julian.maurice@biblibre.com> koha <koha@kohaprep1.di.u-psud.fr>
Justin Vos <justinvos@live.com>
Jérome Vizcaino <plugz>
Jérémy Breuillard <jeremy.breuillard@biblibre.com>
Jérôme Charaoui <jcharaoui@cmaisonneuve.qc.ca>
Katrin Fischer <katrin.fischer@bsz-bw.de>
Katrin Fischer <katrin.fischer.83@web.de> <katrin.fischer@web.de>
Katrin Fischer <katrin.fischer@bsz-bw.de> <Katrin.Fischer@bsz-bw.de>
Katrin Fischer <katrin.fischer@bsz-bw.de> Koha <koha@koha-dev.de>
Kelly McElligott <kelly@bywatersolutions.com> <kelly@bywatersolutions.com>
Kenza Zaki <kenza.zaki@biblibre.com> <root@kenza-VirtualBox>
Kevin Carnes <kevin.carnes@ub.lu.se>
Koha Translators <root@translate.koha-community.org>
Kris Wehipeihana <kriswehipeihana@catalyst.net.nz>
Kyle M Hall <kyle@bywatersolutions.com> <migrations@bywatersolutions.com>
Kyle M Hall <kyle@bywatersolutions.com> <“staff@bywatersolutions.com”>
Kyle M Hall <kyle@bywatersolutions.com> John Doe <you@example.com>
Kyle M Hall <kyle@bywatersolutions.com> koha <koha@false.(none)>
Kyle M Hall <kyle@bywatersolutions.com> koha <koha@localhost.(none)>
Kyle M Hall <kyle@bywatersolutions.com> <koha@mtpl.bywatersolutions.com>
Kyle M Hall <kyle@bywatersolutions.com> <kyle@bywatersolutions.com>
Kyle M Hall <kyle@bywatersolutions.com> <kyle.m.hall@gmail.com>
Lari Strand <lmstrand@gmail.com> <lmstrand@gmail.com>
Larry Baerveldt <larry@bywatersolutions.com>
Laura Escamilla <laura.escamilla@bywatersolutions.com>
Laurence Rault <laurence.rault@biblibre.com> <laurence.rault@biblibre.com>
Leire Diez <leire@scanbit.net>
Liz Rea <liz@catalyst.net.nz>
Liz Rea <lrea@nekls.org> <liz@nekls.org>
Liz Rea <lrea@nekls.org> <lrea@nekls.org>
Liz Rea <wizzyrea@gmail.com> <wizzyrea@gmail.com>
Liz Rea <wizzyrea@gmail.com> root <root@lists.nekls.org>
Liz Rea <wizzyrea@gmail.com> root <root@liz-koha.nekls.org>
Lyon 3 Team <koha@univ-lyon3.fr>
Lyon 3 Team <koha@univ-lyon3.fr> Lyon3 Team <preprod@koha.(none)>
Lyon 3 Team <koha@univ-lyon3.fr> <koha@univ-lyon.fr>
MJ Ray <mjr@phonecoop.coop>
MJ Ray <mjr@phonecoop.coop> <slef>
Magnus Enger <magnus.enger@kul.oslo.kommune.no>
Magnus Enger <magnus@enger.priv.no>
Magnus Enger <magnus.enger@kul.oslo.kommune.no> <digitalutvikling@gmail.com>
Marc Véron <veron@veron.ch>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl> <marcel@libdevelop.rijksmuseum.nl>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl> <M.de.Rooy@rijksmuseum.nl>
Marcel de Rooy <m.de.rooy@rijksmuseum.nl> <root@master.rijkskoha.nl>
Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca>
Mark Gavillet <mark.gavillet@openfifth.co.uk> <mark.gavillet@ptfs-europe.com>
Martin Aubeut <martin.aubeut@gmail.com> <martin.aubeut@gmail.com>
Martin Renvoize <martin.renvoize@openfifth.co.uk> <martin@dev1.vm.bytemark.co.uk>
Martin Renvoize <martin.renvoize@openfifth.co.uk> <martin.renvoize@ptfs-europe.com>
Martin Renvoize <martin.renvoize@openfifth.co.uk> <martin.renvoize@openfifth.co.uk>
Mason James <mason.james@liblime.com>
Mason James <mason@kohaaloha.com>
Mason James <mtj@kohaaloha.com>
Mason James <mason@katipo.co.nz> sushi <sushi>
Mason James <mason@katipo.co.nz> szrj1m <szrj1m>
Mason James <mtj@kohaaloha.com> <mason.loves.sushi@gmail.com>
Mason James <mtj@kohaaloha.com> QA Manager <patches@koha.org>
Mason James <mtj@kohaaloha.com> <szrj5m>
Mason James <mtj@liblime.com> <mason@snaga.liblime.com>
Mathieu Saby <mathsabypro@gmail.com> <msaby>
Mathieu Saby <mathsabypro@gmail.com> <mathsabypro@gmail.com>
Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> <matt.blenkinsip@ptfs-europe.com>
Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> <matt.blenkinsop@ptfs-europe.com>
Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> <matt.blenkinsop@openfifth.co.uk>
Matthias Le Gac <matthias@babel.inlibro.net> matthias le gac <matthias@babel.inlibro.net>
Matthias Le Gac <matthias@babel.inlibro.net> <matthias@babel.inlibro.net>
Matthias Meusburger <matthias.meusburger@biblibre.com>
Maxime Beaulieu <maxime.beaulieu@inlibro.com>
Maxime Beaulieu <maxime.beaulieu@inlibro.com> <mbeaulieu@inlibro.com>
Maxime Pelletier <maxime.pelletier@libeo.com>
Meenakshi R <meenakshi.r@osslabs.biz>
Mengü Yazıcıoğlu <kohadevinim@devinim.com.tr>
Merllissia Manueli <mel@catalystacademy.net.nz> <manuelimel@gmail.com>
Michael Hafen <mdhafen@washk12.org> <mdhafen@tech.washk12.org>
Michel Lerenard <zifox>
Michelle Spinney <mspinney@clamsnet.org> Michelle <mspinney@clamsnet.org>
Mike Hansen <wolfpac444> <wolfpac444>
Mike Mylonas <dragon28@ihug.co.nz> <dragon28>
Morag Hills <moraghills@catalystacademy.net.nz> <the.invinnysible.one@gmail.com>
Morgane Alonso <morgane.alonso@biblibre.com>
Nahuel Angelinetti <nahuel.angelinetti@biblibre.com>
Nazlı Çetin <nazli@devinim.com.tr>
Nguyen Duy Tinh <duy-tinh.nguyen@biblibre.com>
Nicholas Van Oudtshoorn <vanoudt@gmail.com>
Nick Clemens <nick@bywatersolutions.com> <nick@bywatersolutions.com>
Nick Clemens <nick@bywatersolutions.com> Koha instance kohadev-koha <kohadev-koha@kohadevbox>
Nick Clemens <nick@bywatersolutions.com> root <root@f1ebe1bec40>
Nicolas Morin <nicolas.morin@biblibre.com> <nicolas.morin@biblibre.com>
Nicole C. Engard <nengard@gmail.com>
Nicole C. Engard <nicole@bywatersolutions.com>
Nicole C. Engard <nce@kohavm76.liblime.com> <nce@kohavm76.liblime.com>
Nicole C. Engard <nicole.engard@liblime.com> <nce@liblime.com>
Nicole C. Engard <nicole.engard@liblime.com> <nicole.engard@liblime.com>
Nicole C. Engard <nicole@bywatersolutions.com> <nengard@bywatersolutions.com>
Nicole C. Engard <nicole@bywatersolutions.com> <nce@arwen.metavore.com>
Nina Martinez <nina.martinez@biblibre.com>
Nuño López Ansótegui <nunyo@masmedios.com> <nunyo@masmedios.com>
Olivier Vezina <olivier.vezina@inLibro.com>
Olwen Williams <olwen@katipo.co.nz> <olwen>
Olwen Williams <olwen@katipo.co.nz> <fisheye>
Owen Leonard <oleonard@myacpl.org>
Owen Leonard <oleonard@myacpl.org> <oleonard>
Owen Leonard <oleonard@myacpl.org> <oleonard@oleonard-desktop.(none)>
Paola Rossi <paola.rossi@cineca.it>
Pat Eyler <pate@eyler.org> <pate>
Paul Poulain <paul.poulain@biblibre.com>
Paul Poulain <paul.poulain@biblibre.com> <paul@localhost.(none)>
Paul Poulain <paul.poulain@biblibre.com> <paul@koha-fr.org>
Paul Poulain <paul.poulain@biblibre.com> <tipaul>
Pawel Skuza <pawelzc>
Pedro Amorim <pedro.amorim@openfifth.co.uk> <pedro.amorim@ptfs-europe.com>
Petter Goksøyr Åsen <petter.goksoyr.asen@kul.oslo.kommune.no>
Petter Goksøyr Åsen <petter.goksoyr.asen@kul.oslo.kommune.no> <boutrosboutrosboutros@gmail.com>
Philippe Audet-Fortin <philippe.audet-fortin@inlibro.com>
Philippe Blouin <blou@inlibro.com>
Philippe Blouin <philippe.blouin@inlibro.com>
Pierre Cauchois <cauchoip>
Pierrick Le Gall <pierreck@ineo.com> <plg>
Polytechnic University Koha Installation <poly-pro@builder.(none)>
Pongtawat Chippimolchai <pongtawat@punsarn.asia>
Rachel Hamilton-Williams <rachel@katipo.co.nz> <rachelkatipo>
Radek Šiman <radek.siman@centrum.cz>
Raewyn Adams <raewyn.adams@bopdhb.govt.nz>
Remi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com>
Richard Anderson <ri_chard>
Robert Lyon <bob_lyon@katipo.co.nz> <bob_lyon>
Robin Sheat <robin@catalyst.net.nz>
Rochelle Healy <rochelle@catalystacademy.net.nz> <Rochelle_healy@hotmail.com>
Roger Buck <saas>
Russel Garlick <russel.garlick@liblime.com> <russel@ahinui.local>
Ryan Higgins <rch@balrog.liblime.com> <rch@false.(none)>
Ryan Higgins <rch@liblime.com> <rych>
Sabrina Kiehl <kiehl@mpis.mpg.de> <kiehl@mpis.mpg.de>
Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>
Sally Healey <sally.healey@cheshiresharedservices.gov.uk>
Salman Ali <salman.ali@inLibro.com>
Sam Lau <samalau@gmail.com> <samalau@gmail.com>
Sam Sanders <sam-sanders@catalystacademy.net.nz> <sam-sanders@live.com>
Samuel Crosby <scrosby000@gmail.com>
Savitra Sirohi <savitra.sirohi@osslabs.biz>
Serge Renaux <sergerenaux>
Shaun Evans <shaunevans>
Shi Yao Wang <shi-yao.wang@inlibro.com>
Shi Yao Wang <shiyao@inlibro.com>
Silvia Simonetti <s.simonetti@cineca.it>
Simith D'Oliveira <simith@inlibro.com>
Simon Blake <simon@katipo.co.nz> <simon>
Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Sonia Lemaire <sonia.lemaire@biblibre.com>
Srdjan Janković <srdjan@catalyst.net.nz>
Stan Brinkerhoff <stan@brinkerhoff.org> <stan@brinkerhoff.org>
Stan Brinkerhoff <stan@brinkerhoff.org> <stan@koha-dev.hsd1.vt.comcast.net>
Stephen Hedges <shedges@myacpl.org> <shedges>
Steve Tonnesen <tonnesen>
Stina Hallin <stina.hallin@ub.lu.se> <stina.hallin@ub.lu.se>
Stéphane Delaune <stephane.delaune@biblibre.com>
Séverine Queune <severine.queune@bulac.fr>
Séverine Queune <severine.queune@gmail.com>
The Minh Luong <the-minh.luong@inlibro.com>
The Minh Luong <theminh@inlibro.com>
Thibaud Guillot <thibaud.guillot@biblibre.com>
Thomas Dukleth <git@agogme.com> <git@agogme.com>
Thomas Dukleth <git@agogme.com> <thd>
Thomas Wright <thomasw@catalystacademy.net.nz> <tomsStudy@gmail.com>
Todd Goatley <tgoatley@gmail.com>
Tomás Cohen Arazi <tcohen@psi.unc.edu.ar>
Tomás Cohen Arazi <tomascohen@theke.io>
Tomás Cohen Arazi <tomascohen@unc.edu.ar>
Tomás Cohen Arazi <tomascohen@theke.io> <tomascohen@gmail.com>
Tümer Garip <tgarip1957>
Victor Grousset <victor@tuxayo.net>
Vitor Fernandes <vfernandes@keep.pt>
Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
Wajasu <matted-34813@mypacks.net>
Waylon Robertson <genji@katipo.co.nz>. <genjimoto>
Zeno Tajoli <z.tajoli@cineca.it>. <tajoli@cilea.it>
Zeno Tajoli <z.tajoli@cineca.it>. <zeno@mail.cile>
Zeno Tajoli <z.tajoli@cineca.it>. <ztajoli@gmail.com>
doXulting <doxulting>
Сергій Дубик {Serhij Dubyk} <serhijdubyk@gmail.com>
शंतनू {Shantanoo} <shantanoo@gmail.com>
American Numismatics Society <sponsor> America Numismatic Society <sponsor>
Association KohaLa <sponsor> Association KohaLa - https://koha-fr.org/ <sponsor>
Bibliothèque Universitaire des Langues et Civilisations (BULAC) <sponsor> BULAC - http://www.bulac.fr/ <sponsor>
Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) <sponsor> Bibliotheksservice-Zentrum Baden-Wuerttemberg <sponsor>
Catalyst <sponsor> Catalyst IT <sponsor>
Catalyst <sponsor> Catalyst IT, New Zealand <sponsor>
Centre collégial des services regroupés <sponsor> CCSR <sponsor>
Centre collégial des services regroupés <sponsor> CCSR ( http://www.ccsr.qc.ca ) <sponsor>
Dataly Tech <sponsor> Dataly Tech [https://dataly.gr/] <sponsor>
Duchesne County Library <sponsor> Duchesne County Library [http://uintahlibrary.org/] <sponsor>
Fenway Library Organization <sponsor> Fenway Libraries Online <sponsor>
Horowhenua District Council <sponsor> Horowhenua District Council, NZ <sponsor>
Lund University Library <sponsor> Lunds Universitetsbibliotek <sponsor>
Northeast Kansas Library System <sponsor> Northeast Kansas Library - NEKLS <sponsor>
Northeast Kansas Library System <sponsor> Northeast Kansas Library System [http://www.nekls.org] <sponsor>
South East Kansas Library System <sponsor> South East Kansas Library System [http://www.sekls.org] <sponsor>
South Taranaki District Council <sponsor> South Taranaki District Council, NZ <sponsor>
South East Kansas Library System <sponsor> Southeast Kansas Library - SEKLS <sponsor>
South East Kansas Library System <sponsor> Southeast Kansas Library System <sponsor>
Round Rock Public Library <sponsor> Sponsored by: Round Rock Public Library <sponsor>
Round Rock Public Library <sponsor> Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] <sponsor>
National Library of Finland <sponsor> The National Library of Finland <sponsor>
Université Jean Moulin Lyon 3 <sponsor> Université de Lyon 3 <sponsor>
Vermont Organization of Koha Automated Libraries <sponsor> VOKAL <sponsor>
Vermont Organization of Koha Automated Libraries <sponsor> Vermont Organization of Koha Automated Libraries [http://gmlc.org/index.php/vokal] <sponsor>
Virginia Tech <sponsor> Virginia Tech [https://lib.vt.edu/] <sponsor>
Waitaki Distict Council <sponsor> Waitaki Distict Council, NZ <sponsor>
Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) <sponsor> Bibliotheksservice-Zentrum Baden-Wuerttemberg <sponsor>
Catalyst <sponsor> Catalyst IT <sponsor>
Catalyst <sponsor> Catalyst IT, New Zealand <sponsor>
Centre collégial des services regroupés <sponsor> CCSR <sponsor>
Centre collégial des services regroupés <sponsor> CCSR ( http://www.ccsr.qc.ca ) <sponsor>
Dataly Tech <sponsor> Dataly Tech [https://dataly.gr/] <sponsor>
Duchesne County Library <sponsor> Duchesne County Library [http://uintahlibrary.org/] <sponsor>
Fenway Library Organization <sponsor> Fenway Libraries Online <sponsor>
Horowhenua District Council <sponsor> Horowhenua District Council, NZ <sponsor>
Lund University Library <sponsor> Lunds Universitetsbibliotek <sponsor>
Northeast Kansas Library System <sponsor> Northeast Kansas Library - NEKLS <sponsor>
Northeast Kansas Library System <sponsor> Northeast Kansas Library System [http://www.nekls.org] <sponsor>
South East Kansas Library System <sponsor> South East Kansas Library System [http://www.sekls.org] <sponsor>
South Taranaki District Council <sponsor> South Taranaki District Council, NZ <sponsor>
South East Kansas Library System <sponsor> Southeast Kansas Library - SEKLS <sponsor>
South East Kansas Library System <sponsor> Southeast Kansas Library System <sponsor>
Round Rock Public Library <sponsor> Sponsored by: Round Rock Public Library <sponsor>
Round Rock Public Library <sponsor> Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] <sponsor>
National Library of Finland <sponsor> The National Library of Finland <sponsor>
Université Jean Moulin Lyon 3 <sponsor> Université de Lyon 3 <sponsor>
Vermont Organization of Koha Automated Libraries <sponsor> VOKAL <sponsor>
Vermont Organization of Koha Automated Libraries <sponsor> Vermont Organization of Koha Automated Libraries [http://gmlc.org/index.php/vokal] <sponsor>
Virginia Tech <sponsor> Virginia Tech [https://lib.vt.edu/] <sponsor>
Waitaki Distict Council <sponsor> Waitaki Distict Council, NZ <sponsor>

View File

@ -1,6 +1,8 @@
module.exports = {
arrowParens: "avoid",
trailingComma: "es5",
tabWidth: 4,
useTabs: false,
overrides: [
{
files: "*.vue",
@ -9,4 +11,4 @@ module.exports = {
}
}
]
}
}

View File

@ -2483,7 +2483,7 @@ sub GetInvoices {
if($args{order_by}) {
my ($column, $direction) = split / /, $args{order_by};
if(grep { $_ eq $column } @columns) {
$direction ||= 'ASC';
$direction = ( uc( $direction // '' ) eq 'DESC' ) ? 'DESC' : 'ASC';
$query .= " ORDER BY $column $direction";
}
}

View File

@ -502,7 +502,6 @@ sub get_template_and_user {
IndependentBranches => C4::Context->preference("IndependentBranches"),
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
IntranetFavicon => C4::Context->preference("IntranetFavicon"),
IntranetmainUserblock => C4::Context->preference("IntranetmainUserblock"),
IntranetNav => C4::Context->preference("IntranetNav"),
intranetreadinghistory => C4::Context->preference("intranetreadinghistory"),
IntranetReadingHistoryHolds => C4::Context->preference("IntranetReadingHistoryHolds"),
@ -1549,7 +1548,6 @@ sub checkauth {
charset => 'utf-8',
cookie => $cookie,
'X-Frame-Options' => 'SAMEORIGIN',
-sameSite => 'Lax'
}
),
$template->output;
@ -1635,7 +1633,7 @@ sub check_api_auth {
-secure => ( C4::Context->https_enabled() ? 1 : 0 ),
-sameSite => 'Lax'
);
return ( $return, $cookie, $session ); # return == 'ok' here
return ( $return, $cookie, $session->id ); # return == 'ok' here
} else {

View File

@ -1645,8 +1645,11 @@ sub merge {
}
if( exists $controlled_ind->{sub2} ) { # thesaurus info
if( defined $controlled_ind->{sub2} ) {
# Add or replace
$field_to->update( 2 => $controlled_ind->{sub2} );
# Add or replace when not empty. If empty, an existing
# $2 value is retained (see also bug 40119).
if ( $controlled_ind->{sub2} ne q{} ) {
$field_to->update( 2 => $controlled_ind->{sub2} );
}
} else {
# Key alerts us here to remove $2
$field_to->delete_subfield( code => '2' );

View File

@ -48,7 +48,7 @@ sub get_barcode {
my $month = $args->{mon};
my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute("^[-a-zA-Z]{1,}$year$month");
$sth->execute("^[-a-zA-Z0-9]{1,}$year$month");
while (my ($count)= $sth->fetchrow_array) {
$nextnum = $count if $count;
$nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 9999 items per month
@ -63,8 +63,11 @@ sub get_barcode {
.siblings("select")
.val();
if(typeof offset == 'undefined'){
var offset = 0;
}
if ( \$(elt).val() == '' ) {
\$(elt).val(homebranch + '$nextnum');
\$(elt).val(homebranch + ($nextnum + offset));
}
~;
return $nextnum, $scr;

View File

@ -61,7 +61,6 @@ BEGIN {
TransformMarcToKoha
TransformHtmlToMarc
TransformHtmlToXml
prepare_host_field
);
# Internal functions
@ -1309,7 +1308,7 @@ sub GetMarcPrice {
@listtags = ('345', '020');
$subfield="c";
} elsif ( $marcflavour eq "UNIMARC" ) {
@listtags = ('345', '010');
@listtags = ( '345', '010', '071' );
$subfield="d";
} else {
return;
@ -2920,134 +2919,6 @@ sub ModBiblioMarc {
return $biblionumber;
}
=head2 prepare_host_field
$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour );
Generate the host item entry for an analytic child entry
=cut
sub prepare_host_field {
my ( $hostbiblio, $marcflavour ) = @_;
$marcflavour ||= C4::Context->preference('marcflavour');
my $biblio = Koha::Biblios->find($hostbiblio);
my $host = $biblio->metadata->record;
# unfortunately as_string does not 'do the right thing'
# if field returns undef
my %sfd;
my $field;
my $host_field;
if ( $marcflavour eq 'MARC21' ) {
if ( $field = $host->field('100') || $host->field('110') || $host->field('11') ) {
my $s = $field->as_string('ab');
if ($s) {
$sfd{a} = $s;
}
}
if ( $field = $host->field('245') ) {
my $s = $field->as_string('a');
if ($s) {
$sfd{t} = $s;
}
}
if ( $field = $host->field('260') ) {
my $s = $field->as_string('abc');
if ($s) {
$sfd{d} = $s;
}
}
if ( $field = $host->field('240') ) {
my $s = $field->as_string();
if ($s) {
$sfd{b} = $s;
}
}
if ( $field = $host->field('022') ) {
my $s = $field->as_string('a');
if ($s) {
$sfd{x} = $s;
}
}
if ( $field = $host->field('020') ) {
my $s = $field->as_string('a');
if ($s) {
$sfd{z} = $s;
}
}
if ( $field = $host->field('001') ) {
$sfd{w} = $field->data(),;
}
$host_field = MARC::Field->new( 773, '0', ' ', %sfd );
return $host_field;
}
elsif ( $marcflavour eq 'UNIMARC' ) {
#author
if ( $field = $host->field('700') || $host->field('710') || $host->field('720') ) {
my $s = $field->as_string('ab');
if ($s) {
$sfd{a} = $s;
}
}
#title
if ( $field = $host->field('200') ) {
my $s = $field->as_string('a');
if ($s) {
$sfd{t} = $s;
}
}
#place of publicaton
if ( $field = $host->field('210') ) {
my $s = $field->as_string('a');
if ($s) {
$sfd{c} = $s;
}
}
#date of publication
if ( $field = $host->field('210') ) {
my $s = $field->as_string('d');
if ($s) {
$sfd{d} = $s;
}
}
#edition statement
if ( $field = $host->field('205') ) {
my $s = $field->as_string();
if ($s) {
$sfd{e} = $s;
}
}
#URL
if ( $field = $host->field('856') ) {
my $s = $field->as_string('u');
if ($s) {
$sfd{u} = $s;
}
}
#ISSN
if ( $field = $host->field('011') ) {
my $s = $field->as_string('a');
if ($s) {
$sfd{x} = $s;
}
}
#ISBN
if ( $field = $host->field('010') ) {
my $s = $field->as_string('a');
if ($s) {
$sfd{y} = $s;
}
}
if ( $field = $host->field('001') ) {
$sfd{0} = $field->data(),;
}
$host_field = MARC::Field->new( 461, '0', ' ', %sfd );
return $host_field;
}
return;
}
=head2 UpdateTotalIssues
UpdateTotalIssues($biblionumber, $increase, [$value])
@ -3097,7 +2968,7 @@ sub UpdateTotalIssues {
if (defined $value) {
$totalissues = $value;
} else {
$totalissues = $biblioitem->totalissues + $increase;
$totalissues = $current_issues + $increase;
}
return 0 if $current_issues == $totalissues; # No need to update if no changes

View File

@ -191,7 +191,7 @@ sub Z3950Search {
push @errconn, { server => $servers[$k]->{servername}, error => $error, seq => $i+1 } if $error;
}
else {
push @errconn, { 'server' => $servers[$k]->{servername}, error => ( ( $oConnection[$k]->error_x() )[0] ), seq => $i+1 };
push @errconn, { 'server' => $servers[$k]->{servername}, error => ( ( $oConnection[$k]->error_x() )[0] ), error_msg => ( ( $oConnection[$k]->error_x() )[1] ), seq => $i+1 };
}
}
} #if $numresults

View File

@ -581,6 +581,7 @@ sub GetBudgetHierarchy {
SELECT shipmentcost_budgetid as budget_id,
SUM(shipmentcost) as shipmentcost
FROM aqinvoices
WHERE shipmentcost_budgetid IS NOT NULL
GROUP BY shipmentcost_budgetid
|, 'budget_id');
my $hr_budget_spent_adjustment = $dbh->selectall_hashref(q|

View File

@ -22,6 +22,7 @@ use Modern::Perl;
use DateTime;
use POSIX qw( floor );
use Encode;
use Try::Tiny;
use C4::Context;
use C4::Stats qw( UpdateStats );
@ -780,8 +781,10 @@ sub CanBookBeIssued {
my $onsite_checkout = $params->{onsite_checkout} || 0;
my $override_high_holds = $params->{override_high_holds} || 0;
my $item_object = $params->{item}
// Koha::Items->find( { barcode => $barcode } );
my $item_object = $params->{item};
if ( !$item_object and $barcode ) {
$item_object = Koha::Items->find( { barcode => $barcode } );
}
# MANDATORY CHECKS - unless item exists, nothing else matters
unless ( $item_object ) {
@ -1716,6 +1719,32 @@ sub AddIssue {
# In the case that the borrower has an on-site checkout
# and SwitchOnSiteCheckouts is enabled this converts it to a regular checkout
$issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } );
# If this checkout relates to a booking, handle booking status appropriately
if ( my $booking = $item_object->find_booking( { checkout_date => $issuedate, due_date => $datedue } ) ) {
if ( $booking->patron_id == $patron->borrowernumber ) {
# Patron's own booking - mark as completed
$booking->status('completed')->store;
} else {
# Another patron's booking - only cancel if checkout period overlaps with actual booking period
my $booking_start = dt_from_string( $booking->start_date );
my $booking_end = dt_from_string( $booking->end_date );
# Check if checkout period overlaps with actual booking period (not just lead/trail)
if ( ( $issuedate >= $booking_start && $issuedate <= $booking_end )
|| ( $datedue >= $booking_start && $datedue <= $booking_end )
|| ( $issuedate <= $booking_start && $datedue >= $booking_end ) )
{
# Checkout overlaps with actual booking period - cancel the booking
$booking->status('cancelled')->store;
}
# If only in lead/trail period, do nothing - librarian has made informed decision
}
}
if ($issue) {
$issue->set($issue_attributes)->store;
}
@ -1734,7 +1763,14 @@ sub AddIssue {
);
}
$issue->discard_changes;
$patron->update_lastseen('check_out');
#Update borrowers.lastseen
try{
$patron->update_lastseen('check_out');
}
catch {
my $exception = $_;
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception";
};
if ( $item_object->location && $item_object->location eq 'CART'
&& ( !$item_object->permanent_location || $item_object->permanent_location ne 'CART' ) ) {
## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
@ -2329,6 +2365,10 @@ sub AddReturn {
my $patron = $issue->patron;
$patron_unblessed = $patron->unblessed;
}
# Confirm the lost charge came from the most recent patron to return the item
# and only charge the fine if so
if ( $message->payload->{patron_id} == $patron_unblessed->{borrowernumber} ) {
_CalculateAndUpdateFine(
{
issue => $issue,
@ -2344,6 +2384,7 @@ sub AddReturn {
}
}
}
}
# check if we have a transfer for this document
my $transfer = $item->get_transfer;
@ -2492,7 +2533,14 @@ sub AddReturn {
if C4::Context->preference("ReturnLog");
#Update borrowers.lastseen
$patron->update_lastseen('check_in');
try{
$patron->update_lastseen('check_in');
}
catch {
my $exception = $_;
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception";
$messages->{UpdateLastSeenError} = "$exception";
};
}
# Check if this item belongs to a biblio record that is attached to an
@ -3403,7 +3451,14 @@ sub AddRenewal {
}
);
#Update borrowers.lastseen
$patron->update_lastseen('renewal');
try{
$patron->update_lastseen('renewal');
}
catch {
my $exception = $_;
warn "Problem updating lastseen date for borrowernumber " . $patron->borrowernumber . ": $exception";
};
#Log the renewal
logaction("CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber) if C4::Context->preference("RenewalLog");
@ -4239,7 +4294,7 @@ sub ProcessOfflineOperation {
if ( $operation->{action} eq 'return' ) {
$report = ProcessOfflineReturn( $operation );
} elsif ( $operation->{action} eq 'issue' ) {
$report = ProcessOfflineIssue( $operation );
($report) = ProcessOfflineIssue($operation);
} elsif ( $operation->{action} eq 'payment' ) {
$report = ProcessOfflinePayment( $operation );
}
@ -4297,15 +4352,15 @@ sub ProcessOfflineIssue {
$operation->{timestamp},
);
}
AddIssue(
my $checkout = AddIssue(
$patron,
$operation->{'barcode'},
undef,
$operation->{barcode},
$operation->{due_date},
undef,
$operation->{timestamp},
undef,
);
return "Success.";
return ( "Success.", $checkout );
} else {
return "Borrower not found.";
}
@ -4653,7 +4708,7 @@ sub _CanBookBeAutoRenewed {
if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
my $amountoutstanding =
C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
C4::Context->preference("OPACFineNoRenewalsIncludeCredits")
? $patron->account->balance
: $patron->account->outstanding_debits->total_outstanding;
if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) {

View File

@ -45,7 +45,7 @@ sub split_callnumber {
# lccn examples: 'HE8700.7 .P6T44 1983', 'BS2545.E8 H39 1996';
my @lines = Library::CallNumber::LC->new($cn_item)->components();
unless (scalar @lines && defined $lines[0]) {
Koha::Logger->get->debug(sprintf('regexp failed to match string: %s', $cn_item));
Koha::Logger->get->debug( sprintf( 'regexp failed to match string: %s', $cn_item // q{} ) );
@lines = $cn_item; # if no match, just use the whole string.
}
my $LastPiece = pop @lines;

View File

@ -19,6 +19,9 @@ package C4::ClassSplitRoutine::RegEx;
use Modern::Perl;
use Koha::Logger;
use Koha::Regex::Replacement;
=head1 NAME
C4::ClassSplitRoutine::RegEx - regex call number sorting key routine
@ -40,14 +43,63 @@ my $cn_sort = C4::ClassSplitRoutine::RegEx::split_callnumber($cn_item, $regexs);
sub split_callnumber {
my ($cn_item, $regexs) = @_;
for my $regex ( @$regexs ) {
eval "\$cn_item =~ $regex"; ## no critic (StringyEval)
for my $regex (@$regexs) {
_apply_substitution( \$cn_item, $regex );
}
my @lines = split "\n", $cn_item;
return @lines;
}
=head2 _apply_substitution
_apply_substitution( \$string, $regex );
Applies a single admin-configured s/// substitution to $string in place,
without ever evaluating the input as code. The rule is parsed as
C<s/PATTERN/REPLACEMENT/FLAGS> (any non-space delimiter is accepted); the pattern is compiled with
qr// (so embedded-code assertions are treated as a runtime pattern and blocked
by Perl), and the replacement is expanded as data via
Koha::Regex::Replacement::expand_template. The
/e flag is rejected and anything that is not a plain substitution is ignored.
This replaces the previous C<eval "\$cn_item =~ $regex"> stringy eval, which
executed arbitrary Perl.
=cut
sub _apply_substitution {
my ( $ref, $regex ) = @_;
return unless defined $regex;
# Parse s<DELIM>PATTERN<DELIM>REPLACEMENT<DELIM>FLAGS, allowing any
# non-space delimiter and backslash-escaped delimiters inside the pattern
# and replacement. Anything that is not a well-formed plain substitution is
# ignored rather than executed.
return unless $regex =~ m{^s(\S)((?:\\.|(?!\1).)*)\1((?:\\.|(?!\1).)*)\1([a-z]*)\z}s;
my ( $pattern, $replacement, $flags ) = ( $2, $3, $4 );
return if $flags =~ /e/; # never evaluate the replacement as code
my $global = $flags =~ /g/ ? 1 : 0;
my $ci = $flags =~ /i/ ? '(?i)' : '';
my $compiled = eval { qr/$ci$pattern/ };
unless ( defined $compiled ) {
Koha::Logger->get->warn("C4::ClassSplitRoutine::RegEx: failed to compile pattern [$pattern]: $@");
return;
}
my $expand = sub { Koha::Regex::Replacement::expand_template( $replacement, [ @{^CAPTURE} ], {%+} ) };
if ($global) {
${$ref} =~ s/$compiled/$expand->()/ge;
} else {
${$ref} =~ s/$compiled/$expand->()/e;
}
return;
}
1;
=head1 AUTHOR

View File

@ -50,6 +50,10 @@ use Koha::Config::SysPrefs;
use Koha::Config;
use Koha;
# NOTE: The below list should match the corresponding options in the .pref file
# for CSVDelimiter
use constant ALLOWED_CSV_DELIMITERS => ( ';', 'tabulation', ',', '/', '\\', '#' );
=head1 NAME
C4::Context - Maintain and manipulate the context of a Koha script
@ -310,9 +314,11 @@ sub multivalue_preference {
my ( $self, $preference ) = @_;
my $syspref = $self->preference($preference) // q{};
my $values = [ split qr{\|}, $syspref ];
return $values;
return [ split qr{\|}, $syspref ]
if $syspref =~ qr{\|};
return [ split qr{,}, $syspref ]
}
=head2 enable_syspref_cache
@ -459,6 +465,13 @@ sub delete_preference {
sub csv_delimiter {
my ( $self, $value ) = @_;
# Validate input against allowed delimiters
if ($value) {
my %allowed = map { $_ => 1 } ALLOWED_CSV_DELIMITERS;
$value = undef unless $allowed{$value};
}
my $delimiter = $value || $self->preference('CSVDelimiter') || ',';
$delimiter = "\t" if $delimiter eq 'tabulation';
return $delimiter;
@ -549,7 +562,8 @@ sub _new_Zconn {
$syntax = 'xml';
$elementSetName = 'marcxml';
my $host = _common_config($server, 'listen')->{content};
my $host = _common_config( $server, 'listen' );
$host = $host->{content};
my $serverinfo = _common_config($server, 'serverinfo');
my $user = $serverinfo->{user};
my $password = $serverinfo->{password};
@ -559,7 +573,8 @@ sub _new_Zconn {
$o->option(user => $user) if $user && $password;
$o->option(password => $password) if $user && $password;
$o->option(async => 1) if $async;
$o->option(cqlfile=> _common_config($server, 'server')->{cql2rpn});
my $server_conf = _common_config( $server, 'server' );
$o->option( cqlfile => $server_conf->{cql2rpn} );
$o->option(cclfile=> $serverinfo->{ccl2rpn});
$o->option(preferredRecordSyntax => $syntax);
$o->option(elementSetName => $elementSetName) if $elementSetName;

View File

@ -139,6 +139,51 @@ sub set_form_values {
$template->param(messaging_preferences => $messaging_options);
}
=head2 restore_form_values
C4::Form::MessagingPreferences::restore_form_values( $input, $template );
Restores patron message preferences if error occurs while creating a patron.
C<$input> is the CGI query object.
C<$template> is the Template::Toolkit object for the response.
=cut
sub restore_form_values {
my ( $input, $template ) = @_;
my $messaging_options = C4::Members::Messaging::GetMessagingOptions();
foreach my $option (@$messaging_options) {
$option->{ $option->{'message_name'} } = 1;
my $message_attribute_id = $option->{'message_attribute_id'};
if ( $option->{'takes_days'} ) {
my $selected_value = $input->param( $message_attribute_id . '-DAYS' );
my $days_in_advance = $selected_value ? $selected_value : 0;
$option->{days_in_advance} = $days_in_advance;
@{ $option->{'select_days'} } = map {
{
day => $_,
selected => $_ == $days_in_advance
}
} ( 0 .. MAX_DAYS_IN_ADVANCE );
}
my @transport_types = $input->multi_param($message_attribute_id);
foreach my $transport_type (@transport_types) {
$option->{ 'transports_' . $transport_type } = 1;
}
if ( $option->{'has_digest'} ) {
if ( List::Util::first { $_ == $message_attribute_id } $input->multi_param('digest') ) {
$option->{'digest'} = 1;
}
}
}
$template->param( messaging_preferences => $messaging_options );
}
=head1 TODO
=over 4

View File

@ -151,22 +151,6 @@ sub authorities {
return $results;
}
=head2 preferred_authorities
my $preferred_authorities = $heading->preferred_authorities;
Return a list of authority records for headings
that are a preferred form of the heading.
=cut
sub preferred_authorities {
my $self = shift;
my $skipmetadata = shift || undef;
my ( $results, $total ) = _search( 'see-from', $skipmetadata );
return $results;
}
=head2 valid_heading_subfield
if (C4::Heading::valid_heading_subfield('100', 'e', '')) ...

View File

@ -84,7 +84,7 @@ my $bib_heading_fields = {
},
'151' => {
auth_type => 'GEOGR_NAME',
subfields => 'avxyz68',
subfields => 'agvxyz68',
main_entry => 1
},
'155' => {
@ -136,7 +136,7 @@ my $bib_heading_fields = {
},
'648' => { auth_type => 'CHRON_TERM', subfields => 'avxyz', subject => 1 },
'650' => { auth_type => 'TOPIC_TERM', subfields => 'abvxyz', subject => 1 },
'651' => { auth_type => 'GEOGR_NAME', subfields => 'avxyz', subject => 1 },
'651' => { auth_type => 'GEOGR_NAME', subfields => 'agvxyz', subject => 1 },
'655' => { auth_type => 'GENRE/FORM', subfields => 'avxyz', subject => 1 },
'690' => { auth_type => 'TOPIC_TERM', subfields => 'abvxyz', subject => 1 },
'691' => { auth_type => 'GEOGR_NAME', subfields => 'avxyz', subject => 1 },
@ -202,7 +202,7 @@ my $auth_heading_fields = {
},
'151' => {
auth_type => 'GEOGR_NAME',
subfields => 'avxyz68',
subfields => 'agvxyz68',
main_entry => 1
},
'155' => {

View File

@ -445,8 +445,9 @@ sub _allocateWithTransportCostMatrix {
my @allocated;
my @remaining_items = grep { !exists $allocated_items->{ $_->{itemnumber} } && $_->{holdallowed} ne 'not_allowed'; }
@$available_items;
my @remaining_items =
shuffle( grep { !exists $allocated_items->{ $_->{itemnumber} } && $_->{holdallowed} ne 'not_allowed'; }
@$available_items );
my @requests = grep { !defined $_->{itemnumber} && !defined $_->{allocated} } @$hold_requests;
my @remaining = ();

View File

@ -218,7 +218,7 @@ sub GetRecords {
my $biblioitem = $biblio->biblioitem->unblessed;
my $record = $biblio->metadata_record( { embed_items => 1 } );
my $record = $biblio->metadata_record( { embed_items => 1, interface => 'opac' } );
if ($record) {
$biblioitem->{marcxml} = $record->as_xml_record( C4::Context->preference('marcflavour') );
}

View File

@ -41,6 +41,7 @@ BEGIN {
SearchItems
PrepareItemrecordDisplay
ToggleNewStatus
GetAutomaticItemModificationAgeFields
);
}
@ -60,6 +61,7 @@ use Try::Tiny qw( catch try );
use Koha::AuthorisedValues;
use Koha::DateUtils qw( dt_from_string );
use Koha::Database;
use Koha::Logger;
use Koha::Biblios;
use Koha::Biblioitems;
@ -1238,6 +1240,7 @@ sub SearchItems {
} else {
my $sortby = (0 < grep {$params->{sortby} eq $_} @columns)
? $params->{sortby} : 'itemnumber';
$sortby = 'cn_sort' if $sortby eq 'itemcallnumber';
my $sortorder = (uc($params->{sortorder}) eq 'ASC') ? 'ASC' : 'DESC';
$query .= qq{ ORDER BY $sortby $sortorder };
}
@ -1596,6 +1599,25 @@ sub PrepareItemrecordDisplay {
};
}
=head2 GetAutomaticItemModificationAgeFields
my @fields = GetAutomaticItemModificationAgeFields();
Returns the fixed, C<items.>-prefixed list of date columns that are valid
"age field" values for automatic item modification rules (see
ToggleNewStatus below). This is the single source of truth for that
allow-list; it is shared with F<tools/automatic_item_modification_by_age.pl>
so the two cannot drift apart.
=cut
sub GetAutomaticItemModificationAgeFields {
return (
'items.dateaccessioned', 'items.replacementpricedate', 'items.datelastborrowed', 'items.datelastseen',
'items.damaged_on', 'items.itemlost_on', 'items.withdrawn_on'
);
}
sub ToggleNewStatus {
my ($params) = @_;
my @rules = @{ $params->{rules} };
@ -1606,17 +1628,32 @@ sub ToggleNewStatus {
my @item_columns = map { "items.$_" } Koha::Items->columns;
my @biblioitem_columns = map { "biblioitems.$_" } Koha::Biblioitems->columns;
my @biblio_columns = map { "biblio.$_" } Koha::Biblios->columns;
my @age_fields = GetAutomaticItemModificationAgeFields();
my $report;
for my $rule (@rules) {
my $age = $rule->{age};
# Default to using items.dateaccessioned if there's an old item modification rule
# missing an agefield value
my $agefield = $rule->{agefield} ? $rule->{agefield} : 'items.dateaccessioned';
# missing an agefield value, or if the stored value is not (or is no longer) a
# recognised age field - values are only trusted from a fixed allow-list since
# this is spliced directly into the SQL below and cannot be bound as a placeholder.
my $agefield = $rule->{agefield} // '';
unless ( grep { $_ eq $agefield } @age_fields ) {
Koha::Logger->get->warn(qq{Rejecting invalid agefield "$agefield" in automatic item modification rule})
if length $agefield;
$agefield = 'items.dateaccessioned';
}
my $conditions = $rule->{conditions};
my $substitutions = $rule->{substitutions};
foreach (@$substitutions) {
( $_->{item_field} ) = ( $_->{field} =~ /items\.(.*)/ );
foreach my $substitution (@$substitutions) {
my $field = $substitution->{field} // '';
if ( grep { $_ eq $field } @item_columns ) {
( $substitution->{item_field} ) = ( $field =~ /^items\.(.*)/ );
} else {
Koha::Logger->get->warn(
qq{Rejecting invalid substitution field "$field" in automatic item modification rule})
if length $field;
}
}
my @params;
@ -1641,6 +1678,9 @@ sub ToggleNewStatus {
$query .= qq| AND $condition->{field} = ?|;
push @params, $condition->{value};
}
} else {
Koha::Logger->get->warn(
qq{Rejecting invalid condition field "$condition->{field}" in automatic item modification rule});
}
}
if ( defined $age ) {
@ -1657,6 +1697,7 @@ sub ToggleNewStatus {
my $field = $substitution->{item_field};
my $value = $substitution->{value};
next unless $substitution->{field};
next unless defined $field;
next
if ( defined $values->{ $substitution->{item_field} }
and $values->{ $substitution->{item_field} } eq $substitution->{value} );

View File

@ -101,6 +101,7 @@ sub GetItemTypesCategorized {
FROM itemtypes
LEFT JOIN authorised_values ON searchcategory = authorised_value
WHERE searchcategory > '' and hideinopac=1
AND category = 'ITEMTYPECAT'
UNION
SELECT DISTINCT searchcategory AS `itemtype`,
COALESCE(authorised_values.lib_opac,authorised_values.lib) AS description,
@ -109,6 +110,7 @@ sub GetItemTypesCategorized {
FROM itemtypes
LEFT JOIN authorised_values ON searchcategory = authorised_value
WHERE searchcategory > '' and hideinopac=0
AND category = 'ITEMTYPECAT'
|;
return ($dbh->selectall_hashref($query,'itemtype'));
}
@ -488,8 +490,7 @@ sub GetAuthorisedValues {
my $opac = shift ? 1 : 0; # normalise to be safe
# Is this cached already?
my $branch_limit =
C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
my $branch_limit = C4::Context::mybranch();
my $cache_key =
"AuthorisedValues-$category-$opac-$branch_limit";
my $cache = Koha::Caches->get_instance();

View File

@ -7,6 +7,7 @@ use Text::Wrap qw( wrap );
use Algorithm::CheckDigits qw( CheckDigits );
use Text::CSV_XS;
use Text::Bidi qw( log2vis );
use GD::Barcode::Code39;
use C4::Context;
use C4::Biblio qw( GetMarcFromKohaField );
@ -372,8 +373,11 @@ sub draw_label_text {
my $font = $self->{'font'};
my $item = _get_label_item($self->{'item_number'});
my $label_fields = _get_text_fields($self->{'format_string'});
my $biblio = Koha::Biblios->find($item->{biblionumber});
my $record = $biblio->metadata->record;
my $biblio = Koha::Biblios->find($item->{'biblionumber'});
my $record;
if ( defined $biblio ) {
$record = $biblio->metadata->record;
}
# FIXME - returns all items, so you can't get data from an embedded holdings field.
# TODO - add a GetMarcBiblio1item(bibnum,itemnum) or a GetMarcItem(itemnum).
my $cn_source = ($item->{'cn_source'} ? $item->{'cn_source'} : C4::Context->preference('DefaultClassificationSource'));
@ -498,9 +502,6 @@ sub barcode {
my $guard_length = 10;
my $hide_text = 'yes';
if ($params{'barcode_type'} =~ m/CODE39/) {
$bar_length = '17.5';
$tot_bar_length = ($bar_length * $num_of_bars) + ($guard_length * 2);
$x_scale_factor = ($params{'width'} / $tot_bar_length);
if ($params{'barcode_type'} eq 'CODE39MOD') {
my $c39 = CheckDigits('code_39'); # get modulo43 checksum
$params{'barcode_data'} = $c39->complete($params{'barcode_data'});
@ -511,6 +512,11 @@ sub barcode {
$hide_text = '';
}
eval {
#NOTE: Barcode length algorithm comes from PDF::Reuse::Barcode
#NOTE: 20 is arbitrary padding added to the barcode background by PDF::Reuse::Barcode
my $oGdB = GD::Barcode::Code39->new("*$params{'barcode_data'}*");
my $whole_barcode_length = ( length( $oGdB->barcode() ) * 0.9 ) + 20;
$x_scale_factor = ( $params{'width'} / $whole_barcode_length );
PDF::Reuse::Barcode::Code39(
x => $params{'llx'},
y => $params{'lly'},

View File

@ -28,6 +28,7 @@ use List::MoreUtils qw( any );
use C4::Context;
use Koha::Caches;
use Koha::Cache::Memory::Lite;
use Koha::Language;
our (@ISA, @EXPORT_OK);
BEGIN {
@ -111,12 +112,19 @@ Returns a reference to an array of hashes:
=cut
sub getTranslatedLanguages {
my ($interface, $theme, $current_language, $which) = @_;
my ($interface, $theme, $current_language) = @_;
$interface //= q{};
$theme //= q{};
my @languages;
my @enabled_languages =
( $interface && $interface eq 'intranet' )
? split ",", C4::Context->preference('StaffInterfaceLanguages')
: split ",", C4::Context->preference('OPACLanguages');
my @enabled_languages;
if ($interface) {
if ($interface eq 'intranet') {
@enabled_languages = split ",", C4::Context->preference('StaffInterfaceLanguages');
} elsif ($interface eq 'opac') {
@enabled_languages = split ",", C4::Context->preference('OPACLanguages');
}
}
my $cache = Koha::Caches->get_instance;
my $cache_key = "languages_${interface}_${theme}";
@ -191,57 +199,81 @@ sub getLanguages {
my $lang = shift;
my $isFiltered = shift;
my @languages_loop;
my $dbh=C4::Context->dbh;
my $dbh = C4::Context->dbh;
my $default_language = 'en';
my $current_language = $default_language;
my $language_list = $isFiltered ? C4::Context->preference("AdvancedSearchLanguages") : undef;
if ($lang) {
$current_language = regex_lang_subtags($lang)->{'language'};
}
my $sth = $dbh->prepare('SELECT * FROM language_subtag_registry WHERE type=\'language\' ORDER BY description');
$sth->execute();
while (my $language_subtag_registry = $sth->fetchrow_hashref) {
my $desc;
# check if language name is stored in current language
my $sth4= $dbh->prepare("SELECT description FROM language_descriptions WHERE type='language' AND subtag =? AND lang = ?");
$sth4->execute($language_subtag_registry->{subtag},$current_language);
while (my $language_desc = $sth4->fetchrow_hashref) {
$desc=$language_desc->{description};
}
my $sth2= $dbh->prepare("SELECT * FROM language_descriptions LEFT JOIN language_rfc4646_to_iso639 on language_rfc4646_to_iso639.rfc4646_subtag = language_descriptions.subtag WHERE type='language' AND subtag =? AND language_descriptions.lang = ?");
if ($desc) {
$sth2->execute($language_subtag_registry->{subtag},$current_language);
}
else {
$sth2->execute($language_subtag_registry->{subtag},$default_language);
}
my $sth3 = $dbh->prepare("SELECT description FROM language_descriptions WHERE type='language' AND subtag=? AND lang=?");
# add the correct description info
while (my $language_descriptions = $sth2->fetchrow_hashref) {
$sth3->execute($language_subtag_registry->{subtag},$language_subtag_registry->{subtag});
my $native_description;
while (my $description = $sth3->fetchrow_hashref) {
$native_description = $description->{description};
}
# fill in the ISO6329 code
$language_subtag_registry->{iso639_2_code} = $language_descriptions->{iso639_2_code};
# fill in the current selected ui language's translation, as well as the native description of the language
if ($native_description) {
$language_subtag_registry->{language_description} = $language_descriptions->{description} || q{};
$language_subtag_registry->{language_description} .= " ($native_description)";
}
else {
$language_subtag_registry->{language_description} = $language_descriptions->{description};
}
}
# Do not push unless valid iso639-2 code
if ( $language_subtag_registry->{ iso639_2_code } and ( !$language_list || index ( $language_list, $language_subtag_registry->{ iso639_2_code } ) >= 0) ) {
push @languages_loop, $language_subtag_registry;
}
my $language_list = $isFiltered ? C4::Context->preference("AdvancedSearchLanguages") : undef;
my $language_list_cond = $language_list ? 'AND FIND_IN_SET(language_rfc4646_to_iso639.iso639_2_code, ?)' : '';
my $sth = $dbh->prepare("
SELECT
language_subtag_registry.*,
language_rfc4646_to_iso639.iso639_2_code,
CASE
-- If user's localized name of given lang is available
WHEN current_language_descriptions.description IS NOT NULL
THEN
CASE
-- Append native translation of given language if possible
WHEN native_language_descriptions.description IS NOT NULL
AND native_language_descriptions.description != current_language_descriptions.description
THEN CONCAT(current_language_descriptions.description, ' (', native_language_descriptions.description, ')')
ELSE current_language_descriptions.description
END
ELSE -- fall back to English description
CASE
-- Append native translation of given language if possible
WHEN native_language_descriptions.description IS NOT NULL
AND native_language_descriptions.description != language_subtag_registry.description
THEN CONCAT(language_subtag_registry.description, ' (', native_language_descriptions.description, ')')
ELSE language_subtag_registry.description
END
END AS language_description
-- Useful if debugging the query:
-- current_language_descriptions.description AS _current_language_descriptions_description,
-- native_language_descriptions.description AS _native_language_descriptions_description
FROM language_subtag_registry
-- Grab ISO code for language
INNER JOIN language_rfc4646_to_iso639
ON language_rfc4646_to_iso639.rfc4646_subtag = language_subtag_registry.subtag
AND language_rfc4646_to_iso639.iso639_2_code IS NOT NULL
-- Grab language name in user's current language
LEFT JOIN language_descriptions current_language_descriptions
ON current_language_descriptions.subtag = language_subtag_registry.subtag
AND current_language_descriptions.lang = ?
AND current_language_descriptions.type = 'language'
-- Grab language name in the given language itself
LEFT JOIN language_descriptions native_language_descriptions
ON native_language_descriptions.subtag = language_subtag_registry.subtag
AND native_language_descriptions.lang = language_subtag_registry.subtag
AND native_language_descriptions.type = 'language'
WHERE language_subtag_registry.type = 'language'
${language_list_cond}
ORDER BY language_rfc4646_to_iso639.iso639_2_code ASC");
if ($language_list) {
$sth->execute($current_language, join ',' => split(/,|\|/, $language_list));
} else {
$sth->execute($current_language);
}
return \@languages_loop;
my @languages_list;
while (my $row = $sth->fetchrow_hashref) {
push @languages_list, $row;
}
return \@languages_list;
}
sub _get_opac_language_dirs {
@ -618,8 +650,26 @@ sub accept_language {
=head2 getlanguage
Select a language based on the URL parameter 'language', a cookie,
syspref available languages & browser
Select a language based on:
=over
=item * the URL parameter 'language' (staff and opac interfaces only),
=item * the 'KohaOpacLanguage' cookie (staff and opac interfaces only),
=item * the language set by C<Koha::Language::set_requested_language>
(interfaces other than staff and opac only). The REST API sets this to the
value of 'KohaOpacLanguage' cookie,
=item * syspref StaffInterfaceLanguages (staff only)
=item * syspref OpacLanguages (opac only),
=item * HTTP header Accept-Language (more precisely, environment variable
HTTP_ACCEPT_LANGUAGE)
=back
=cut
@ -633,29 +683,36 @@ sub getlanguage {
return $cached if $cached;
}
$cgi //= CGI->new;
my $interface = C4::Context->interface;
my $theme = C4::Context->preference( ( $interface eq 'opac' ) ? 'opacthemes' : 'template' );
my $theme = '';
my $language;
my $preference_to_check =
$interface eq 'intranet' ? 'StaffInterfaceLanguages' : 'OPACLanguages';
# Get the available/valid languages list
my @languages;
my $preference_value = C4::Context->preference($preference_to_check);
if ($preference_value) {
@languages = split /,/, $preference_value;
}
# Chose language from the URL
my $cgi_param_language = $cgi->param( 'language' );
if ( defined $cgi_param_language && any { $_ eq $cgi_param_language } @languages) {
$language = $cgi_param_language;
}
if ($interface eq 'opac' || $interface eq 'intranet') {
$cgi //= CGI->new;
$theme = C4::Context->preference( ( $interface eq 'opac' ) ? 'opacthemes' : 'template' );
# cookie
if (not $language and my $cgi_cookie_language = $cgi->cookie('KohaOpacLanguage') ) {
( $language = $cgi_cookie_language ) =~ s/[^a-zA-Z_-]*//; # sanitize cookie
my $preference_to_check =
$interface eq 'intranet' ? 'StaffInterfaceLanguages' : 'OPACLanguages';
# Get the available/valid languages list
my $preference_value = C4::Context->preference($preference_to_check);
if ($preference_value) {
@languages = split /,/, $preference_value;
}
# Choose language from the URL
my $cgi_param_language = $cgi->param( 'language' );
if ( defined $cgi_param_language && any { $_ eq $cgi_param_language } @languages) {
$language = $cgi_param_language;
}
# cookie
if (not $language and my $cgi_cookie_language = $cgi->cookie('KohaOpacLanguage') ) {
( $language = $cgi_cookie_language ) =~ s/[^a-zA-Z_-]*//; # sanitize cookie
}
} else {
@languages = map { $_->{rfc4646_subtag} } @{ getTranslatedLanguages($interface, $theme) };
$language = Koha::Language->get_requested_language();
}
# HTTP_ACCEPT_LANGUAGE

View File

@ -40,6 +40,7 @@ use Koha::Patrons;
use Koha::SMS::Providers;
use Koha::SMTP::Servers;
use Koha::Subscriptions;
use Koha::Template::Plugin::KohaDates;
use constant SERIALIZED_EMAIL_CONTENT_TYPE => 'message/rfc822';
@ -307,7 +308,7 @@ sub SendAlerts {
my $subscription = Koha::Subscriptions->find( $subscriptionid );
my $subscribers = $subscription->subscribers;
while ( my $patron = $subscribers->next ) {
my $email = $patron->email or next;
my $email = $patron->notice_email_address or next;
# warn "sending issues...";
my $userenv = C4::Context->userenv;
@ -638,6 +639,10 @@ sub GetPreparedLetter {
$lang = shift @languages;
}
$Template::Stash::SCALAR_OPS->{strftime} = sub {
return Koha::Template::Plugin::KohaDates->strftime(@_);
};
$letter->{content} = _process_tt(
{
content => $letter->{content},
@ -1734,8 +1739,14 @@ sub _process_tt {
my $use_template_cache = C4::Context->config('template_cache_dir') && defined $ENV{GATEWAY_INTERFACE};
my $template = Template->new(
{
EVAL_PERL => 1,
ABSOLUTE => 1,
EVAL_PERL => 0,
ABSOLUTE => 0,
RELATIVE => 0,
PLUGINS => {
cgi => 'Koha::Template::Plugin::noop',
directory => 'Koha::Template::Plugin::noop',
file => 'Koha::Template::Plugin::noop',
},
PLUGIN_BASE => 'Koha::Template::Plugin',
COMPILE_EXT => $use_template_cache ? '.ttc' : '',
COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '',

View File

@ -655,6 +655,12 @@ sub get_matches {
# Use state variables to avoid recreating the objects every time.
# With Elasticsearch this also avoids creating a massive amount of
# ES connectors that would eventually run out of file descriptors.
state $query_builder =
Koha::SearchEngine::QueryBuilder->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } );
( undef, $query ) = $query_builder->build_query_compat(
undef, [$query], undef, undef, undef, undef, undef,
{ skip_facets => 1 }
);
state $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX});
( $error, $searchresults, $total_hits ) =
$searcher->simple_search_compat( $query, 0, $max_matches, undef, skip_normalize => 1 );

View File

@ -93,14 +93,14 @@ sub Getoverdues {
if ( C4::Context->preference('item-level_itypes') ) {
$statement = "
SELECT issues.*, items.itype as itemtype, items.homebranch, items.barcode, items.itemlost, items.replacementprice, items.biblionumber, items.holdingbranch
FROM issues
FROM issues
LEFT JOIN items USING (itemnumber)
WHERE date_due < NOW()
";
} else {
$statement = "
SELECT issues.*, biblioitems.itemtype, items.itype, items.homebranch, items.barcode, items.itemlost, replacementprice, items.biblionumber, items.holdingbranch
FROM issues
FROM issues
LEFT JOIN items USING (itemnumber)
LEFT JOIN biblioitems USING (biblioitemnumber)
WHERE date_due < NOW()
@ -223,6 +223,23 @@ sub CalcFine {
# Skip calculations if item is not overdue
return ( 0, 0, 0 ) unless (DateTime->compare( $due_dt, $end_date ) == -1);
# Call the plugin hook overwrite_calc_fine of all plugins and return
# the first defined fine.
my @fines = grep { defined $_ } Koha::Plugins->call(
'overwrite_calc_fine',
{
itemnumber => $item->{itemnumber},
borrowernumber => $item->{borrowernumber},
categorycode => $bortype,
branchcode => $branchcode,
due_date => $due_dt,
end_date => $end_date,
}
);
return @{ $fines[0] }
if scalar @fines;
my $start_date = $due_dt->clone();
# get issuingrules (fines part will be used)
my $itemtype = $item->{itemtype} || $item->{itype};
@ -645,7 +662,7 @@ C<$itemnum> is item number
C<$borrowernumber> is the borrowernumber
=cut
=cut
sub GetFine {
my ( $itemnum, $borrowernumber ) = @_;

View File

@ -286,7 +286,7 @@ sub draw_text {
# $font_units_width = $m->string_width($line);
# $string_width = ($font_units_width * $text_attribs->{'font_size'}) / $units_per_em;
if ( ( $string_width + $text_attribs->{'llx'} ) < $self->{'width'} ) {
if ( $string_width && ( ( $string_width + $text_attribs->{'llx'} ) < $self->{'width'} ) ) {
( $Tx, $Tw ) = text_alignment(
$origin_llx, $self->{'width'}, $text_attribs->{'llx'}, $string_width, $line,
$text_attribs->{'text_alignment'}

View File

@ -889,6 +889,7 @@ sub marc2cites {
if ( $marcflavour eq "UNIMARC" ) {
%publication = (
title => $record->subfield( "200", "a" ) || "",
subtitle => $record->subfield( "200", "e" ) || "",
place => $record->subfield( "210", "a" ) || "",
publisher => $record->subfield( "210", "c" ) || "",
date => $record->subfield( "210", "d" ) || $record->subfield( "210", "h" ) || ""
@ -896,6 +897,7 @@ sub marc2cites {
} else {
%publication = (
title => $record->subfield( "245", "a" ) || "",
subtitle => $record->subfield( "245", "b" ) || "",
place => $record->subfield( "264", "a" ) || $record->subfield( "260", "a" ) || "",
publisher => $record->subfield( "264", "b" ) || $record->subfield( "260", "b" ) || "",
date => $record->subfield( "264", "c" )
@ -936,13 +938,16 @@ sub marc2cites {
if ( $publication{date} ) {
$cites{'Harvard'} .= ' (' . $publication{'date'} . '). ';
$cites{'Chicago'} .= ' ' . $publication{'date'} . '. ';
$cites{'MLA'} .= ' ' . $publication{'title'} . '. ';
$cites{'APA'} .= ' (' . $publication{'date'} . '). ';
$cites{'MLA'} .=
' ' . $publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. ';
$cites{'APA'} .= ' (' . $publication{'date'} . '). ';
}
$cites{'Harvard'} .= $publication{'title'} . '. ';
$cites{'Chicago'} .= $publication{'title'} . '. ';
$cites{'MLA'} .= $publication{'place'} . ': ';
$cites{'APA'} .= $publication{'title'} . '. ';
$cites{'Harvard'} .=
$publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. ';
$cites{'Chicago'} .=
$publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. ';
$cites{'MLA'} .= $publication{'place'} . ': ';
$cites{'APA'} .= $publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. ';
$cites{'Harvard'} .= $publication{'place'} . ': ';
$cites{'Chicago'} .= $publication{'place'} . ': ';
$cites{'MLA'} .= $publication{'publisher'} . '. ';

View File

@ -63,6 +63,10 @@ sub GetDelimiterChoices {
my ($choices, $default) = $sth->fetchrow;
my @dels = split /\|/, $choices;
#See BZ 41834 to see why this kludge is used here in older versions
# Use the centralized list of allowed delimiters from C4::Context
@dels = C4::Context::ALLOWED_CSV_DELIMITERS;
return {
values => \@dels,
default => $default,

View File

@ -191,42 +191,39 @@ This will return a list of all columns for a report area
=cut
sub get_columns {
# this calls the internal function _get_columns
my ( $area, $cgi ) = @_;
my ($area) = @_;
my %table_areas = get_table_areas;
my $tables = $table_areas{$area}
or die qq{Unsuported report area "$area"};
my $tables = $table_areas{$area}
or die qq{Unsupported report area "$area"};
my @allcolumns;
my $first = 1;
foreach my $table (@$tables) {
my @columns = _get_columns($table,$cgi, $first);
$first = 0;
push @allcolumns, @columns;
my $columns;
for my $table (@$tables) {
$columns->{$table} = _get_columns($table);
}
return ( \@allcolumns );
return $columns;
}
sub _get_columns {
my ($tablename,$cgi, $first) = @_;
my $dbh = C4::Context->dbh();
my $sth = $dbh->prepare("show columns from $tablename");
$sth->execute();
my @columns;
my $columns = Koha::Database::Columns->columns;
my %tablehash;
$tablehash{'table'}=$tablename;
$tablehash{'__first__'} = $first;
push @columns, \%tablehash;
while ( my $data = $sth->fetchrow_arrayref() ) {
my %temphash;
$temphash{'name'} = "$tablename.$data->[0]";
$temphash{'description'} = $columns->{$tablename}->{$data->[0]};
push @columns, \%temphash;
}
$sth->finish();
return (@columns);
my ($table_name) = @_;
my $dbh = C4::Context->dbh();
my $all_columns = Koha::Database::Columns->columns;
# Sanitize input, just in case
die sprintf( 'Invalid table name %s', $table_name ) unless exists $all_columns->{$table_name};
my $columns = $dbh->selectall_arrayref( sprintf( q{SHOW COLUMNS FROM %s}, $table_name ), { Slice => {} } );
return [
map {
my $column_name = $_->{Field};
my $forbidden = Koha::Report->new->check_columns( undef, [$column_name] );
$forbidden ? () : (
{
name => sprintf( "%s.%s", $table_name, $column_name ),
description => $all_columns->{$table_name}->{$column_name},
}
);
} @$columns
];
}
=head2 build_query($columns,$criteria,$orderby,$area)

View File

@ -408,7 +408,7 @@ sub CanBookBeReserved{
$items = Koha::Items->search({
-or => [
biblionumber => $biblionumber,
itemnumber => { -in => @hostitemnumbers }
itemnumber => { -in => \@hostitemnumbers }
]
});
} else {
@ -835,10 +835,11 @@ sub CheckReserves {
my $dont_trap = C4::Context->preference('TrapHoldsOnOrder') ? $item->notforloan > 0 : $item->notforloan;
if ( !$dont_trap ) {
my $item_type = $item->effective_itemtype;
if ( $item_type ) {
return if Koha::ItemTypes->find( $item_type )->notforloan;
}
my $effective_item_type = $item->effective_itemtype;
my $item_type = Koha::ItemTypes->find($effective_item_type);
return
if $item_type && $item_type->notforloan;
}
else {
return;
@ -1337,9 +1338,9 @@ sub IsAvailableForItemLevelRequest {
my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } );
if ( $on_shelf_holds == 1 ) {
if ( $on_shelf_holds == 1 ) { # Allow
return 1;
} elsif ( $on_shelf_holds == 2 ) {
} elsif ( $on_shelf_holds == 2 ) { # If all unavailable
# These calculations work at the biblio level, and can be expensive
# we use the in-memory cache to avoid calling once per item when looping items on a biblio
@ -1355,7 +1356,7 @@ sub IsAvailableForItemLevelRequest {
$memory_cache->set_in_cache( $cache_key, $any_available );
return $any_available ? 0 : 1;
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved)
} else { # on_shelf_holds == 0 [If any unavailable]
return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count;
}
}
@ -1776,8 +1777,9 @@ sub _koha_notify_reserve {
message_name => 'Hold_Filled'
} );
my $library = Koha::Libraries->find( $hold->branchcode );
my $from_email_address = $library->from_email_address;
my $library = Koha::Libraries->find( $hold->branchcode );
my $from_email_address = $library->from_email_address;
my $reply_email_address = $library->inbound_email_address;
my %letter_params = (
module => 'reserves',
@ -1812,6 +1814,7 @@ sub _koha_notify_reserve {
letter => $letter,
borrowernumber => $borrowernumber,
from_address => $from_email_address,
reply_address => $reply_email_address,
message_transport_type => $mtt,
}
);
@ -1831,21 +1834,22 @@ sub _koha_notify_reserve {
};
while ( my ( $mtt, $letter_code ) = each %{ $messagingprefs->{transports} } ) {
next if (
if (
( $mtt eq 'email' and not $to_address ) # No email address
or ( $mtt eq 'sms' and not $patron->smsalertnumber ) # No SMS number
or ( $mtt eq 'itiva' and C4::Context->preference('TalkingTechItivaPhoneNotification') ) # Notice is handled by TalkingTech_itiva_outbound.pl
or ( $mtt eq 'phone' and not $patron->phone ) # No phone number to call
);
&$send_notification($mtt, $letter_code, $messagingprefs->{wants_digest});
)
{
unless ($notification_sent) {
$notification_sent++;
}
#Making sure that a print notification is sent if no other transport types can be utilized.
if (! $notification_sent) {
&$send_notification('print', 'HOLD');
}
next;
}
&$send_notification( $mtt, $letter_code, $messagingprefs->{wants_digest} );
}
}
=head2 _koha_notify_hold_changed
@ -1958,22 +1962,26 @@ sub MoveReserve {
my $lookahead = C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds
my $item = Koha::Items->find($itemnumber);
my ( $restype, $res, undef ) = CheckReserves( $item, $lookahead );
return unless $res;
my $biblionumber = $res->{biblionumber};
if ($res->{borrowernumber} == $borrowernumber) {
if ( $res &&$res->{borrowernumber} == $borrowernumber) {
my $hold = Koha::Holds->find( $res->{reserve_id} );
$hold->fill({ item_id => $itemnumber });
}
else {
# warn "Reserved";
# The item is reserved by someone else.
# Find this item in the reserves
my $lookahead_date = output_pref(
{
dt => dt_from_string->add_duration( DateTime::Duration->new( days => $lookahead ) ),
dateformat => 'iso', dateonly => 1
}
);
my $borr_res = Koha::Holds->search({
borrowernumber => $borrowernumber,
biblionumber => $biblionumber,
biblionumber => $item->biblionumber,
reservedate => { '<=' => $lookahead_date },
-or => [ item_level_hold => 0, itemnumber => $itemnumber ],
},{
order_by => 'priority'
})->next();
@ -2067,6 +2075,8 @@ sub RevertWaitingStatus {
}
)->next;
my $original = C4::Context->preference('HoldsLog') ? $hold->unblessed : undef;
## Increment the priority of all other non-waiting
## reserves for this bib record
my $holds = Koha::Holds->search({ biblionumber => $hold->biblionumber, priority => { '>' => 0 } })
@ -2083,7 +2093,7 @@ sub RevertWaitingStatus {
}
)->store( { hold_reverted => 1 } );
logaction( 'HOLDS', 'MODIFY', $hold->id, $hold )
logaction( 'HOLDS', 'MODIFY', $hold->id, $hold, undef, $original )
if C4::Context->preference('HoldsLog');
_FixPriority( { biblionumber => $hold->biblionumber } );

View File

@ -138,12 +138,36 @@ sub checkout {
# BEGIN TRANSACTION
$circ->patron( $patron = C4::SIP::ILS::Patron->new($patron_id) );
$circ->item( $item = C4::SIP::ILS::Item->new($item_id) );
if ($fee_ack) {
$circ->fee_ack($fee_ack);
}
if ( !$patron ) {
$circ->screen_msg("Invalid Patron");
}
elsif ( !$item ) {
$circ->screen_msg("Invalid Item");
}
elsif ( $no_block_due_date ) {
# A no block due date means we need check this item out to the patron
# regardless if fines, restrictions or any other things that would
# typically prevent a patron from checking out.
# A no block transaction is used for send offline ( store and forward )
# transaction to Koha. The patron already has possession of the item
# so it should be checked out to the patron no matter what.
$circ->do_checkout( $account, $no_block_due_date );
$item->{borrowernumber} = $patron_id;
$item->{due_date} = $circ->{due};
push( @{ $patron->{items} }, { barcode => $item_id } );
$circ->desensitize( !$item->magnetic_media );
siplog(
"LOG_DEBUG", "ILS::Checkout: patron %s has checked out %s via a no block checkout",
$patron_id, join( ', ', map { $_->{barcode} } @{ $patron->{items} } )
);
}
elsif ( !$patron->charge_ok ) {
if ($patron->debarred) {
$circ->screen_msg("Patron debarred");
@ -163,9 +187,6 @@ sub checkout {
$circ->screen_msg("Patron blocked");
}
}
elsif ( !$item ) {
$circ->screen_msg("Invalid Item");
}
elsif (
$item->{borrowernumber}
&& !C4::Context->preference('AllowItemsOnLoanCheckoutSIP')
@ -178,7 +199,9 @@ sub checkout {
$circ->screen_msg("Item type cannot be checked out at this checkout location");
}
else {
$circ->do_checkout($account, $no_block_due_date);
# No block checkouts were handled earlier so there is no need
# to bass the no block due date here.
$circ->do_checkout($account);
if ( $circ->ok ) {
# If the item is already associated with this patron, then

View File

@ -67,13 +67,14 @@ sub new {
my $debarred = $patron->is_debarred;
siplog( "LOG_DEBUG", "Debarred = %s : ", ( $debarred || 'undef' ) ); # Do we need more debug info here?
my $expired = 0;
if ( $kp->{'dateexpiry'} && C4::Context->preference('NotifyBorrowerDeparture') ) {
if ( $kp->{'dateexpiry'} ) {
my ( $today_year, $today_month, $today_day ) = Today();
my ( $warning_year, $warning_month, $warning_day ) = split /-/, $kp->{'dateexpiry'};
my $days_to_expiry = Date_to_Days( $warning_year, $warning_month, $warning_day ) -
Date_to_Days( $today_year, $today_month, $today_day );
my $dt = dt_from_string( $kp->{'dateexpiry'}, 'iso' );
my $dateexpiry = output_pref( { dt => $dt, dateonly => 1 } );
my $notifyBorrowerDeparture = C4::Context->preference('NotifyBorrowerDeparture') // 0;
if ( $days_to_expiry < 0 ) {
#borrower card has expired, warn the borrower
@ -82,7 +83,7 @@ sub new {
}
$kp->{opacnote} .= "Your account has expired as of $dateexpiry";
$expired = 1;
} elsif ( $days_to_expiry < C4::Context->preference('NotifyBorrowerDeparture') ) {
} elsif ( $days_to_expiry < $notifyBorrowerDeparture ) {
# borrower card soon to expire, warn the borrower
if ( $kp->{opacnote} ) {
@ -205,7 +206,7 @@ sub new {
while ( my $message = $patron_messages->next ) {
my $messagedt = dt_from_string( $message->message_date, 'iso' );
my $formatted_date = output_pref( { dt => $messagedt, dateonly => 1 } );
push @messages_array, $formatted_date . ": " . $message->message;
push @messages_array, $formatted_date . ": " . $message->message_without_newlines;
}
if (@messages_array) {
$ilspatron{screen_msg} .= " Messages for you: " . join( ' / ', @messages_array );
@ -790,4 +791,3 @@ __END__
{itemlist} ref-to-array: list of available items
=cut

View File

@ -78,6 +78,15 @@ sub do_checkin {
my ( $return, $messages, $issue, $borrower );
my $item = Koha::Items->find( { barcode => $barcode } );
if ($item) {
my $waiting_holds_to_be_cancelled = $item->holds->waiting->filter_by_has_cancellation_requests;
while ( my $hold = $waiting_holds_to_be_cancelled->next ) {
my $cancellation_request = $hold->cancellation_requests;
$cancellation_request->delete;
my $cancel_params->{cancellation_reason} = "Cancelled by SIP";
$hold->cancel($cancel_params);
}
}
my $human_required = 0;
if ( C4::Context->preference("CircConfirmItemParts")
@ -261,7 +270,7 @@ sub _get_sort_bin {
# Get the mapping and split on newlines
my $raw_map = C4::Context->preference('SIP2SortBinMapping');
return unless $raw_map;
@lines = split /\r\n/, $raw_map;
@lines = split /\R/, $raw_map;
}
# Iterate over the mapping. The first hit wins.

View File

@ -152,11 +152,14 @@ sub do_checkout {
if ( $no_block_due_date ) {
$overridden_duedate = $no_block_due_date;
ProcessOfflineIssue({
my ( $msg, $checkout ) = ProcessOfflineIssue({
cardnumber => $patron->cardnumber,
barcode => $barcode,
timestamp => $no_block_due_date,
due_date => $no_block_due_date,
timestamp => dt_from_string,
});
$self->{due} = $self->duedatefromissue( $checkout, $itemnumber );
} else {
# can issue
my $recall_id;

View File

@ -229,6 +229,7 @@ sub process_request {
Koha::Caches->flush_L1_caches();
$self->{account} = undef; # Clear out the account from the last request, it may be different
$self->{ils} = undef; # And the ILS handle, so a reused worker can't reuse a prior session's connection
$self->{logger} = set_logger( Koha::Logger->get( { interface => 'sip' } ) );
# Flush previous MDCs to prevent accidentally leaking incorrect MDC-entries
@ -313,8 +314,9 @@ sub raw_transport {
Koha::Logger->put_mdc( "peeraddr", $self->{server}->{peeraddr} );
siplog("LOG_DEBUG", "raw_transport: uname/inst: '%s/%s'",
$self->{account}->{id},
$self->{account}->{institution});
$self->{account}->{id} // 'undef',
$self->{account}->{institution} // 'undef'
);
if (! $self->{account}->{id}) {
siplog("LOG_ERR","Login failed shutting down");
return;
@ -382,11 +384,11 @@ sub telnet_transport {
siplog("LOG_DEBUG", "telnet_transport 2: uid length %s, pwd length %s", length($uid), length($pwd));
if (exists ($config->{accounts}->{$uid})
&& ($pwd eq $config->{accounts}->{$uid}->{password})) {
&& ($pwd eq $config->{accounts}->{$uid}->{password})
&& C4::SIP::Sip::MsgType::login_core( $self, $uid, $pwd ) )
{
$account = $config->{accounts}->{$uid};
if ( C4::SIP::Sip::MsgType::login_core($self,$uid,$pwd) ) {
last;
}
last;
}
siplog("LOG_WARNING", "Invalid login attempt: '%s'", ($uid||''));
print("Invalid login$CRLF");
@ -486,8 +488,11 @@ sub read_request {
chomp $buffer;
$raw_length = length $buffer;
$buffer =~ s/^\s*[^A-z0-9]+//s;
# Every line must start with a "real" character. Not whitespace, control chars, etc.
$buffer =~ s/[^A-z0-9]+$//s;
# Remove leading/trailing control characters and whitespace.
# SIP2 messages should be a single printable line; this defensively
# cleans up stray CR/LF or junk from buggy or long-lived client connections.
$buffer =~ s/^[[:cntrl:]\s]+//;
$buffer =~ s/[[:cntrl:]\s]+$//;
# Same for the end. Note this catches the problem some clients have sending empty fields at the end, like |||
$buffer =~ s/\015?\012//g; # Extra line breaks must die

View File

@ -1,6 +1,9 @@
#
# Sip.pm: General Sip utility functions
#
=head1 NAME
C4::SIP::Sip - General Sip utility functions
=cut
package C4::SIP::Sip;
@ -69,8 +72,8 @@ sub add_field {
$field_id);
$value = '';
}
$value=~s/\r/ /g; # CR terminates a sip message
# Protect against them in sip text fields
$value =~ s/\r\n|\r|\n/ /g; # CR or LF terminates a sip message
# Protect against them in sip text fields
# Replace any occurrences of the field delimiter in the
# field value with the HTML character entity
@ -228,10 +231,63 @@ sub siplog {
: $level eq 'LOG_WARNING' ? 'warn'
: 'error';
my $message = @args ? sprintf($mask, @args) : $mask;
my $message;
if (@args) {
# Replace undefined values with 'undef' to prevent sprintf warnings
my @safe_args = map { defined($_) ? $_ : 'undef' } @args;
$message = sprintf( $mask, @safe_args );
} else {
$message = $mask;
}
$message = remove_password_from_message($message);
my $logger = C4::SIP::Logger::get_logger();
$logger->$method($message) if $logger;
}
=head2 remove_password_from_message
my $safe_message = remove_password_from_message( $message );
Look for the fields AC, AD and CO, and replace contents with three asterisks.
We do this by looking for:
delimiter + AC/AD/CO + something + delimiter
and replacing it with:
delimiter + field name + asterisks + delimiter
Messages and fields that can contain passwords:
23 Patron Status Request - AC terminal password - AD patron password
11 Checkout - AC terminal password - AD patron password
09 Checkin - AC terminal password
01 Block Patron - AC terminal password
93 Login - CO login password
63 Patron Information - AC terminal password - AD patron password
35 End Patron Session - AC terminal password - AD patron password
37 Fee Paid - AC terminal password - AD patron password
17 Item Information - AC terminal password
19 Item Status Update - AC terminal password
25 Patron Enable - AC terminal password- AD patron password
15 Hold - AC terminal password - AD patron password
29 Renew - AC terminal password - AD patron password
65 Renew All - AC terminal password - AD patron password
=cut
sub remove_password_from_message {
my ($message) = @_;
# regex does not work with (AC|AD|CO), probably due to .*? and the g modifier
# NOTE: Does not work correctly if the password contains a field delimiter, but you cannot login either.
$message =~ s/\Q${field_delimiter}\E$_.*?\Q${field_delimiter}\E/${field_delimiter}$_***${field_delimiter}/g
for ( 'AC', 'AD', 'CO' );
return $message;
}
1;

View File

@ -324,7 +324,23 @@ sub _initialize {
} elsif ( defined( $self->{fields}->{$fn} ) ) {
siplog( "LOG_WARNING", "Duplicate field '%s' (previous value '%s') in %s message '%s'", $fn, $self->{fields}->{$fn}, $self->{name}, $msg );
} else {
$self->{fields}->{$fn} = substr( $field, 2 );
my $field_value = substr( $field, 2 );
$self->{fields}->{$fn} = $field_value;
# Enhanced debug logging for empty critical fields that could cause constraint errors
if ( defined $field_value && $field_value eq '' ) {
if ( $fn eq FID_PATRON_ID ) {
siplog(
"LOG_DEBUG", "Empty patron_id detected in %s message - could cause constraint errors",
$self->{name}
);
} elsif ( $fn eq FID_ITEM_ID ) {
siplog(
"LOG_DEBUG", "Empty item_id detected in %s message - could cause constraint errors",
$self->{name}
);
}
}
}
}
@ -339,7 +355,7 @@ sub handle {
# Set system preference overrides, first global, then account level
# Clear overrides from previous message handling first
foreach my $key ( keys %ENV ) {
delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') > 0;
delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') == 0;
}
foreach my $key ( keys %{ $config->{'syspref_overrides'} } ) {
$ENV{"OVERRIDE_SYSPREF_$key"} = $config->{'syspref_overrides'}->{$key};
@ -861,6 +877,13 @@ sub login_core {
my $uid = shift;
my $pwd = shift;
my $status = 1; # Assume it all works
# Clear any session state up front, including anything left over from a previous connection
# on this preforked worker, so no login_core exit path can leave the caller acting as an
# authenticated terminal. Only a successful api_auth below re-establishes the session.
delete $server->{$_} foreach qw( account ils institution policy sip_username sip_password );
if ( !exists( $server->{config}->{accounts}->{$uid} ) ) {
siplog( "LOG_WARNING", "MsgType::login_core: Unknown login '$uid'" );
$status = 0;
@ -869,19 +892,21 @@ sub login_core {
$status = 0;
} else {
# Store the active account someplace handy for everybody else to find.
$server->{account} = $server->{config}->{accounts}->{$uid};
my $inst = $server->{account}->{institution};
$server->{institution} = $server->{config}->{institutions}->{$inst};
$server->{policy} = $server->{institution}->{policy};
$server->{sip_username} = $uid;
$server->{sip_password} = $pwd;
# Authenticate before storing the account on the session
my $inst = $server->{config}->{accounts}->{$uid}->{institution};
my $auth_status = api_auth( $uid, $pwd, $inst );
if ( !$auth_status or $auth_status !~ /^ok$/i ) {
siplog( "LOG_WARNING", "api_auth failed for SIP terminal '%s' of '%s': %s", $uid, $inst, ( $auth_status || 'unknown' ) );
$status = 0;
} else {
# Store the active account configuration now user has authenticated
$server->{account} = $server->{config}->{accounts}->{$uid};
$server->{institution} = $server->{config}->{institutions}->{$inst};
$server->{policy} = $server->{institution}->{policy};
$server->{sip_username} = $uid;
$server->{sip_password} = $pwd;
siplog( "LOG_INFO", "Successful login/auth for '%s' of '%s'", $server->{account}->{id}, $inst );
#
@ -1289,10 +1314,10 @@ sub handle_item_information {
: timestamp( $item->due_date );
$resp .= add_field( FID_DUE_DATE, $due_date, $server );
}
if ( ( $i = $item->recall_date ) != 0 ) {
if ( $i = $item->recall_date ) {
$resp .= add_field( FID_RECALL_DATE, timestamp($i), $server );
}
if ( ( $i = $item->hold_pickup_date ) != 0 ) {
if ( $i = $item->hold_pickup_date ) {
$resp .= add_field( FID_HOLD_PICKUP_DATE, timestamp($i), $server );
}

View File

@ -57,4 +57,19 @@ sub BINMODE {
binmode( STDOUT, $mode );
};
=head2 DIE signal handler
A global die handler to capture fatal errors and ensures they are logged.
When DIE is emitted, the message will be logged using Koha::Logger if available,
and also printed to stderr
=cut
$SIG{__DIE__} = sub {
my $msg = shift;
my $logger = Koha::Logger->get( { interface => 'sip', category => 'STDERR' } );
$logger->error($msg) if $logger;
die $msg;
};
1;

View File

@ -28,19 +28,15 @@ use C4::Context;
my %scrubbertypes = (
default => {}, # place holder, default settings are below as fallbacks in call to constructor
tag => {}, # uses defaults
comment => { allow => [qw( br b i em big small strong )], },
note => { allow => [qw[ br b i em big small strong u hr span div p ]] },
staff => {
default => [ 1 => { '*' => 1 } ],
comment => 1,
},
note => { allow => [qw[ br b i em big small strong u hr span div p ol ul li dl dt dd ]] },
);
sub new {
shift; # ignore our class we are wrapper
my $type = (@_) ? shift : 'default';
$type = 'default' if !defined $type;
if ( !exists $scrubbertypes{$type} ) {
croak "New called with unrecognized type '$type'";
}
@ -50,7 +46,6 @@ sub new {
rules => exists $settings->{rules} ? $settings->{rules} : [],
default => exists $settings->{default} ? $settings->{default} : [ 0 => { '*' => 0 } ],
comment => exists $settings->{comment} ? $settings->{comment} : 0,
note => exists $settings->{note} ? $settings->{note} : 0,
process => 0,
);
return $scrubber;

View File

@ -1907,29 +1907,22 @@ sub searchResults {
# is item a waiting recall?
my $recallstatus = '';
unless ($item->{withdrawn}
# Check some statuses before checking transfer info, respect MaxSearchResultsItemsPerRecordStatusCheck
unless (
$item->{withdrawn}
|| $item->{itemlost}
|| $item->{damaged}
|| $item->{notforloan}
|| ( C4::Context->preference('MaxSearchResultsItemsPerRecordStatusCheck')
&& $items_count > C4::Context->preference('MaxSearchResultsItemsPerRecordStatusCheck') ) ) {
# A couple heuristics to limit how many times
# we query the database for item transfer information, sacrificing
# accuracy in some cases for speed;
#
# 1. don't query if item has one of the other statuses
# 2. don't check transit status if the bib has
# more than 20 items
#
# FIXME: to avoid having the query the database like this, and to make
# the in transit status count as unavailable for search limiting,
# should map transit status to record indexed in Zebra.
my $item_object = Koha::Items->find($item->{itemnumber});
my $transfer = defined($item_object) ? $item_object->get_transfer : undef;
( $transfertwhen, $transfertfrom, $transfertto ) =
defined($transfer)
# NOTE: We are bypassing an expected Koha::Item->get_transfer call here for speed.
# TODO: Could we index the transfer status ?
my $transfer = Koha::Item::Transfers->search(
{ itemnumber => $item->{itemnumber}, datearrived => undef, datecancelled => undef },
{ order_by => [ { '-desc' => 'datesent' }, { '-asc' => 'daterequested' } ] }
)->next;
( $transfertwhen, $transfertfrom, $transfertto ) = defined($transfer)
? (
$transfer->datesent, $transfer->frombranch,
$transfer->tobranch

View File

@ -1874,6 +1874,8 @@ sub GetLateOrMissingIssues {
my ( $supplierid, $serialid, $order ) = @_;
return unless ( $supplierid or $serialid );
return if defined $supplierid && !looks_like_number($supplierid);
return if defined $serialid && !looks_like_number($serialid);
my $dbh = C4::Context->dbh;

View File

@ -31,6 +31,7 @@ C4::Templates - Object for manipulating templates for use with Koha
use base qw(Class::Accessor);
use Template;
use Template::Filters;
use C4::Languages qw( get_bidi getTranslatedLanguages regex_lang_subtags );
use C4::Context;
@ -41,6 +42,7 @@ use Koha::Exceptions;
__PACKAGE__->mk_accessors(qw( theme activethemes preferredtheme lang filename htdocs interface vars));
Template::Filters->use_rfc3986();
sub new {
my $class = shift;

View File

@ -36,27 +36,8 @@ hea.koha-community.org is the server that centralize Koha setups informations
Koha libraries are encouraged to provide informations about their collections,
their structure,...
=head2 NeedUpdate
$needUpdateYN = C4::UsageStats::NeedUpdate;
Returns Y (1) if the last update is more than 1 month old
This way, even if the cronjob is run every minute, the webservice will be called
only once a month !
=cut
sub NeedUpdate {
my $lastupdated = C4::Context->preference('UsageStatsLastUpdateTime') || 0;
my $now = strftime( "%s", localtime );
# Need to launch cron.
return 1 if $now - $lastupdated >= 2592000;
# Data don't need to be updated
return 0;
}
sub BuildReport {
my $report;
my @libraries;

View File

@ -62,9 +62,20 @@ sub search {
push @args, "%$shelfname%";
}
if ( defined $owner and $owner ne '' ) {
push @where_strs, '( bo.firstname LIKE ? OR bo.surname LIKE ? )';
push @args, "%$owner%", "%$owner%";
}
$owner =~ s/^\s+|\s+$//g; # Trim leading/trailing spaces
$owner =~ s/\s+/ /g; # Collapse multiple internal spaces to one
my @name_parts = split ' ', $owner;
if ( @name_parts == 2 ) {
push @where_strs, '( bo.firstname LIKE ? AND bo.surname LIKE ? )';
push @args, "%$name_parts[0]%", "%$name_parts[1]%";
} else {
push @where_strs, '( bo.firstname LIKE ? OR bo.surname LIKE ? )';
push @args, "%$owner%", "%$owner%";
}
}
if ( defined $sortby and $sortby ne '' ) {
push @where_strs, 'sortfield = ?';
push @args, $sortby;

View File

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "24.11.00.000";
$VERSION = "24.11.19.000";
sub version {
return $VERSION;

View File

@ -887,16 +887,32 @@ sub adjust {
# Catch cases that require patron refunds
if ( $new_outstanding < 0 ) {
my $account =
Koha::Patrons->find( $self->borrowernumber )->account;
my $credit = $account->add_credit(
# Only generate an OVERPAYMENT credit for reversible payments
# (e.g. cash payments). Non-reversible credits such as writeoffs,
# discounts and cancellations should simply be absorbed when the
# fine is adjusted downward - they must not produce a refund
# credit for the patron.
my $total_non_reversible = 0;
if ( my $debit_offsets = $self->debit_offsets ) {
my $nr_offsets = $debit_offsets->filter_by_non_reversible;
$total_non_reversible += abs( $_->amount ) for $nr_offsets->as_list;
}
my $total_applied = $amount_before - $amount_outstanding_before;
my $total_reversible = $total_applied - $total_non_reversible;
my $overpayment_amount = $total_reversible - $amount;
if ( $overpayment_amount > 0 ) {
my $account = Koha::Patrons->find( $self->borrowernumber )->account;
$account->add_credit(
{
amount => $new_outstanding * -1,
amount => $overpayment_amount,
type => 'OVERPAYMENT',
interface => $interface,
( $update_type eq 'overdue_update' ? ( item_id => $self->itemnumber ) : ()),
}
);
}
$new_outstanding = 0;
}

View File

@ -16,6 +16,7 @@ package Koha::Acquisition::Bookseller::Interface;
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use Encode qw(decode_utf8);
use Koha::Encryption;
use base qw( Koha::Object );
@ -42,7 +43,7 @@ sub store {
my ($self) = @_;
if ( $self->password ) {
$self->password(Koha::Encryption->new->encrypt_hex($self->password));
$self->password( Koha::Encryption->new->encrypt_hex( $self->password ) );
}
return $self->SUPER::store;
@ -58,7 +59,7 @@ Decrypt the password and return its plain text form.
sub plain_text_password {
my ($self) = @_;
return Koha::Encryption->new->decrypt_hex($self->password)
return decode_utf8( Koha::Encryption->new->decrypt_hex( $self->password ) )
if $self->password;
}

View File

@ -26,7 +26,7 @@ use base qw(Koha::Objects);
=head1 NAME
Koha::Cities - Koha Claim Object set class
Koha::Acquisition::Order::Claims - Koha Claims Object set class
=head1 API

View File

@ -38,6 +38,26 @@ Koha::AdditionalContents - Koha Additional content object set class
=cut
=head3 get_public_query_search_params
my $public_query_search_params = $self->get_public_query_search_params($params);
=cut
sub get_public_query_search_params {
my ($params) = @_;
my $search_params;
$search_params->{'additional_content.id'} = $params->{id} if $params->{id};
$search_params->{location} = $params->{location};
$search_params->{branchcode} = $params->{library_id} ? [ $params->{library_id}, undef ] : undef;
$search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' } unless $params->{id};
$search_params->{expirationdate} = [ '-or', { '>=' => \'CAST(NOW() AS DATE)' }, undef ] unless $params->{id};
$search_params->{category} = $params->{category} if $params->{category};
return $search_params;
}
=head3 search_for_display
my $contents = Koha::AdditionalContents->search_for_display({
@ -73,23 +93,25 @@ location is one of this:
sub search_for_display {
my ( $self, $params ) = @_;
my $lang = $params->{lang};
my $lang = $params->{lang} || q{};
# If lang is not default, we will search for entries matching $lang but fallback to default if $lang is not found
# Then we need a subquery count in where clause; DBIx::Class/SQL::Abstract does not support it, fallback to literal SQL
my $subquery =
qq|(SELECT COUNT(*) FROM additional_contents_localizations WHERE lang='$lang' AND additional_content_id=me.additional_content_id)=0|;
my $search_params = get_public_query_search_params($params);
$search_params->{lang} = 'default' if !$lang || $lang eq 'default';
my $search_params;
$search_params->{'additional_content.id'} = $params->{id} if $params->{id};
$search_params->{location} = $params->{location};
$search_params->{branchcode} = $params->{library_id} ? [ $params->{library_id}, undef ] : undef;
$search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' } unless $params->{id};
$search_params->{expirationdate} = [ '-or', { '>=' => \'CAST(NOW() AS DATE)' }, undef ] unless $params->{id};
$search_params->{category} = $params->{category} if $params->{category};
$search_params->{lang} = 'default' if !$lang || $lang eq 'default';
$search_params->{-or} = [ { 'lang' => $lang }, '-and' => [ 'lang', 'default', \$subquery ] ]
if !$search_params->{lang};
unless ( $search_params->{lang} ) {
$search_params->{-or} = [
{ lang => $lang },
{
-and => [
{ lang => 'default' },
\[
'(SELECT COUNT(*) FROM additional_contents_localizations WHERE lang = ? AND additional_content_id = me.additional_content_id) = 0',
$lang
]
]
}
];
}
my $attribs = { prefetch => 'additional_content', order_by => 'additional_content.number' };
return Koha::AdditionalContentsLocalizations->search( $search_params, $attribs );

View File

@ -35,10 +35,10 @@ sub startup {
$self->plugin('CGIBinKoha');
# Create routes for API
# FIXME This generates routes like this: /api/api/v1/...
$self->plugin('RESTV1');
$self->plugin('CSRF');
$self->plugin('Language');
$self->hook(before_dispatch => \&_before_dispatch);
$self->hook(around_action => \&_around_action);
@ -56,11 +56,6 @@ sub _before_dispatch {
# Remove Koha version from URL
$path =~ s/_\d{2}\.\d{7}\.(js|css)/.$1/;
# See FIXME above
if ($path =~ m|^/api/v|) {
$path = '/api' . $path;
}
$c->req->url->path->parse($path);
}

View File

@ -35,10 +35,10 @@ sub startup {
$self->plugin('CGIBinKoha', opac => 1);
# Create routes for API
# FIXME This generates routes like this: /api/api/v1/...
$self->plugin('RESTV1');
$self->plugin('CSRF');
$self->plugin('Language');
$self->hook(before_dispatch => \&_before_dispatch);
$self->hook(around_action => \&_around_action);
@ -56,11 +56,6 @@ sub _before_dispatch {
# Remove Koha version from URL
$path =~ s/_\d{2}\.\d{7}\.(js|css)/.$1/;
# See FIXME above
if ($path =~ m|^/api/v|) {
$path = '/api' . $path;
}
$c->req->url->path->parse($path);
}

View File

@ -0,0 +1,74 @@
package Koha::App::Plugin::Language;
# Copyright 2025 Koha development team
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
=head1 NAME
Koha::App::Plugin::Language
=head1 SYNOPSIS
$app->plugin('Language');
=head1 DESCRIPTION
Sets the current language based on request (cookies, headers, ...)
=cut
use Modern::Perl;
use Mojo::Base 'Mojolicious::Plugin';
use Koha::Language;
=head1 METHODS
=head2 register
Called by Mojolicious when the plugin is loaded.
Defines an `around_action` hook that will sets the current language based on
the current request.
=cut
sub register {
my ( $self, $app, $conf ) = @_;
$app->hook(
around_action => sub {
my ( $next, $c, $action, $last ) = @_;
# Make the value of Accept-Language header and KohaOpacLanguage
# cookie accessible to C4::Languages::getlanguage when not in a CGI
# context
if ( my $accept_language = $c->req->headers->accept_language ) {
$ENV{HTTP_ACCEPT_LANGUAGE} = $accept_language;
}
if ( my $KohaOpacLanguage = $c->cookie('KohaOpacLanguage') ) {
Koha::Language->set_requested_language($KohaOpacLanguage);
}
return $next->();
}
);
}
1;

View File

@ -26,7 +26,8 @@ use Koha::REST::V1;
sub register {
my ($self, $app) = @_;
$app->routes->any('/api')->partial(1)->to(app => Koha::REST::V1->new);
my $v1 = Koha::REST::V1->new( config => { route => '/v1' } );
$app->routes->any('/api')->partial(1)->to(app => $v1);
}
1;

View File

@ -267,6 +267,9 @@ sub store {
$self->created_on( dt_from_string() );
}
Koha::Exceptions::ArticleRequest::WrongFormat->throw
unless grep { $_ eq $self->format } @{ C4::Context->multivalue_preference('ArticleRequestsSupportedFormats') };
return $self->SUPER::store;
}

View File

@ -0,0 +1,121 @@
package Koha::Auth::Identity::Referer;
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <https://www.gnu.org/licenses>.
use Modern::Perl;
use C4::Context;
=head1 NAME
Koha::Auth::Identity::Referer
=head1 SYNOPSIS
use Koha::Auth::Identity::Referer;
Koha::Auth::Identity::Referer->store_referer({
referer => $c->req->headers->referer,
interface => $interface,
session => $session,
});
my $target_uri = Koha::Auth::Identity::Referer->get_referer({
session => $session,
});
=head1 DESCRIPTION
Class for working with HTTP referrers specifically for
when doing SSO.
=head1 FUNCTIONS
=head2 store_referer
Koha::Auth::Identity::Referer->store_referer({
referer => $c->req->headers->referer,
interface => $interface,
session => $session,
});
If the referer is for a Koha URL, then it gets saved
in a session variable for use after a successful SSO login.
=cut
sub store_referer {
my ( $class, $args ) = @_;
my $referer = $args->{referer};
my $interface = $args->{interface};
my $session = $args->{session};
my $valid_referer;
if ( $referer && $interface && $session ) {
my $base_url;
if ( $interface eq 'opac' ) {
$base_url = C4::Context->preference('OPACBaseURL');
} else {
$base_url = C4::Context->preference('staffClientBaseURL');
}
if ( $base_url && $referer && $referer =~ /^\Q$base_url\E/ ) {
my $referer_uri = URI->new($referer);
#NOTE: Remove logout.x query param to prevent logout loops
$referer_uri->query_param_delete('logout.x') if $referer_uri->query_param('logout.x');
my $referer_to_save = $referer_uri->path_query();
if ($referer_to_save) {
#NOTE: Don't bother saving a root referer
#NOTE: Don't save opac-main.pl because it should redirect to opac-user.pl
unless ( ( $referer_to_save eq '/' ) || ( $referer_to_save eq '/cgi-bin/koha/opac-main.pl' ) ) {
$session->param( 'idp_referer', $referer_to_save );
$session->flush();
}
}
}
}
return $valid_referer;
}
=head2 get_referer
my $target_uri = Koha::Auth::Identity::Referer->get_referer({
session => $session,
});
If a referer was stored in a session variable, then we retrieve
it for use by SSO functionality. That is, after a successful SSO, we'll
redirect to this referer, so we wind up back where we started.
=cut
sub get_referer {
my ( $class, $args ) = @_;
my $referer;
my $session = $args->{session};
if ($session) {
my $idp_referer = $session->param('idp_referer');
if ($idp_referer) {
$referer = $idp_referer;
$session->clear('idp_referer');
$session->flush();
}
}
return $referer;
}
1;

View File

@ -69,8 +69,8 @@ sub connect {
return
unless $notification_method eq 'STOMP';
my $hostname = $ENV{KOHA_STOMP_HOSTNAME} // 'localhost';
my $port = $ENV{KOHA_STOMP_PORT} // '61613';
my $hostname = 'localhost';
my $port = '61613';
my $config = C4::Context->config('message_broker');
my $credentials = {
@ -89,10 +89,16 @@ sub connect {
try {
$stomp = Net::Stomp->new( { hostname => $hostname, port => $port } );
$stomp->connect( $credentials );
my $connected_frame = $stomp->connect($credentials);
if ( $connected_frame->command ne 'CONNECTED' ) {
my $message = $connected_frame->body;
chomp $message;
warn sprintf "Cannot connect to broker (%s)", $message;
undef $stomp;
}
} catch {
warn "Cannot connect to broker " . $_;
$stomp = undef;
warn sprintf "Cannot connect to broker (%s)", $_;
undef $stomp;
};
return $stomp;
@ -151,8 +157,12 @@ sub enqueue {
my $namespace = C4::Context->config('memcached_namespace');
my $encoded_args = Encode::encode_utf8( $json_args ); # FIXME We should better leave this to Net::Stomp?
my $destination = sprintf( "/queue/%s-%s", $namespace, $job_queue );
$conn->send_with_receipt( { destination => $destination, body => $encoded_args, persistent => 'true' } )
or Koha::Exceptions::BackgroundJob->throw('Job has not been enqueued');
$conn->send_with_receipt(
{
destination => $destination, body => $encoded_args, persistent => 'true',
'content-type' => 'application/json'
}
) or Koha::Exceptions::BackgroundJob->throw('Job has not been enqueued');
} catch {
$self->status('failed')->store;
if ( ref($_) eq 'Koha::Exceptions::BackgroundJob' ) {
@ -481,14 +491,17 @@ sub plugin_types_to_classes {
my $namespace = $metadata->{namespace};
foreach my $type ( keys %{$tasks} ) {
my $class = $tasks->{$type};
my $class =
( ref $tasks->{$type} eq 'HASH' )
? $tasks->{$type}{class}
: $tasks->{$type};
# skip if conditions not met
next unless $type and $class;
my $key = "plugin_$namespace" . "_$type";
$self->{_plugin_mapping}->{$key} = $tasks->{$type};
$self->{_plugin_mapping}->{$key} = $class;
}
}
}

View File

@ -92,7 +92,7 @@ sub process {
usage_data_provider_id => $ud_provider->erm_usage_data_provider_id,
file_content => $args->{file_content},
date_uploaded => POSIX::strftime( "%Y%m%d%H%M%S", localtime ),
filename => $ud_provider->name . "_" . $ud_provider->{report_type},
filename => $ud_provider->name,
}
]
);

View File

@ -235,7 +235,8 @@ sub read_file {
sep_char => $delimiter,
quote_char => $quote_char,
binary => 1,
allow_loose_quotes => 1
allow_loose_quotes => 1,
formula => 'empty'
}
);
my $headers_to_check = $csv->getline($fh);

View File

@ -52,7 +52,7 @@ sub process {
$self->start;
my $statistic = $args->{statistic};
my $stat_object = Koha::Statistic->new($statistic);
Koha::PseudonymizedTransaction->new_from_statistic($stat_object)->store();
Koha::PseudonymizedTransaction->create_from_statistic($stat_object);
$self->finish( { data => "" } ); # We want to clear the job data to avoid storing patron information
}

View File

@ -394,7 +394,19 @@ sub check_booking {
? $existing_bookings->search( { booking_id => { '!=' => $booking_id } } )->count
: $existing_bookings->count;
my $checkouts = $self->current_checkouts->search( { date_due => { '>=' => $dtf->format_datetime($start_date) } } );
# Only count checkouts on bookable items; checkouts on non-bookable
# sibling items should not reduce the pool of available bookable items.
my $bookable_item_ids = [ $bookable_items->reset->get_column('itemnumber') ];
my $checkouts = $self->current_checkouts->search(
{
date_due => { '>=' => $dtf->format_datetime($start_date) },
"me.itemnumber" => {
'-not_in' => $existing_bookings->_resultset->get_column('item_id')->as_query,
'-in' => $bookable_item_ids,
},
}
);
$booked_count += $checkouts->count;
return ( ( $total_bookable - $booked_count ) > 0 ) ? 1 : 0;
@ -1660,6 +1672,20 @@ sub normalized_upc {
return $self->metadata_extractor->get_normalized_upc;
}
=head3 opac_suppressed
my $opac_suppressed = $biblio->opac_suppressed();
Returns whether the record is flagged as suppressed in the OPAC.
FIXME: Revisit after 38330 discussion
=cut
sub opac_suppressed {
my ($self) = @_;
return $self->metadata_extractor->get_opac_suppression();
}
=head3 normalized_oclc
my $normalized_oclc = $biblio->normalized_oclc
@ -1692,10 +1718,15 @@ sub to_api {
$args = defined $args ? {%$args} : {};
delete $args->{embed};
my $json_biblioitem = $self->biblioitem->to_api( $args );
my $biblioitem = $self->biblioitem;
Koha::Exceptions::RelatedObjectNotFound->throw( accessor => 'biblioitem', class => 'Koha::Biblioitem' )
unless $biblioitem;
my $json_biblioitem = $biblioitem->to_api($args);
return unless $json_biblioitem;
return { %$json_biblio, %$json_biblioitem };
return { %$json_biblioitem, %$json_biblio };
}
=head3 to_api_mapping
@ -1876,7 +1907,7 @@ sub generate_marc_host_field {
my $marcflavour = C4::Context->preference('marcflavour');
my $marc_host = $self->metadata->record;
my %sfd;
my @sfd;
my $host_field;
my $link_field;
@ -1886,7 +1917,48 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('100') || $marc_host->field('110') || $marc_host->field('111') ) {
my $s = $host_field->as_string('ab');
if ($s) {
$sfd{a} = $s;
push @sfd, ( a => $s );
}
}
# Title
if ( $host_field = $marc_host->field('245') ) {
my $s = $host_field->as_string('abnp');
if ($s) {
push @sfd, ( t => $s );
}
}
# Publication
my $p;
my @publication_fields = $marc_host->field('264');
@publication_fields = $marc_host->field('260') unless (@publication_fields);
my $index = 0;
for my $host_field (@publication_fields) {
# Use first entry unless we find a preferred indicator1 = 3
if ( $index == 0 ) {
my $s = $host_field->as_string('abc');
if ($s) {
$p = $s;
}
$index++;
}
if ( $host_field->indicator(1) && ( $host_field->indicator(1) eq '3' ) ) {
my $s = $host_field->as_string('abc');
if ($s) {
$p = $s;
}
last;
}
}
push @sfd, ( d => $p ) if $p;
# Uniform title
if ( $host_field = $marc_host->field('240') ) {
my $s = $host_field->as_string('a');
if ($s) {
push @sfd, ( s => $s );
}
}
@ -1894,31 +1966,7 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('250') ) {
my $s = $host_field->as_string('ab');
if ($s) {
$sfd{b} = $s;
}
}
# Publication
if ( $host_field = $marc_host->field('260') ) {
my $s = $host_field->as_string('abc');
if ($s) {
$sfd{d} = $s;
}
}
# Uniform title
if ( $host_field = $marc_host->field('240') ) {
my $s = $host_field->as_string('a');
if ($s) {
$sfd{s} = $s;
}
}
# Title
if ( $host_field = $marc_host->field('245') ) {
my $s = $host_field->as_string('ab');
if ($s) {
$sfd{t} = $s;
push @sfd, ( b => $s );
}
}
@ -1926,7 +1974,7 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('022') ) {
my $s = $host_field->as_string('a');
if ($s) {
$sfd{x} = $s;
push @sfd, ( x => $s );
}
}
@ -1934,53 +1982,33 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('020') ) {
my $s = $host_field->as_string('a');
if ($s) {
$sfd{z} = $s;
push @sfd, ( z => $s );
}
}
if ( C4::Context->preference('UseControlNumber') ) {
my $w;
# Control number
if ( $host_field = $marc_host->field('001') ) {
$sfd{w} = $host_field->data();
$w = $host_field->data();
}
# Control number identifier
if ( $host_field = $marc_host->field('003') ) {
$sfd{w} = '(' . $host_field->data() . ')' . $sfd{w};
$w = '(' . $host_field->data() . ')' . $w;
}
push @sfd, ( w => $w ) if $w;
}
$link_field = MARC::Field->new( 773, '0', ' ', %sfd );
$link_field = MARC::Field->new( 773, '0', ' ', @sfd );
} elsif ( $marcflavour eq 'UNIMARC' ) {
# Author
if ( $host_field = $marc_host->field('700') || $marc_host->field('710') || $marc_host->field('720') ) {
my $s = $host_field->as_string('ab');
if ($s) {
$sfd{a} = $s;
}
}
# Place of publication
if ( $host_field = $marc_host->field('210') ) {
my $s = $host_field->as_string('a');
if ($s) {
$sfd{c} = $s;
}
}
# Date of publication
if ( $host_field = $marc_host->field('210') ) {
my $s = $host_field->as_string('d');
if ($s) {
$sfd{d} = $s;
}
}
# Edition statement
if ( $host_field = $marc_host->field('205') ) {
my $s = $host_field->as_string();
if ($s) {
$sfd{e} = $s;
push @sfd, ( a => $s );
}
}
@ -1988,7 +2016,31 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('200') ) {
my $s = $host_field->as_string('a');
if ($s) {
$sfd{t} = $s;
push @sfd, ( t => $s );
}
}
# Place of publication
if ( $host_field = $marc_host->field('210') ) {
my $s = $host_field->as_string('a');
if ($s) {
push @sfd, ( c => $s );
}
}
# Date of publication
if ( $host_field = $marc_host->field('210') ) {
my $s = $host_field->as_string('d');
if ($s) {
push @sfd, ( d => $s );
}
}
# Edition statement
if ( $host_field = $marc_host->field('205') ) {
my $s = $host_field->as_string();
if ($s) {
push @sfd, ( e => $s );
}
}
@ -1996,7 +2048,7 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('856') ) {
my $s = $host_field->as_string('u');
if ($s) {
$sfd{u} = $s;
push @sfd, ( u => $s );
}
}
@ -2004,7 +2056,7 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('011') ) {
my $s = $host_field->as_string('a');
if ($s) {
$sfd{x} = $s;
push @sfd, ( x => $s );
}
}
@ -2012,13 +2064,14 @@ sub generate_marc_host_field {
if ( $host_field = $marc_host->field('010') ) {
my $s = $host_field->as_string('a');
if ($s) {
$sfd{y} = $s;
push @sfd, ( y => $s );
}
}
if ( $host_field = $marc_host->field('001') ) {
$sfd{0} = $host_field->data();
push @sfd, ( 0 => $host_field->data() );
}
$link_field = MARC::Field->new( 461, '0', ' ', %sfd );
$link_field = MARC::Field->new( 461, '0', ' ', @sfd );
}
return $link_field;
@ -2237,6 +2290,12 @@ sub merge_with {
my $from_biblio = Koha::Biblios->find($bn_merge);
$from_biblio->items->move_to_biblio($self);
# Move item groups
$from_biblio->item_groups->update(
{ biblio_id => $ref_biblionumber },
{ no_triggers => 1 }
);
# Move article requests
$from_biblio->article_requests->update(
{ biblionumber => $ref_biblionumber },

View File

@ -100,6 +100,23 @@ sub get_control_number {
return $control_number;
}
=head2 get_opac_suppression
my $opac_suppressed = $extractor->get_opac_suppression();
Returns whether the record is flagged as suppressed in the OPAC.
FIXME: Revisit after 38330 discussion
=cut
sub get_opac_suppression {
my ($self) = @_;
my $record = $self->metadata;
return $record->subfield( '942', 'n' ) ? 1 : 0;
}
=head3 _normalize_string
my $normalized_string = $self->_normalize_string($string);

View File

@ -40,11 +40,11 @@ sub public_read_list {
return [
'volume', 'number', 'isbn',
'issn', 'ean', 'publicationyear',
'publishercode', 'volumedate', 'columedesc',
'publishercode', 'volumedate', 'volumedesc',
'collectiontitle', 'collectionissn', 'collectionvolume',
'editionstatement', 'editionresponsibility', 'pages',
'place', 'lccn', 'url',
'cn_source', 'cn_class', 'cn)item',
'cn_source', 'cn_class', 'cn_item',
'cn_suffix', 'cn_sort', 'agerestriction',
'totalissues'
];

View File

@ -237,6 +237,21 @@ sub to_api_mapping {
};
}
=head3 public_read_list
This method returns the list of publicly readable database fields for both API and UI output purposes
=cut
sub public_read_list {
return [
'checkin_library', 'issue_id', 'borrowernumber',
'itemnumber', 'date_due', 'branchcode',
'returndate', 'lastreneweddate', 'issuedate',
'notedate', 'noteseen'
];
}
=head3 claim_returned
my $return_claim = $checkout->claim_returned();

View File

@ -2,18 +2,18 @@ package Koha::Course;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -2,18 +2,18 @@ package Koha::Course::Instructor;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -2,18 +2,18 @@ package Koha::Course::Instructors;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -2,18 +2,18 @@ package Koha::Course::Item;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -2,18 +2,18 @@ package Koha::Course::Items;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -2,18 +2,18 @@ package Koha::Course::Reserve;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -2,18 +2,18 @@ package Koha::Course::Reserves;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -2,18 +2,18 @@ package Koha::Courses;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -26,7 +26,7 @@ use base qw(Koha::Objects);
=head1 NAME
Koha::Cities - Koha CoverImage Object set class
Koha::CoverImages - Koha CoverImage Object set class
=head1 API

158
Koha/Database/Auditor.pm Normal file
View File

@ -0,0 +1,158 @@
package Koha::Database::Auditor;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use SQL::Translator;
use SQL::Translator::Diff;
use C4::Context;
use Koha::I18N qw(__);
=head1 NAME
Koha::Database::Auditor
=head1 SYNOPSIS
use Koha::Database::Auditor;
=head1 API
=head2 Methods
=head3 new
Constructor for creating a new object with specified parameters
=cut
sub new {
my ( $class, $params ) = @_;
my $self = bless $params // {}, $class;
$self->{filename} = $params->{filename} // './installer/data/mysql/kohastructure.sql';
return $self;
}
=head3 run
Compares the current database schema with the expected schema from the
`kohastructure.sql` file. Generates SQL commands to update the database schema
if differences are found. Returns a hash reference containing the differences,
a flag indicating if differences were found, a message, and a title.
=cut
sub run {
my ( $self, $args ) = @_;
if ( !-f $self->{filename} ) {
die("Filename '$self->{filename}' does not exist\n");
}
my $sql_schema = $self->_get_kohastructure();
my $db_schema = $self->_get_db();
if ( $sql_schema && $db_schema ) {
my $diff = SQL::Translator::Diff->new(
{
output_db => 'MySQL',
source_schema => $db_schema,
target_schema => $sql_schema,
}
)->compute_differences->produce_diff_sql;
my $diff_found = 1;
my $message = __(
"These commands are only suggestions. They are not a replacement for the database update scripts run during installations and updates.\nReview the database, the atomic update files and the table definitions in kohastructure.sql before running any of the commands below:"
);
my $title = __("Warning!");
if ( $diff =~ /No differences found/ ) {
$diff_found = 0;
$message = __("The installed database schema is correct.");
$title = __("All is well");
}
return {
diff => $diff,
diff_found => $diff_found,
message => $message,
title => $title,
};
}
}
=head3 _get_db
Retrieves the database schema, removes auto-increment from the schema, and returns the modified schema.
=cut
sub _get_db {
my ($self) = @_;
my $database_name = C4::Context->config("database");
print sprintf( __("Parsing schema for database %s\n"), $database_name ) if $self->{is_cli};
my $dbh = C4::Context->dbh;
my $parser = SQL::Translator->new(
parser => 'DBI',
parser_args => {
dbh => $dbh,
},
);
my $schema = $parser->translate();
#NOTE: Hack the schema to remove autoincrement
#Otherwise, that difference will cause options for all tables to be reset unnecessarily
my @tables = $schema->get_tables();
foreach my $table (@tables) {
my @new_options = ();
my $replace_options = 0;
my $options = $table->{options};
foreach my $hashref (@$options) {
if ( $hashref->{AUTO_INCREMENT} ) {
$replace_options = 1;
} else {
push( @new_options, $hashref );
}
}
if ($replace_options) {
@{ $table->{options} } = @new_options;
}
}
return $schema;
}
=head3 _get_kohastructure
Retrieves and returns the schema using SQL::Translator for the given file
=cut
sub _get_kohastructure {
my ($self) = @_;
print sprintf( __("Parsing schema for file %s\n"), $self->{filename} ) if $self->{is_cli};
my $translator = SQL::Translator->new();
$translator->parser("MySQL");
my $schema = $translator->translate( $self->{filename} );
return $schema;
}
1;

View File

@ -34,7 +34,8 @@ Koha::Database::Columns
=head3 columns
Static method that returns a hashref with mappings from column names
to descriptions, for several tables. Currently
to descriptions for several tables.
Should be extended.
=over
@ -60,6 +61,14 @@ to descriptions, for several tables. Currently
sub columns {
return {
# TODO stub for the check in C4::Reports::Guided, get_columns (see BZ 37784)
accountlines => {},
serial => {},
serialitems => {},
subscriptionhistory => {},
subscriptionroutinglist => {},
aqbooksellers => {},
aqorders => {
"basketno" => __("Basket ID (internal)"),
"biblionumber" => __("Biblio number (internal)"),

View File

@ -39,8 +39,8 @@ use C4::Biblio qw(
use Koha::Edifact::Order;
use Koha::Edifact;
use C4::Log qw( logaction );
use Log::Log4perl;
use Text::Unidecode qw( unidecode );
use Koha::Logger;
use Koha::Plugins; # Adds plugin dirs to @INC
use Koha::Plugins::Handler;
use Koha::Acquisition::Baskets;
@ -173,7 +173,7 @@ sub process_ordrsp {
$response_message->status('processing');
$response_message->update;
my $schema = Koha::Database->new()->schema();
my $logger = Log::Log4perl->get_logger();
my $logger = Koha::Logger->get( { interface => 'edi' } );
my $vendor_acct;
my $edi =
Koha::Edifact->new( { transmission => $response_message->raw_msg, } );
@ -227,7 +227,7 @@ sub process_invoice {
$invoice_message->status('processing');
$invoice_message->update;
my $schema = Koha::Database->new()->schema();
my $logger = Log::Log4perl->get_logger();
my $logger = Koha::Logger->get( { interface => 'edi' } );
my $vendor_acct;
my $plugin_class = $invoice_message->edi_acct()->plugin();
@ -290,8 +290,7 @@ sub process_invoice {
)->single;
}
if ( !$vendor_acct ) {
carp
"Cannot find vendor with ean $vendor_ean for invoice $invoicenumber in $invoice_message->filename";
carp "Cannot find vendor with ean $vendor_ean for invoice $invoicenumber in ".$invoice_message->filename;
next;
}
$invoice_message->edi_acct( $vendor_acct->id );
@ -313,100 +312,100 @@ sub process_invoice {
foreach my $line ( @{$lines} ) {
my $ordernumber = $line->ordernumber;
if (!$ordernumber ) {
$logger->trace( "Skipping invoice line, no associated ordernumber" );
next;
}
$logger->trace( "Receipting order:$ordernumber Qty: ",
$line->quantity );
my $order = $schema->resultset('Aqorder')->find($ordernumber);
if (my $bib = $order->biblionumber) {
my $b = $bib->biblionumber;
my $id = $line->item_number_id;
$logger->trace("Updating bib:$b id:$id");
if ( !$ordernumber ) {
$logger->error("Skipping invoice line, no associated ordernumber");
next;
}
# ModReceiveOrder does not validate that $ordernumber exists validate here
if ($order) {
# check suggestions
my $s = $schema->resultset('Suggestion')->search(
{
biblionumber => $order->biblionumber->biblionumber,
}
)->single;
if ($s) {
ModSuggestion(
{
suggestionid => $s->suggestionid,
STATUS => 'AVAILABLE',
}
);
}
# If quantity_invoiced is present use it in preference
my $quantity = $line->quantity_invoiced;
if (!$quantity) {
$quantity = $line->quantity;
}
my ( $price, $price_excl_tax ) = _get_invoiced_price($line, $quantity);
my $tax_rate = $line->tax_rate;
if ($tax_rate && $tax_rate->{rate} != 0) {
$tax_rate->{rate} /= 100;
}
if ( $order->quantity > $quantity ) {
my $ordered = $order->quantity;
# part receipt
$order->orderstatus('partial');
$order->quantity( $ordered - $quantity );
$order->update;
my $received_order = $order->copy(
{
ordernumber => undef,
quantity => $quantity,
quantityreceived => $quantity,
orderstatus => 'complete',
unitprice => $price,
unitprice_tax_included => $price,
unitprice_tax_excluded => $price_excl_tax,
invoiceid => $invoiceid,
datereceived => $msg_date,
tax_rate_on_receiving => $tax_rate->{rate},
tax_value_on_receiving => $quantity * $price_excl_tax * $tax_rate->{rate},
}
);
transfer_items( $schema, $line, $order,
$received_order, $quantity );
receipt_items( $schema, $line,
$received_order->ordernumber, $quantity );
}
else { # simple receipt all copies on order
$order->quantityreceived( $quantity );
$order->datereceived($msg_date);
$order->invoiceid($invoiceid);
$order->unitprice($price);
$order->unitprice_tax_excluded($price_excl_tax);
$order->unitprice_tax_included($price);
$order->tax_rate_on_receiving($tax_rate->{rate});
$order->tax_value_on_receiving( $quantity * $price_excl_tax * $tax_rate->{rate});
$order->orderstatus('complete');
$order->update;
receipt_items( $schema, $line, $ordernumber, $quantity );
}
my $order = $schema->resultset('Aqorder')->find($ordernumber);
if ( !$order ) {
$logger->error("Skipping invoice line, no order found for $ordernumber, invoice:$invoicenumber");
next;
}
else {
my $bib = $order->biblionumber;
if ( !$bib ) {
$logger->error(
"No order found for $ordernumber Invoice:$invoicenumber"
"Skipping invoice line, no bibliographic record found for $ordernumber, invoice:$invoicenumber"
);
next;
}
}
$logger->trace( "Receipting order:$ordernumber Qty: " . $line->quantity );
$logger->trace( "Updating bib:" . $bib->biblionumber . " id:" . $line->item_number_id );
# check suggestions
my $s = $schema->resultset('Suggestion')->search(
{
biblionumber => $bib->biblionumber,
}
)->single;
if ($s) {
ModSuggestion(
{
suggestionid => $s->suggestionid,
STATUS => 'AVAILABLE',
}
);
}
# If quantity_invoiced is present use it in preference
my $quantity = $line->quantity_invoiced;
if ( !$quantity ) {
$quantity = $line->quantity;
}
my ( $price, $price_excl_tax ) = _get_invoiced_price( $line, $quantity );
my $tax_rate = $line->tax_rate;
if ( $tax_rate && $tax_rate->{rate} != 0 ) {
$tax_rate->{rate} /= 100;
}
if ( $order->quantity > $quantity ) {
my $ordered = $order->quantity;
# part receipt
$order->orderstatus('partial');
$order->quantity( $ordered - $quantity );
$order->update;
my $received_order = $order->copy(
{
ordernumber => undef,
quantity => $quantity,
quantityreceived => $quantity,
orderstatus => 'complete',
unitprice => $price,
unitprice_tax_included => $price,
unitprice_tax_excluded => $price_excl_tax,
invoiceid => $invoiceid,
datereceived => $msg_date,
tax_rate_on_receiving => $tax_rate->{rate},
tax_value_on_receiving => $quantity * $price_excl_tax * $tax_rate->{rate},
}
);
transfer_items(
$schema, $line, $order,
$received_order, $quantity
);
receipt_items(
$schema, $line,
$received_order->ordernumber, $quantity
);
} else { # simple receipt all copies on order
$order->quantityreceived($quantity);
$order->datereceived($msg_date);
$order->invoiceid($invoiceid);
$order->unitprice($price);
$order->unitprice_tax_excluded($price_excl_tax);
$order->unitprice_tax_included($price);
$order->tax_rate_on_receiving( $tax_rate->{rate} );
$order->tax_value_on_receiving( $quantity * $price_excl_tax * $tax_rate->{rate} );
$order->orderstatus('complete');
$order->update;
receipt_items( $schema, $line, $ordernumber, $quantity );
}
}
}
}
@ -442,7 +441,7 @@ sub _get_invoiced_price {
sub receipt_items {
my ( $schema, $inv_line, $ordernumber, $quantity ) = @_;
my $logger = Log::Log4perl->get_logger();
my $logger = Koha::Logger->get( { interface => 'edi' } );
# itemnumber is not a foreign key ??? makes this a bit cumbersome
my @item_links = $schema->resultset('AqordersItem')->search(
@ -542,7 +541,7 @@ sub transfer_items {
}
++$gocc;
}
my $logger = Log::Log4perl->get_logger();
my $logger = Koha::Logger->get( { interface => 'edi' } );
my $o1 = $order_from->ordernumber;
my $o2 = $order_to->ordernumber;
$logger->warn("transferring $quantity copies from order $o1 to order $o2");
@ -586,7 +585,7 @@ sub process_quote {
my $messages = $edi->message_array();
my $process_errors = 0;
my $logger = Log::Log4perl->get_logger();
my $logger = Koha::Logger->get( { interface => 'edi' } );
my $schema = Koha::Database->new()->schema();
my $message_count = 0;
my @added_baskets; # if auto & multiple baskets need to order all
@ -671,7 +670,7 @@ sub quote_item {
my ( $item, $quote, $basketno ) = @_;
my $schema = Koha::Database->new()->schema();
my $logger = Log::Log4perl->get_logger();
my $logger = Koha::Logger->get( { interface => 'edi' } );
# $basketno is the return from AddBasket in the calling routine
# So this call should not fail unless that has

View File

@ -37,7 +37,7 @@ Koha::ERM::Document - Koha ERM Document Object class
sub to_api_mapping {
return {
# Do not expose file_content to prevent the content to be fetch from the DB and sent over the network when embeded
# Do not expose file_content to prevent the content to be fetch from the DB and sent over the network when embedded
file_content => undef,
};
}

View File

@ -0,0 +1,335 @@
package Koha::ERM::EUsage::COUNTER::5;
# Copyright 2025 Open Fifth
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use base qw(Koha::ERM::EUsage::SushiCounter);
=head1 NAME
Koha::ERM::EUsage::COUNTER::5 - Koha COUNTER 5 Object class
=head1 API
=head2 Class Methods
=head3 new
my $sushi_counter =
Koha::ERM::EUsage::SushiCounter->new( { response => decode_json( $response->decoded_content ) } );
=cut
sub new {
my ($class) = @_;
my $self = {};
bless( $self, $class );
}
=head3 _COUNTER_report_header
Return a COUNTER report header
https://cop5.projectcounter.org/en/5.0.2/04-reports/03-title-reports.html
=cut
sub _COUNTER_report_header {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my @metric_types_string = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "Metric_Type" );
my $begin_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "Begin_Date" );
my $end_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "End_Date" );
return (
[ Report_Name => $header->{Report_Name} || "" ],
[ Report_ID => $header->{Report_ID} || "" ],
[ Release => $header->{Release} || "" ],
[ Institution_Name => $header->{Institution_Name} || "" ],
[ Institution_ID => join( "; ", map( $_->{Type} . ":" . $_->{Value}, @{ $header->{Institution_ID} } ) ) || "" ],
[ Metric_Types => join( "; ", split( /\|/, $metric_types_string[0] ) ) || "" ],
[ Report_Filters => join( "; ", map( $_->{Name} . ":" . $_->{Value}, @{ $header->{Report_Filters} } ) ) || "" ],
#TODO: Report_Attributes may need parsing, test this with a SUSHI response that provides it
[ Report_Attributes => $header->{Report_Attributes} || "" ],
[
Exceptions => join(
"; ", map( $_->{Code} . ": " . $_->{Message} . " (" . $_->{Data} . ")", @{ $header->{Exceptions} } )
)
|| ""
],
[ Reporting_Period => "Begin_Date=" . $begin_date . "; End_Date=" . $end_date ],
[ Created => $header->{Created} || "" ],
[ Created_By => $header->{Created_By} || "" ],
[""] #empty 13th line (COUNTER 5)
);
}
=head3 _get_SUSHI_Name_Value
Returns "Value" of a given "Name"
=cut
sub _get_SUSHI_Name_Value {
my ( $self, $item, $name ) = @_;
my @value = map( $_->{Name} eq $name ? $_->{Value} : (), @{$item} );
return $value[0];
}
=head3 _get_SUSHI_Type_Value
Returns "Value" of a given "Type"
=cut
sub _get_SUSHI_Type_Value {
my ( $self, $item, $type ) = @_;
my @value = map( $_->{Type} eq $type ? $_->{Value} : (), @{$item} );
return $value[0];
}
=head3 _get_COUNTER_row_usages
Returns the total and monthly usages for a row
=cut
sub _get_COUNTER_row_usages {
my ( $self, $row, $metric_type ) = @_;
my @usage_months = $self->_get_usage_months( $self->{sushi}->{header} );
my @usage_months_fields = ();
my $count_total = 0;
foreach my $usage_month (@usage_months) {
my $month_is_empty = 1;
foreach my $performance ( @{ $row->{Performance} } ) {
my $period = $performance->{Period};
my $period_usage_month = substr( $period->{Begin_Date}, 0, 7 );
my $instances = $performance->{Instance};
my @metric_type_count =
map( $_->{Metric_Type} eq $metric_type ? $_->{Count} : (),
@{$instances} );
if ( $period_usage_month eq $usage_month && $metric_type_count[0] ) {
push( @usage_months_fields, $metric_type_count[0] );
$count_total += $metric_type_count[0];
$month_is_empty = 0;
}
}
if ($month_is_empty) {
push( @usage_months_fields, 0 );
}
}
return ( $count_total, @usage_months_fields );
}
=head3 get_SUSHI_metric_types
Returns all metric types this SUSHI result has statistics for, as an array of strings.
=cut
sub get_SUSHI_metric_types {
my ( $self, $report_row ) = @_;
my @metric_types = ();
# Grab all metric_types this SUSHI result has statistics for
foreach my $performance ( @{ $report_row->{Performance} } ) {
my @SUSHI_metric_types =
map( $_->{Metric_Type}, @{ $performance->{Instance} } );
foreach my $sushi_metric_type (@SUSHI_metric_types) {
push( @metric_types, $sushi_metric_type ) unless grep { $_ eq $sushi_metric_type } @metric_types;
}
}
return @metric_types;
}
=head3 _COUNTER_report_body
Return the COUNTER report body as an array
=cut
sub _COUNTER_report_body {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my $body = $self->{sushi}->{body};
my @report_body = ();
foreach my $report_row ( @{$body} ) {
my @metric_types = $self->get_SUSHI_metric_types($report_row);
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push( @report_body, $self->_COUNTER_report_row( $report_row, $metric_type ) );
}
}
return @report_body;
}
=head3 _COUNTER_title_report_row
Return a COUNTER title for the COUNTER titles report body
https://cop5.projectcounter.org/en/5.0.2/04-reports/03-title-reports.html#column-headings-elements
=cut
sub _COUNTER_title_report_row {
my ( $self, $title_row, $metric_type, $total_usage, $monthly_usages ) = @_;
my $header = $self->{sushi}->{header};
my $specific_fields = $self->get_report_type_specific_fields( $header->{Report_ID} );
return (
[
# Title
$title_row->{Title} || "",
# Publisher
$title_row->{Publisher} || "",
# Publisher_ID
$self->_get_SUSHI_Type_Value( $title_row->{Publisher_ID}, "ISNI" ) || "",
# Platform
$title_row->{Platform} || "",
# DOI
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "DOI" ) || "",
# Proprietary_ID
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Proprietary" ) || "",
# ISBN
grep ( /ISBN/, @{$specific_fields} )
? ( $self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "ISBN" ) || "" )
: (),
# Print_ISSN
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Print_ISSN" ) || "",
# Online_ISSN
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Online_ISSN" ) || "",
# URI - FIXME: What goes in URI?
"",
# YOP
grep ( /YOP/, @{$specific_fields} ) ? ( $title_row->{YOP} || "" ) : (),
# Access_Type
grep ( /Access_Type/, @{$specific_fields} ) ? ( $title_row->{Access_Type} || "" ) : (),
# Metric_Type
$metric_type,
# Report_Period_Total
$total_usage,
# Monthly usage entries
@{$monthly_usages}
]
);
}
=head3 _COUNTER_titles_report_column_headings
Return titles report column headings
=cut
sub _COUNTER_titles_report_column_headings {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my @month_headings = $self->_get_usage_months( $header, 1 );
my $specific_fields = $self->get_report_type_specific_fields( $header->{Report_ID} );
return (
[
"Title",
"Publisher",
"Publisher_ID",
"Platform",
"DOI",
"Proprietary_ID",
grep ( /ISBN/, @{$specific_fields} ) ? ("ISBN") : (),
"Print_ISSN",
"Online_ISSN",
"URI",
#"Data_Type", #TODO: Only if requested (?)
#"Section_Type", #TODO: Only if requested (?)
grep ( /YOP/, @{$specific_fields} ) ? ("YOP") : (),
grep ( /Access_Type/, @{$specific_fields} ) ? ("Access_Type") : (),
#"Access_Method", #TODO: Only if requested (?)
"Metric_Type",
"Reporting_Period_Total",
# @month_headings in "Mmm-yyyy" format. TODO: Show unless Exclude_Monthly_Details=true
@month_headings
]
);
}
=head3 get_report_type_specific_fields
Returns the specific fields for a given report_type
=cut
sub get_report_type_specific_fields {
my ( $self, $report_type ) = @_;
my %report_type_map = (
"TR_B1" => [ 'YOP', 'ISBN' ],
"TR_B2" => [ 'YOP', 'ISBN' ],
"TR_B3" => [ 'YOP', 'Access_Type', 'ISBN' ],
"TR_J3" => ['Access_Type'],
"TR_J4" => ['YOP'],
"IR_A1" => [
'Authors', 'Publication_Date', 'Article_Version', 'Print_ISSN', 'Online_ISSN', 'Parent_Title',
'Parent_Authors', 'Parent_Article_Version', 'Parent_DOI', 'Parent_Proprietary_ID', 'Parent_Print_ISSN',
'Parent_Online_ISSN', 'Parent_URI', 'Access_Type'
],
);
return $report_type_map{$report_type};
}
1;

View File

@ -0,0 +1,468 @@
package Koha::ERM::EUsage::COUNTER::5_1;
# Copyright 2025 Open Fifth
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use base qw(Koha::ERM::EUsage::SushiCounter);
=head1 NAME
Koha::ERM::EUsage::COUNTER::5 - Koha COUNTER 5.1 Object class
=head1 API
=head2 Class Methods
=head3 new
my $sushi_counter =
Koha::ERM::EUsage::SushiCounter->new( { response => decode_json( $response->decoded_content ) } );
=cut
sub new {
my ($class) = @_;
my $self = {};
bless( $self, $class );
}
=head3 _COUNTER_report_header
Return a COUNTER report header
https://cop5.projectcounter.org/en/5.1/04-reports/03-title-reports.html
=cut
sub _COUNTER_report_header {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my $metric_types = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "Metric_Type" );
my @metric_types_array = split( /\|/, $metric_types );
$metric_types = join( "; ", @metric_types_array ) if @metric_types_array;
my $begin_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "Begin_Date" );
my $end_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "End_Date" );
return (
[ Report_Name => $header->{Report_Name} || "" ],
[ Report_ID => $header->{Report_ID} || "" ],
[ Release => $header->{Release} || "" ],
[ Institution_Name => $header->{Institution_Name} || "" ],
[ Institution_ID => $self->get_mapped_SUSHI_values( 'Type', $header->{Institution_ID} ) || "" ],
[ Metric_Types => $metric_types || "" ],
[ Report_Filters => $self->get_mapped_SUSHI_values( 'Name', $header->{Report_Filters} ) || "" ],
#TODO: Report_Attributes may need parsing, test this with a SUSHI response that provides it
[ Report_Attributes => $header->{Report_Attributes} || "" ],
[
Exceptions => join(
"; ", map( $_->{Code} . ": " . $_->{Message} . " (" . $_->{Data} . ")", @{ $header->{Exceptions} } )
)
|| ""
],
[ Reporting_Period => "Begin_Date=" . $begin_date . "; End_Date=" . $end_date ],
[ Created => $header->{Created} || "" ],
[ Created_By => $header->{Created_By} || "" ],
[ Registry_Record => $header->{Registry_Record} || "" ],
[""] #empty 14th line (COUNTER 5.1)
);
}
=head3 get_counter51_value
Given a SUSHI response, get the value for the given key in the correct format for the COUNTER report
https://counter5.cambridge.org/r51/sushi-docs/
=cut
sub get_counter51_value {
my ( $self, $item, $key ) = @_;
my $counter_51_value = $item->{$key};
if ( ref($counter_51_value) eq 'ARRAY' ) {
return join( "; ", @$counter_51_value );
} else {
return $counter_51_value;
}
}
=head3 get_mapped_SUSHI_values
Given a SUSHI response, get the value for the given key in the correct format for the COUNTER report
https://counter5.cambridge.org/r51/sushi-docs/
It will return a string of the form "Name:Value;Name:Value;..."
If the value is an array with a single element, just the value will be returned.
If the value is an array with multiple elements, they will be joined with "|"
=cut
sub get_mapped_SUSHI_values {
my ( $self, $key, $sushi_type_value ) = @_;
return join(
"; ",
map {
$_ . ":"
. (
ref $sushi_type_value->{$_} eq 'ARRAY'
&& scalar( @{ $sushi_type_value->{$_} } ) == 1 ? $sushi_type_value->{$_}[0]
: ( ref $sushi_type_value->{$_} eq 'ARRAY' && scalar( @{ $sushi_type_value->{$_} } ) > 1 )
? join( "|", @{ $sushi_type_value->{$_} } )
: $sushi_type_value->{$_}
)
} keys %{$sushi_type_value}
);
}
=head3 _get_SUSHI_Name_Value
Returns "Value" of a given "Name"
=cut
sub _get_SUSHI_Name_Value {
my ( $self, $item, $name ) = @_;
return $self->get_counter51_value( $item, $name );
}
=head3 _get_SUSHI_Type_Value
Returns "Value" of a given "Type"
=cut
sub _get_SUSHI_Type_Value {
my ( $self, $item, $type ) = @_;
return $self->get_counter51_value( $item, $type );
}
=head3 _get_COUNTER_row_usages
Returns the total and monthly usages for a row
=cut
sub _get_COUNTER_row_usages {
my ( $self, $row, $metric_type, $access_type ) = @_;
my @usage_months = $self->_get_usage_months( $self->{sushi}->{header} );
my @usage_months_fields = ();
my $count_total = 0;
foreach my $usage_month (@usage_months) {
my $month_is_empty = 1;
my $usage_to_add;
if ($access_type) {
my @access_type_performances =
grep { $_->{Access_Type} eq $access_type } @{ $row->{Attribute_Performance} };
$usage_to_add = $access_type_performances[0]->{Performance}->{$metric_type}->{$usage_month};
} else {
$usage_to_add = $row->{Attribute_Performance}->[0]->{Performance}->{$metric_type}->{$usage_month};
}
if ( defined $usage_to_add ) {
$count_total += $usage_to_add;
$month_is_empty = 0;
push( @usage_months_fields, $usage_to_add );
}
if ($month_is_empty) {
push( @usage_months_fields, 0 );
}
}
return ( $count_total, @usage_months_fields );
}
=head3 get_SUSHI_metric_types
Given a SUSHI report row, return a sorted list of all the metric types
=cut
sub get_SUSHI_metric_types {
my ( $self, $report_row ) = @_;
my @metric_types = ();
@metric_types = keys %{ $report_row->{Attribute_Performance}->[0]->{Performance} };
@metric_types = sort @metric_types;
return @metric_types;
}
=head3 _COUNTER_report_body
Return the COUNTER report body as an array
=cut
sub _COUNTER_report_body {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my $body = $self->{sushi}->{body};
my @report_body = ();
foreach my $report_row ( @{$body} ) {
my @metric_types = $self->get_SUSHI_metric_types($report_row);
my $specific_fields = $self->get_report_type_specific_fields( $header->{Report_ID} );
my $use_access_type = grep ( /Access_Type/, @{$specific_fields} ) ? 1 : 0;
my $use_yop = grep ( /YOP/, @{$specific_fields} ) ? 1 : 0;
my $use_data_type = grep ( /Data_Type/, @{$specific_fields} ) ? 1 : 0;
if ($use_data_type) {
my %data_types = map { $_->{Data_Type} => 1 } @{ $report_row->{Attribute_Performance} };
my @data_types = sort keys %data_types;
foreach my $data_type (@data_types) {
if ($use_yop) {
my %yops = map { $_->{YOP} => 1 } @{ $report_row->{Attribute_Performance} };
my @yops = sort { $b <=> $a } keys %yops;
foreach my $yop (@yops) {
if ($use_access_type) {
my @access_types = map { $_->{"Access_Type"} } @{ $report_row->{Attribute_Performance} };
foreach my $access_type (@access_types) {
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push(
@report_body,
$self->_COUNTER_report_row(
$report_row, $metric_type, $access_type, $yop,
$data_type
)
);
}
}
} else {
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push(
@report_body,
$self->_COUNTER_report_row( $report_row, $metric_type, undef, $yop, $data_type )
);
}
}
}
} else {
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push(
@report_body,
$self->_COUNTER_report_row( $report_row, $metric_type, undef, undef, $data_type )
);
}
}
}
} elsif ($use_yop) {
my %yops = map { $_->{YOP} => 1 } @{ $report_row->{Attribute_Performance} };
my @yops = sort { $b <=> $a } keys %yops;
foreach my $yop (@yops) {
if ($use_access_type) {
my @access_types = map { $_->{"Access_Type"} } @{ $report_row->{Attribute_Performance} };
foreach my $access_type (@access_types) {
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push(
@report_body,
$self->_COUNTER_report_row( $report_row, $metric_type, $access_type, $yop )
);
}
}
} else {
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push( @report_body, $self->_COUNTER_report_row( $report_row, $metric_type, undef, $yop ) );
}
}
}
} elsif ($use_access_type) {
my @access_types = map { $_->{"Access_Type"} } @{ $report_row->{Attribute_Performance} };
foreach my $access_type (@access_types) {
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push( @report_body, $self->_COUNTER_report_row( $report_row, $metric_type, $access_type ) );
}
}
} else {
foreach my $metric_type (@metric_types) {
push( @report_body, $self->_COUNTER_report_row( $report_row, $metric_type ) );
}
}
}
return @report_body;
}
=head3 _COUNTER_title_report_row
Return a COUNTER title for the COUNTER titles report body
https://cop5.countermetrics.org/en/5.1.0.1/04-reports/03-title-reports.html#column-headings-elements
=cut
sub _COUNTER_title_report_row {
my ( $self, $title_row, $metric_type, $total_usage, $monthly_usages, $access_type, $yop, $data_type ) = @_;
my $header = $self->{sushi}->{header};
my $specific_fields = $self->get_report_type_specific_fields( $header->{Report_ID} );
my $access_type_to_use = $access_type ? $access_type : ( $title_row->{Access_Type} || "" );
my $yop_to_use = $yop ? $yop : ( $title_row->{YOP} || "" );
my $data_type_to_use = $data_type ? $data_type : ( $title_row->{Data_Type} || "" );
return (
[
# Title
$title_row->{Title} || "",
# Publisher
$title_row->{Publisher} || "",
# Publisher_ID
$self->_get_SUSHI_Type_Value( $title_row->{Publisher_ID}, "ISNI" ) || "",
# Platform
$title_row->{Platform} || "",
# DOI
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "DOI" ) || "",
# Proprietary_ID
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Proprietary" ) || "",
# ISBN
grep ( /ISBN/, @{$specific_fields} )
? ( $self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "ISBN" ) || "" )
: (),
# Print_ISSN
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Print_ISSN" ) || "",
# Online_ISSN
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Online_ISSN" ) || "",
# URI - FIXME: What goes in URI?
"",
# Data_Type
grep ( /Data_Type/, @{$specific_fields} ) ? $data_type_to_use : (),
# YOP
grep ( /YOP/, @{$specific_fields} ) ? $yop_to_use : (),
# Access_Type
grep ( /Access_Type/, @{$specific_fields} ) ? $access_type_to_use : (),
# Metric_Type
$metric_type,
# Report_Period_Total
$total_usage,
# Monthly usage entries
@{$monthly_usages}
]
);
}
=head3 _COUNTER_titles_report_column_headings
Return titles report column headings
=cut
sub _COUNTER_titles_report_column_headings {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my @month_headings = $self->_get_usage_months( $header, 1 );
my $specific_fields = $self->get_report_type_specific_fields( $header->{Report_ID} );
return (
[
"Title",
"Publisher",
"Publisher_ID",
"Platform",
"DOI",
"Proprietary_ID",
grep ( /ISBN/, @{$specific_fields} ) ? ("ISBN") : (),
"Print_ISSN",
"Online_ISSN",
"URI",
grep ( /Data_Type/, @{$specific_fields} ) ? ("Data_Type") : (),
#"Section_Type", #TODO: Only if requested (?)
grep ( /YOP/, @{$specific_fields} ) ? ("YOP") : (),
grep ( /Access_Type/, @{$specific_fields} ) ? ("Access_Type") : (),
#"Access_Method", #TODO: Only if requested (?)
"Metric_Type",
"Reporting_Period_Total",
# @month_headings in "Mmm-yyyy" format. TODO: Show unless Exclude_Monthly_Details=true
@month_headings
]
);
}
=head3 get_report_type_specific_fields
Returns the specific fields for a given report_type
=cut
sub get_report_type_specific_fields {
my ( $self, $report_type ) = @_;
my %report_type_map = (
"TR_B1" => [ 'YOP', 'Data_Type', 'ISBN' ],
"TR_B2" => [ 'YOP', 'Data_Type', 'ISBN' ],
"TR_B3" => [ 'YOP', 'Data_Type', 'Access_Type', 'ISBN' ],
"TR_J3" => ['Access_Type'],
"TR_J4" => ['YOP'],
"IR_A1" => [
'Authors', 'Publication_Date', 'Article_Version', 'Print_ISSN', 'Online_ISSN', 'Parent_Title',
'Parent_Authors', 'Parent_Article_Version', 'Parent_DOI', 'Parent_Proprietary_ID', 'Parent_Print_ISSN',
'Parent_Online_ISSN', 'Parent_URI', 'Access_Type'
],
);
return $report_type_map{$report_type};
}
1;

View File

@ -35,6 +35,8 @@ use Koha::ERM::EUsage::UsageDataProvider;
use Koha::ERM::EUsage::SushiCounter;
use Koha::Exceptions::ERM::EUsage::CounterFile;
use C4::Context;
use base qw(Koha::Object);
use Koha::ERM::EUsage::CounterLogs;
@ -83,6 +85,12 @@ Receive background_job_callbacks to be able to update job progress
sub store {
my ( $self, $background_job_callbacks ) = @_;
# DOCS:
# COUNTER 5 CSV examples:
# https://cop5.countermetrics.org/en/5.0.3/appendices/h-sample-counter-master-reports-and-standard-views.html
# COUNTER 5.1 CSV examples:
# https://cop5.projectcounter.org/en/5.1/appendices/g-sample-counter-reports-and-standard-views.html
$self->_set_report_type_from_file;
my $result = $self->SUPER::store;
@ -225,7 +233,10 @@ sub _add_monthly_usage_entries {
my $usage_data_provider = $self->get_usage_data_provider;
my $usage_object_info = $self->_get_usage_object_id_hash($usage_object);
my $specific_fields = Koha::ERM::EUsage::SushiCounter->get_report_type_specific_fields( $self->type );
my $specific_fields = Koha::ERM::EUsage::SushiCounter->get_report_type_specific_fields_by_release(
$self->type,
$self->get_COUNTER_report_release->{header_value}
);
$usage_object->monthly_usages(
[
@ -260,7 +271,10 @@ sub _add_yearly_usage_entries {
my $usage_data_provider = $self->get_usage_data_provider;
my $usage_object_info = $self->_get_usage_object_id_hash($usage_object);
my $specific_fields = Koha::ERM::EUsage::SushiCounter->get_report_type_specific_fields( $self->type );
my $specific_fields = Koha::ERM::EUsage::SushiCounter->get_report_type_specific_fields_by_release(
$self->type,
$self->get_COUNTER_report_release->{header_value}
);
while ( my ( $year, $usage ) = each( %{$yearly_usages} ) ) {
@ -301,21 +315,12 @@ A I <Koha::Exceptions::ERM::EUsage::CounterFile> exception is thrown
sub validate {
my ($self) = @_;
open my $fh, "<", \$self->file_content or die;
my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1 } );
$csv->column_names(qw( header_key header_value ));
my @header_rows = $csv->getline_hr_all( $fh, 0, 12 );
my @header = $header_rows[0];
my @release_row =
map( $_->{header_key} eq 'Release' ? $_ : (), @{ $header[0] } );
my $release = $release_row[0];
my $release = $self->get_COUNTER_report_release;
# TODO: Validate that there is an empty row between header and body
Koha::Exceptions::ERM::EUsage::CounterFile::UnsupportedRelease->throw
if $release && $release->{header_value} != 5;
if $release && ( $release->{header_value} != 5 && $release->{header_value} ne '5.1' );
}
@ -329,7 +334,7 @@ sub _set_report_type_from_file {
my ($self) = @_;
open my $fh, "<", \$self->file_content or die;
my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1 } );
my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1, formula => 'empty' } );
$csv->column_names(qw( header_key header_value ));
my @header_rows = $csv->getline_hr_all( $fh, 0, 12 );
@ -342,6 +347,27 @@ sub _set_report_type_from_file {
$self->type( $report->{header_value} );
}
=head3 get_COUNTER_report_release
Retrieves the COUNTER report release for the given file_content
=cut
sub get_COUNTER_report_release {
my ($self) = @_;
open my $fh, "<", \$self->file_content or die;
my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1, formula => 'empty' } );
$csv->column_names(qw( header_key header_value ));
my @header_rows = $csv->getline_hr_all( $fh, 0, 12 );
my @header = $header_rows[0];
my @release_row =
map( $_->{header_key} eq 'Release' ? $_ : (), @{ $header[0] } );
return $release_row[0];
}
=head3 _get_rows_from_COUNTER_file
Returns array of rows from COUNTER file
@ -352,9 +378,14 @@ sub _get_rows_from_COUNTER_file {
my ($self) = @_;
open my $fh, "<", \$self->file_content or die;
my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1 } );
my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1, formula => 'empty' } );
my $header_columns = $csv->getline_all( $fh, 13, 1 );
my $release = $self->get_COUNTER_report_release;
$release = $release->{header_value};
my $header_rows = $release eq '5.1' ? 14 : 13;
my $header_columns = $csv->getline_all( $fh, $header_rows, 1 );
$csv->column_names( @{$header_columns}[0] );
# Get all rows from 14th onward
@ -558,10 +589,11 @@ Adds a erm_counter_logs database entry
sub _add_counter_log_entry {
my ($self) = @_;
my $user = C4::Context->userenv()->{'number'};
Koha::ERM::EUsage::CounterLog->new(
{
#TODO: borrowernumber only required for manual uploads or "harvest now" button clicks
borrowernumber => undef,
borrowernumber => $user,
counter_files_id => $self->erm_counter_files_id,
importdate => $self->date_uploaded,
filename => $self->filename,
@ -585,7 +617,10 @@ sub _add_usage_object_entry {
my ( $self, $row ) = @_;
my $usage_data_provider = $self->get_usage_data_provider;
my $specific_fields = Koha::ERM::EUsage::SushiCounter->get_report_type_specific_fields( $self->type );
my $specific_fields = Koha::ERM::EUsage::SushiCounter->get_report_type_specific_fields_by_release(
$self->type,
$self->get_COUNTER_report_release->{header_value}
);
if ( $self->type =~ /PR/i ) {
my $new_usage_platform = Koha::ERM::EUsage::UsagePlatform->new(

View File

@ -31,6 +31,33 @@ Koha::ERM::EUsage::CounterLog - Koha ErmCounterLog Object class
=cut
=head3 to_api_mapping
This method returns the mapping for representing a Koha::ERM::EUsage::CounterLog
on the API.
=cut
sub to_api_mapping {
return {
borrowernumber => 'patron_id',
};
}
=head3 patron
Return the patron for this counter_file
=cut
sub patron {
my ($self) = @_;
my $patrons_rs = $self->_result->patron;
return unless $patrons_rs;
return Koha::Patron->_new_from_dbic($patrons_rs);
}
=head2 Internal methods
=head3 _type

View File

@ -41,15 +41,26 @@ Koha::ERM::EUsage::SushiCounter - Koha SushiCounter Object class
sub new {
my ( $class, $params ) = @_;
my $self = $class->SUPER::new;
$self->{sushi} = {
my $counter_release;
if ( $params->{response}->{Report_Header}->{Release} eq "5" ) {
require Koha::ERM::EUsage::COUNTER::5;
$counter_release = Koha::ERM::EUsage::COUNTER::5->new;
} elsif ( $params->{response}->{Report_Header}->{Release} eq "5.1" ) {
require Koha::ERM::EUsage::COUNTER::5_1;
$counter_release = Koha::ERM::EUsage::COUNTER::5_1->new;
} else {
Koha::Exceptions::ERM::EUsage::CounterFile::UnsupportedRelease->throw(
{ counter_release => $params->{response}->{Report_Header}->{Release} } );
}
$counter_release->{sushi} = {
header => $params->{response}->{Report_Header},
body => $params->{response}->{Report_Items}
};
#TODO: Handle empty $self->{sushi}->{body} here!
return $self;
return $counter_release;
}
=head3 get_COUNTER_from_SUSHI
@ -92,47 +103,6 @@ sub _build_COUNTER_report_file {
}
=head3 _COUNTER_report_header
Return a COUNTER report header
https://cop5.projectcounter.org/en/5.0.2/04-reports/03-title-reports.html
=cut
sub _COUNTER_report_header {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my @metric_types_string = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "Metric_Type" );
my $begin_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "Begin_Date" );
my $end_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, "End_Date" );
return (
[ Report_Name => $header->{Report_Name} || "" ],
[ Report_ID => $header->{Report_ID} || "" ],
[ Release => $header->{Release} || "" ],
[ Institution_Name => $header->{Institution_Name} || "" ],
[ Institution_ID => join( "; ", map( $_->{Type} . ":" . $_->{Value}, @{ $header->{Institution_ID} } ) ) || "" ],
[ Metric_Types => join( "; ", split( /\|/, $metric_types_string[0] ) ) || "" ],
[ Report_Filters => join( "; ", map( $_->{Name} . ":" . $_->{Value}, @{ $header->{Report_Filters} } ) ) || "" ],
#TODO: Report_Attributes may need parsing, test this with a SUSHI response that provides it
[ Report_Attributes => $header->{Report_Attributes} || "" ],
[
Exceptions => join(
"; ", map( $_->{Code} . ": " . $_->{Message} . " (" . $_->{Data} . ")", @{ $header->{Exceptions} } )
)
|| ""
],
[ Reporting_Period => "Begin_Date=" . $begin_date . "; End_Date=" . $end_date ],
[ Created => $header->{Created} || "" ],
[ Created_By => $header->{Created_By} || "" ],
[""] #empty 13th line (COUNTER 5)
);
}
=head3 _COUNTER_item_report_row
Return a COUNTER item for the COUNTER items report body
@ -274,71 +244,6 @@ sub _COUNTER_platform_report_row {
);
}
=head3 _COUNTER_title_report_row
Return a COUNTER title for the COUNTER titles report body
https://cop5.projectcounter.org/en/5.0.2/04-reports/03-title-reports.html#column-headings-elements
=cut
sub _COUNTER_title_report_row {
my ( $self, $title_row, $metric_type, $total_usage, $monthly_usages ) = @_;
my $header = $self->{sushi}->{header};
my $specific_fields = $self->get_report_type_specific_fields( $header->{Report_ID} );
return (
[
# Title
$title_row->{Title} || "",
# Publisher
$title_row->{Publisher} || "",
# Publisher_ID
$self->_get_SUSHI_Type_Value( $title_row->{Publisher_ID}, "ISNI" ) || "",
# Platform
$title_row->{Platform} || "",
# DOI
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "DOI" ) || "",
# Proprietary_ID
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Proprietary" ) || "",
# ISBN
grep ( /ISBN/, @{$specific_fields} )
? ( $self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "ISBN" ) || "" )
: (),
# Print_ISSN
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Print_ISSN" ) || "",
# Online_ISSN
$self->_get_SUSHI_Type_Value( $title_row->{Item_ID}, "Online_ISSN" ) || "",
# URI - FIXME: What goes in URI?
"",
# YOP
grep ( /YOP/, @{$specific_fields} ) ? ( $title_row->{YOP} || "" ) : (),
# Access_Type
grep ( /Access_Type/, @{$specific_fields} ) ? ( $title_row->{Access_Type} || "" ) : (),
# Metric_Type
$metric_type,
# Report_Period_Total
$total_usage,
# Monthly usage entries
@{$monthly_usages}
]
);
}
=head3 _COUNTER_report_row
Return a COUNTER row for the COUNTER report body
@ -346,11 +251,11 @@ Return a COUNTER row for the COUNTER report body
=cut
sub _COUNTER_report_row {
my ( $self, $report_row, $metric_type ) = @_;
my ( $self, $report_row, $metric_type, $access_type, $yop, $data_type ) = @_;
my $header = $self->{sushi}->{header};
my ( $total_usage, @monthly_usages ) = $self->_get_COUNTER_row_usages( $report_row, $metric_type );
my ( $total_usage, @monthly_usages ) = $self->_get_COUNTER_row_usages( $report_row, $metric_type, $access_type );
if ( $header->{Report_ID} =~ /PR/i ) {
return $self->_COUNTER_platform_report_row(
@ -360,117 +265,17 @@ sub _COUNTER_report_row {
} elsif ( $header->{Report_ID} =~ /DR/i ) {
return $self->_COUNTER_database_report_row( $report_row, $metric_type, $total_usage, \@monthly_usages );
} elsif ( $header->{Report_ID} =~ /IR/i ) {
#TODO: Send $access_type to _COUNTER_item_report_row like we're doing with _COUNTER_title_report_row
return $self->_COUNTER_item_report_row( $report_row, $metric_type, $total_usage, \@monthly_usages );
} elsif ( $header->{Report_ID} =~ /TR/i ) {
return $self->_COUNTER_title_report_row( $report_row, $metric_type, $total_usage, \@monthly_usages );
return $self->_COUNTER_title_report_row(
$report_row, $metric_type, $total_usage, \@monthly_usages,
$access_type, $yop, $data_type
);
}
}
=head3 _get_COUNTER_row_usages
Returns the total and monthly usages for a row
=cut
sub _get_COUNTER_row_usages {
my ( $self, $row, $metric_type ) = @_;
my @usage_months = $self->_get_usage_months( $self->{sushi}->{header} );
my @usage_months_fields = ();
my $count_total = 0;
foreach my $usage_month (@usage_months) {
my $month_is_empty = 1;
foreach my $performance ( @{ $row->{Performance} } ) {
my $period = $performance->{Period};
my $period_usage_month = substr( $period->{Begin_Date}, 0, 7 );
my $instances = $performance->{Instance};
my @metric_type_count =
map( $_->{Metric_Type} eq $metric_type ? $_->{Count} : (),
@{$instances} );
if ( $period_usage_month eq $usage_month && $metric_type_count[0] ) {
push( @usage_months_fields, $metric_type_count[0] );
$count_total += $metric_type_count[0];
$month_is_empty = 0;
}
}
if ($month_is_empty) {
push( @usage_months_fields, 0 );
}
}
return ( $count_total, @usage_months_fields );
}
=head3 _COUNTER_report_body
Return the COUNTER report body as an array
=cut
sub _COUNTER_report_body {
my ($self) = @_;
my $header = $self->{sushi}->{header};
my $body = $self->{sushi}->{body};
my @report_body = ();
foreach my $report_row ( @{$body} ) {
my @metric_types = ();
# Grab all metric_types this SUSHI result has statistics for
foreach my $performance ( @{ $report_row->{Performance} } ) {
my @SUSHI_metric_types =
map( $_->{Metric_Type}, @{ $performance->{Instance} } );
foreach my $sushi_metric_type (@SUSHI_metric_types) {
push( @metric_types, $sushi_metric_type ) unless grep { $_ eq $sushi_metric_type } @metric_types;
}
}
# Add one report row for each metric_type we're working with
foreach my $metric_type (@metric_types) {
push( @report_body, $self->_COUNTER_report_row( $report_row, $metric_type ) );
}
}
return @report_body;
}
=head3 _get_SUSHI_Name_Value
Returns "Value" of a given "Name"
=cut
sub _get_SUSHI_Name_Value {
my ( $self, $item, $name ) = @_;
my @value = map( $_->{Name} eq $name ? $_->{Value} : (), @{$item} );
return $value[0];
}
=head3 _get_SUSHI_Type_Value
Returns "Value" of a given "Type"
=cut
sub _get_SUSHI_Type_Value {
my ( $self, $item, $type ) = @_;
my @value = map( $_->{Type} eq $type ? $_->{Value} : (), @{$item} );
return $value[0];
}
=head3 _COUNTER_report_column_headings
Returns column headings by report type
@ -617,45 +422,22 @@ sub _COUNTER_platforms_report_column_headings {
);
}
=head3 _COUNTER_titles_report_column_headings
=head3 get_report_type_specific_fields_by_release
Return titles report column headings
Returns the specific fields for a given report_type
=cut
sub _COUNTER_titles_report_column_headings {
my ($self) = @_;
sub get_report_type_specific_fields_by_release {
my ( $self, $report_type, $counter_release ) = @_;
my $header = $self->{sushi}->{header};
my @month_headings = $self->_get_usage_months( $header, 1 );
my $specific_fields = $self->get_report_type_specific_fields( $header->{Report_ID} );
return (
[
"Title",
"Publisher",
"Publisher_ID",
"Platform",
"DOI",
"Proprietary_ID",
grep ( /ISBN/, @{$specific_fields} ) ? ("ISBN") : (),
"Print_ISSN",
"Online_ISSN",
"URI",
#"Data_Type", #TODO: Only if requested (?)
#"Section_Type", #TODO: Only if requested (?)
grep ( /YOP/, @{$specific_fields} ) ? ("YOP") : (),
grep ( /Access_Type/, @{$specific_fields} ) ? ("Access_Type") : (),
#"Access_Method", #TODO: Only if requested (?)
"Metric_Type",
"Reporting_Period_Total",
# @month_headings in "Mmm-yyyy" format. TODO: Show unless Exclude_Monthly_Details=true
@month_headings
]
);
if ( $counter_release eq "5" ) {
require Koha::ERM::EUsage::COUNTER::5;
return Koha::ERM::EUsage::COUNTER::5->get_report_type_specific_fields($report_type);
} elsif ( $counter_release eq "5.1" ) {
require Koha::ERM::EUsage::COUNTER::5_1;
return Koha::ERM::EUsage::COUNTER::5_1->get_report_type_specific_fields($report_type);
}
}
=head3 _get_usage_months
@ -672,11 +454,11 @@ sub _get_usage_months {
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
);
my @begin_date = map( $_->{Name} eq "Begin_Date" ? $_->{Value} : (), @{ $header->{Report_Filters} } );
my @begin_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, 'Begin_Date' );
my $begin_month = substr( $begin_date[0], 5, 2 );
my $begin_year = substr( $begin_date[0], 0, 4 );
my @end_date = map( $_->{Name} eq "End_Date" ? $_->{Value} : (), @{ $header->{Report_Filters} } );
my @end_date = $self->_get_SUSHI_Name_Value( $header->{Report_Filters}, 'End_Date' );
my $end_month = substr( $end_date[0], 5, 2 );
my $end_year = substr( $end_date[0], 0, 4 );
@ -699,32 +481,6 @@ sub _get_usage_months {
return @month_headings;
}
=head3 get_report_type_specific_fields
Returns the specific fields for a given report_type
=cut
sub get_report_type_specific_fields {
my ( $self, $report_type ) = @_;
my %report_type_map = (
"TR_B1" => [ 'YOP', 'ISBN' ],
"TR_B2" => [ 'YOP', 'ISBN' ],
"TR_B3" => [ 'YOP', 'Access_Type', 'ISBN' ],
"TR_J3" => ['Access_Type'],
"TR_J4" => ['YOP'],
"IR_A1" => [
'Authors', 'Publication_Date', 'Article_Version', 'Print_ISSN', 'Online_ISSN', 'Parent_Title',
'Parent_Authors', 'Parent_Article_Version', 'Parent_DOI', 'Parent_Proprietary_ID', 'Parent_Print_ISSN',
'Parent_Online_ISSN', 'Parent_URI', 'Access_Type'
],
);
return $report_type_map{$report_type};
}
=head3 _type
=cut

View File

@ -25,6 +25,8 @@ use LWP::UserAgent;
use Koha::Exceptions;
use Try::Tiny qw( catch try );
use base qw(Koha::Object);
use Koha;
@ -218,24 +220,34 @@ sub harvest_sushi {
return if $self->_sushi_errors($result);
# Parse the SUSHI response
my $sushi_counter = Koha::ERM::EUsage::SushiCounter->new( { response => $result } );
my $counter_file = $sushi_counter->get_COUNTER_from_SUSHI;
try {
my $sushi_counter = Koha::ERM::EUsage::SushiCounter->new( { response => $result } );
my $counter_file = $sushi_counter->get_COUNTER_from_SUSHI;
return if $self->_counter_file_size_too_large($counter_file);
return if $self->_counter_file_size_too_large($counter_file);
$self->counter_files(
[
{
usage_data_provider_id => $self->erm_usage_data_provider_id,
file_content => $counter_file,
date_uploaded => POSIX::strftime( "%Y%m%d%H%M%S", localtime ),
#TODO: add ".csv" to end of filename here
filename => $self->name . "_" . $self->{report_type},
}
]
);
$self->counter_files(
[
{
usage_data_provider_id => $self->erm_usage_data_provider_id,
file_content => $counter_file,
date_uploaded => POSIX::strftime( "%Y%m%d%H%M%S", localtime ),
#TODO: add ".csv" to end of filename here
filename => $self->name . "_" . $self->{report_type},
}
]
);
} catch {
if ( $_->isa('Koha::Exceptions::ERM::EUsage::CounterFile::UnsupportedRelease') ) {
$self->{job_callbacks}->{add_message_callback}->(
{
type => 'error',
message => 'COUNTER release ' . $_->{message}->{counter_release} . ' not supported',
}
) if $self->{job_callbacks};
}
};
}
=head3 set_background_job_callbacks
@ -269,7 +281,7 @@ Tests the connection of the harvester to the SUSHI service and returns any alert
sub test_connection {
my ($self) = @_;
my $url = _validate_url( $self->service_url, 'status' );
my $url = $self->_validate_url( $self->service_url, 'status' );
$url .= 'status';
$url .= '?customer_id=' . $self->customer_id;
$url .= '&requestor_id=' . $self->requestor_id if $self->requestor_id;
@ -384,7 +396,7 @@ sub _build_url_query {
$self->erm_usage_data_provider_id;
}
my $url = _validate_url( $self->service_url, 'harvest' );
my $url = $self->_validate_url( $self->service_url, 'harvest' );
$url .= lc $self->{report_type};
$url .= '?customer_id=' . $self->customer_id;
@ -401,22 +413,27 @@ sub _build_url_query {
Checks whether the url ends in a trailing "/" and adds one if not
my $url = _validate_url($url, 'harvest')
my $url = $self->_validate_url($url, 'harvest')
$caller is either the harvest_sushi function ("harvest") or the test_connection function ("status")
=cut
sub _validate_url {
my ( $url, $caller ) = @_;
my ( $self, $url, $caller ) = @_;
if ( $caller eq 'harvest' ) {
# Not all urls will end in "/" - add one so they are standardised
$url = _check_trailing_character($url);
# All SUSHI report requests should be to the "/reports" endpoint
# Not all providers in the counter registry include this in their data so we need to check and add it
# Default to 5.1 if anything other than '5'
my $report_release = $self->report_release eq '5' ? $self->report_release : '5.1';
if ( $report_release eq '5.1' ) {
my $reports_param = substr $url, -4;
$url .= 'r51/' if $reports_param ne 'r51/';
}
my $reports_param = substr $url, -8;
$url .= 'reports/' if $reports_param ne 'reports/';
} else {
@ -443,6 +460,24 @@ sub _check_trailing_character {
return $url;
}
=head3 sushi_code_is_error
my $is_error = $self->sushi_code_is_error($code);
Determines if a given SUSHI response code is considered an error. Codes greater than 1000 are generally errors unless they are in the list of known warning codes, in which case they are treated as non-errors. Docs at:
https://cop5.projectcounter.org/en/5.0.2/appendices/f-handling-errors-and-exceptions.html
=cut
sub _sushi_code_is_error {
my ($code) = @_;
return 0 unless $code;
my @warning_codes = ( 1011, 3032, 3040, 3050, 3060, 3061, 3062, 3070 );
return 1 if $code > 1000 && !grep { $_ == $code } @warning_codes;
}
=head3 _sushi_errors
Checks and handles possible errors in the SUSHI response
@ -457,12 +492,12 @@ sub _sushi_errors {
my $message = $decoded_response->{Message} // $decoded_response->{message};
my $code = $decoded_response->{Code} // $decoded_response->{code};
if ($severity) {
if ( $severity || _sushi_code_is_error($code) ) {
$self->{job_callbacks}->{add_message_callback}->(
{
type => 'error',
code => $code,
message => $severity . ' - ' . $message,
message => ( $severity ? "$severity - " : '' ) . $message,
}
) if $self->{job_callbacks};
return 1;

View File

@ -228,13 +228,13 @@ sub ftp_download {
)
or return $self->_abort_download(
undef,
"Cannot connect to $self->{account}->host: $EVAL_ERROR"
"Cannot connect to " . $self->{account}->host . ": $EVAL_ERROR"
);
$ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) )
or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" );
or return $self->_abort_download( $ftp, "Cannot login: " . $ftp->message() );
$ftp->cwd( $self->{account}->download_directory )
or return $self->_abort_download( $ftp,
"Cannot change remote dir : $ftp->message()" );
"Cannot change remote dir : " . $ftp->message() );
my $file_list = $ftp->ls()
or
return $self->_abort_download( $ftp, 'cannot get file list from server' );
@ -245,7 +245,7 @@ sub ftp_download {
if ( !$ftp->get( $filename, "$self->{working_dir}/$filename" ) ) {
$self->_abort_download( $ftp,
"Error retrieving $filename: $ftp->message" );
"Error retrieving $filename: " . $ftp->message );
last;
}
@ -273,13 +273,13 @@ sub ftp_upload {
)
or return $self->_abort_download(
undef,
"Cannot connect to $self->{account}->host: $EVAL_ERROR"
"Cannot connect to " . $self->{account}->host . ": $EVAL_ERROR"
);
$ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) )
or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" );
or return $self->_abort_download( $ftp, "Cannot login: " . $ftp->message() );
$ftp->cwd( $self->{account}->upload_directory )
or return $self->_abort_download( $ftp,
"Cannot change remote dir : $ftp->message()" );
"Cannot change remote dir : " . $ftp->message() );
foreach my $m (@messages) {
my $content = $m->raw_msg;
if ($content) {
@ -311,7 +311,7 @@ sub sftp_upload {
port => $port,
timeout => 10,
);
$sftp->die_on_error("Cannot ssh to $self->{account}->host");
$sftp->die_on_error( "Cannot ssh to " . $self->{account}->host );
$sftp->setcwd( $self->{account}->upload_directory )
or return $self->_abort_download( $sftp,
"Cannot change remote dir : " . $sftp->error );
@ -353,7 +353,7 @@ sub file_upload {
$m->update;
}
else {
carp "Could not transfer $m->filename : $ERRNO";
carp "Could not transfer " . $m->filename . " : $ERRNO";
next;
}
}

View File

@ -61,8 +61,9 @@ sub new {
);
}
return $class->SUPER::new(
-key => $encryption_key,
-cipher => 'Cipher::AES'
-key => $encryption_key,
-cipher => 'Cipher::AES',
-nodeprecate => 1,
);
}

View File

@ -7,16 +7,16 @@ use Koha::Exception;
use Exception::Class (
'Koha::Exceptions::BadParameter' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'A bad parameter was given',
fields => ['parameter'],
fields => ['parameter'],
},
'Koha::Exceptions::DuplicateObject' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'Same object already exists',
},
'Koha::Exceptions::FileNotFound' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'File not found',
fields => ['filename'],
},
@ -26,57 +26,62 @@ use Exception::Class (
fields => ['invalid_status'],
},
'Koha::Exceptions::ObjectNotFound' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'The required object doesn\'t exist',
},
'Koha::Exceptions::PayloadTooLarge' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'Request entity is larger than limits defined by server',
},
'Koha::Exceptions::ObjectNotCreated' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'The object have not been created',
},
'Koha::Exceptions::RelatedObjectNotFound' => {
isa => 'Koha::Exception',
description => 'The requested related object does not exist',
fields => [ 'accessor', 'class' ],
},
'Koha::Exceptions::CannotDeleteDefault' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'The default value cannot be deleted'
},
'Koha::Exceptions::CannotDeleteSystem' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'The system value cannot be deleted'
},
'Koha::Exceptions::MissingParameter' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'A required parameter is missing',
fields => ['parameter'],
fields => ['parameter'],
},
'Koha::Exceptions::TooManyParameters' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'Too many parameters given',
},
'Koha::Exceptions::ParameterTooHigh' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'A passed parameter value is too high'
},
'Koha::Exceptions::NoChanges' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'No changes were made',
},
'Koha::Exceptions::WrongParameter' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'Parameter has wrong value or type',
fields => ['name', 'value', 'type'],
fields => [ 'name', 'value', 'type' ],
},
'Koha::Exceptions::NoPermission' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'You do not have permission for this action',
},
'Koha::Exceptions::CannotAddLibraryLimit' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'General problem adding a library limit'
},
'Koha::Exceptions::UnderMaintenance' => {
isa => 'Koha::Exception',
isa => 'Koha::Exception',
description => 'Koha is under maintenance.'
},
'Koha::Exceptions::NoInteger' => {

View File

@ -27,6 +27,10 @@ use Exception::Class (
isa => 'Koha::Exceptions::ArticleRequest',
description => 'Article request limit was reached'
},
'Koha::Exceptions::ArticleRequest::WrongFormat' => {
isa => 'Koha::Exceptions::ArticleRequest',
description => 'Passed format is not locally supported'
},
);
=head1 NAME

View File

@ -26,7 +26,8 @@ use Exception::Class (
},
'Koha::Exceptions::ERM::EUsage::CounterFile::UnsupportedRelease' => {
isa => 'Koha::Exceptions::ERM::EUsage::CounterFile',
description => 'This COUNTER release is not supported'
description => 'This COUNTER release is not supported',
fields => ['counter_release'],
}
);

View File

@ -2,18 +2,18 @@ package Koha::Exceptions::MarcOverlayRule;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
@ -25,11 +25,11 @@ use Exception::Class (
isa => 'Koha::Exception',
},
'Koha::Exceptions::MarcOverlayRule::InvalidTagRegExp' => {
isa => 'Koha::Exceptions::MarcOverlayRule',
isa => 'Koha::Exceptions::MarcOverlayRule',
description => 'Invalid regular expression for tag'
},
'Koha::Exceptions::MarcOverlayRule::InvalidControlFieldActions' => {
isa => 'Koha::Exceptions::MarcOverlayRule',
isa => 'Koha::Exceptions::MarcOverlayRule',
description => 'Invalid control field actions'
}
);

View File

@ -8,6 +8,12 @@ use Exception::Class (
'Koha::Exceptions::REST' => {
isa => 'Koha::Exception',
},
'Koha::Exceptions::REST::Public::Authentication::Required' => {
description => "This public route requires authentication",
},
'Koha::Exceptions::REST::Public::Unauthorized' => {
description => "Unprivileged user cannot access another user's resources",
},
'Koha::Exceptions::REST::Query::InvalidOperator' => {
description => "Invalid operator found in query",
fields => ['operator']

View File

@ -60,9 +60,15 @@ sub filter {
my $value = $subfield->[1];
$value =~ s/[\n\r]+/ /g;
$value =~ s/^\s+|\s+$//g;
$field->add_subfields( $key => $value ); # add subfield to the end of the subfield list
$field->delete_subfield( pos => 0 ); # delete the subfield at the top of the subfield list
$field->add_subfields( $key => $value )
if $value ne q{}
; # add subfield to the end of the subfield list, but only if there is still a non empty value there
$field->delete_subfield( pos => 0 ); # delete the subfield at the top of the subfield list
}
# if it happed that all existing subfields had whitespaces only,
# the field would be empty now and should be removed from the record
$record->delete_fields($field) unless scalar( $field->subfields );
}
}
return $record;

View File

@ -987,6 +987,9 @@ sub store {
}
}
}
if ( exists $updated_columns{branchcode} ) {
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [ $self->biblionumber ] } );
}
}
$self = $self->SUPER::store;
@ -1077,10 +1080,34 @@ Returns a map of column name to string representations including the string.
=cut
sub strings_map {
my ($self) = @_;
return {
pickup_library_id => { str => $self->branch->branchname, type => 'library' },
my ( $self, $params ) = @_;
my $strings = {
pickup_library_id => { str => $self->pickup_library->branchname, type => 'library' },
};
if ( defined $self->cancellation_reason ) {
my $av = Koha::AuthorisedValues->search(
{
category => 'HOLD_CANCELLATION',
authorised_value => $self->cancellation_reason,
}
);
my $cancellation_reason_str =
$av->count
? $params->{public}
? $av->next->opac_description
: $av->next->lib
: $self->cancellation_reason;
$strings->{cancellation_reason} = {
category => 'HOLD_CANCELLATION',
str => $cancellation_reason_str,
type => 'av',
};
}
return $strings;
}
=head2 Internal methods

View File

@ -38,8 +38,8 @@ Koha::Holds - Koha Hold object set class
my $found_holds = $holds->filter_by_found;
Returns a filtered resultset without holds that are considered I<found>.
i.e. 'P', 'T' and 'W'.
Returns a set of holds that are considered I<found>.
Having the code 'P', 'T' or 'W'.
=cut

View File

@ -698,19 +698,19 @@ sub migrate {
my $original_attributes =
$original_request->extended_attributes->search( { type => { '-in' => \@default_attributes } } );
my $request_details =
{ map { $_->type => $_->value } ( $original_attributes->as_list ) };
$request_details->{migrated_from} = $original_request->illrequest_id;
while ( my ( $type, $value ) = each %{$request_details} ) {
Koha::ILL::Request::Attribute->new(
{
illrequest_id => $new_request->illrequest_id,
column_exists( 'illrequestattributes', 'backend' ) ? ( backend => "Standard" ) : (),
type => $type,
value => $value,
}
)->store;
}
my @request_details_array = map {
{
'type' => $_->type,
'value' => $_->value,
}
} $original_attributes->as_list;
push @request_details_array, {
'type' => 'migrated_from',
'value' => $original_request->illrequest_id,
};
$new_request->extended_attributes( \@request_details_array );
return {
error => 0,
@ -796,7 +796,7 @@ sub _set_requested_partners {
type => 'requested_partners'
};
Koha::ILL::Request::Attributes->search($where)->delete();
Koha::ILL::Request::Attributes->new(
Koha::ILL::Request::Attribute->new(
{
illrequest_id => $args->{request}->id,
column_exists( 'illrequestattributes', 'backend' ) ? ( backend => "Standard" ) : (),
@ -991,19 +991,13 @@ sub add_request {
if column_exists( 'illrequests', 'batch_id' );
$request->store;
while ( my ( $type, $value ) = each %{$request_details} ) {
if ( $value && length $value > 0 ) {
Koha::ILL::Request::Attribute->new(
{
illrequest_id => $request->illrequest_id,
column_exists( 'illrequestattributes', 'backend' ) ? ( backend => "Standard" ) : (),
type => $type,
value => $value,
readonly => 0
}
)->store;
my @request_details_array = map {
{
'type' => $_,
'value' => $request_details->{$_},
}
}
} keys %{$request_details};
$request->extended_attributes( \@request_details_array );
return $request;
}

View File

@ -53,7 +53,7 @@
<option value="conference">Conference</option>
[% END %]
[% IF whole.value.other.type.lower == "dvd" %]
<option value="dvd" selected="selected">DVD/option>
<option value="dvd" selected="selected">DVD</option>
[% ELSE %]
<option value="dvd">DVD</option>
[% END %]
@ -91,7 +91,7 @@
<div class="required_label required">Required</div>
</li>
<li>
<label class="required" for="branchcode">Destination library:</label>xxx
<label class="required" for="branchcode">Destination library:</label>
<select id="branchcode" name="branchcode">
<option value=""></option>
[% FOREACH branch IN branches %]

View File

@ -277,12 +277,42 @@ sub library {
my $extended_attributes = $request->extended_attributes;
Returns the linked I<Koha::ILL::Request::Attributes> resultset object.
my $extended_attributes = $request->extended_attributes([
{
type => 'type',
value => 'type_value',
},
{
type => 'type2',
value => 'type2_value',
},
]);
Getter or setter for extended attributes
Getter: Returns the linked I <Koha::ILL::Request::Attributes> resultset object.
Setter: Adds the supplied extended attributes to the request
=cut
sub extended_attributes {
my ( $self ) = @_;
my ( $self, $attributes ) = @_;
if ($attributes) {
my $schema = $self->_result->result_source->schema;
$schema->txn_do(
sub {
for my $attribute (@$attributes) {
$attribute->{backend} = $self->backend;
eval { $self->_result->add_to_illrequestattributes($attribute); };
if ($@) {
warn "Error adding attribute $attribute->{type}: $@";
}
}
}
);
}
my $rs = $self->_result->extended_attributes;
# We call search to use the filters in Koha::ILL::Request::Attributes->search
@ -983,17 +1013,18 @@ pass it $params, as it does not yet have any other data associated with it.
=cut
sub backend_create {
my ( $self, $params ) = @_;
my ( $self, $params, $loggedin_patron ) = @_;
# Establish whether we need to do a generic copyright clearance.
if ( $params->{opac} ) {
my $patron_branchcode = $loggedin_patron ? $loggedin_patron->branchcode : undef;
my $copyright_content = Koha::AdditionalContents->search_for_display(
{
category => 'html_customizations',
location => ['ILLModuleCopyrightClearance'],
lang => $params->{lang},
library_id => $params->{branchcode},
$patron_branchcode ? ( library_id => $patron_branchcode ) : (),
}
);
@ -1689,6 +1720,8 @@ sub send_patron_notice {
});
my @transports = keys %{ $borrower_preferences->{transports} };
return { result => { fail => [ 'email', 'sms' ], success => [] } } unless @transports;
# Notice should come from the library where the request was placed,
# not the patrons home library
my $branch = Koha::Libraries->find($self->branchcode);
@ -1839,7 +1872,7 @@ sub get_notice {
letter_code => $params->{notice_code},
branchcode => $self->branchcode,
message_transport_type => $params->{transport},
lang => $self->patron->lang,
lang => $self->patron ? $self->patron->lang : undef,
tables => {
illrequests => $self->illrequest_id,
borrowers => $self->borrowernumber,

View File

@ -13,6 +13,7 @@ package Koha::Import::OAI::Authorities;
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -13,6 +13,7 @@ package Koha::Import::OAI::Authority;
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

View File

@ -13,6 +13,7 @@ package Koha::Import::OAI::Biblio;
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;

Some files were not shown because too many files have changed in this diff Show More