Commit Graph

60567 Commits

Author SHA1 Message Date
Martin Renvoize 8efbea138b
Bug 34025: (QA follow-up) Restore 730 ind2!=2 filter for Uniform titles
The previous patch incorrectly changed the 730 indicator filter from
[@ind2!=2] to [@ind2=2], which inverts which 730 fields display.
Most 730 fields have a blank second indicator (no information provided),
so this change caused them to disappear from the Uniform titles section.

This restores the original filter so 730 fields with blank or
non-analytical indicators continue to display as Uniform titles.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dc86d450d8)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Martin Renvoize 8160231758
Bug 34025: (QA follow-up) Fix subfield $t handling for 7XX contained works
When 7XX fields contain both name ($a) and title ($t) subfields,
the link should search for the title rather than the name.
This is important for contained works that reference titles
within larger works.

This patch updates both intranet and OPAC XSLT files to check
for the presence of subfield $t and use title search (ti,phr:)
instead of author search (au:) when $t is present.

Test plan:
1. Find or create a bibliographic record with 7XX fields containing both $a (name) and $t (title) subfields
   - For example: 700 $a Smith, John $t The Great Adventure
2. View the record detail page in both staff interface and OPAC
3. In the "Contained works" section, click on the link for the 7XX field entry
4. Verify the search is performed as a title search (ti,phr:"The Great Adventure") rather than author search (au:"Smith, John")
5. Confirm the search results show records matching the title from subfield $t
6. Test with records that have 7XX fields with only $a subfields to ensure they still search by author
7. Repeat testing for different 7XX field types (700, 710, 711)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3c72e5d9c5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Bernard Scaife bc42d53477
Bug 34025: Changing default link search from au to ti,phr for X30 fields as they are are title type ones. These apply if there is no authorised term linked to for the content
Test plan:
==========
1. Add some 130, 240, 730 + 7XX $a + $t fields to a record. Note that 730
   and 7XX $a + $t fields have to have 2nd indicator set to 2.
   You can link the fields to authority records. Ensure that one of the fields is not linkable to an authority record and leave it unlinked.
2. Note that the information displayed from these fields is not
   'clickable' neither in OPAC, nor in the staff interface.
3. Apply the patch ; restart all.
4. You should be able to see and use the links now. If the fields are
   linked to authotiry record and UseAuthoritiesForTracings
   systempreference is set, the search will be performed with
   authid identifier. There should be also a magnifying glass icon
   with a link to the authority record.
5. The links for any unlinked authority should now point to ti,phr - eg /cgi-bin/koha/catalogue/search.pl?q=ti,phr:%22Uniform%20Bernard%22 instead of au
6. Click that link and ensure it finds at least one record (the one you started with)

Signed-off-by: Bernard Scaife <bernard.scaife@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 1cc432c168)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Janusz Kaczmarek 1c5d80f70c
Bug 34025: Make more controlled fields linkable (130, 240, 730 + 7XX $a + $t) [XSLT]
MARC21 contain linking fields (130, 240, 730 + 7XX $a + $t) that currently
currently are not 'clickable'. This patch adds the links, similarly to the links
created for contributors', both in OPAC and staff interface.

Test plan:
==========
1. Add some 130, 240, 730 + 7XX $a + $t fields to a record. Note that 730
   and 7XX $a + $t fields have to have 2nd indicator set to 2.
   You can link the fields to authority records.
2. Not that the information displayed from these fields is not
   'clickable' neither in OPAC, nor in the staff interface.
3. Apply the patch ; restart all.
4. You should be able to see and use the links now. If the fields are
   linked to authotiry record and UseAuthoritiesForTracings
   systempreference is set, the search will be performed with
   authid identifier. There should be also a magnifying glass icon
   with a link to the authority record.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Bernard Scaife <bernard.scaife@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 129c750218)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Martin Renvoize 24fff41e90
Bug 41901: (follow-up) Fix perlcritic violation in unit tests
Remove explicit "return undef" in favour of bare "return" to
satisfy Perl::Critic (PBP p.199).

Signed-off-by: Brian J. Barr <brian.barr@churchofjesuschrist.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 67df3e1e85)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Martin Renvoize 52c16d61c3
Bug 41901: Allow duplicate check when adding authority via API
POST /api/v1/authorities currently offers only the heading-based
C4::AuthoritiesMarc::FindDuplicateAuthority check, and the only
escape hatch is the `x-koha-override` header.

Koha already ships configurable record matching rules (see
Administration > Record matching rules) and C4::Matcher already
supports `record_type = authority`. This patch lets an API caller
opt into one of those rules when creating an authority by sending
its numeric id in a new `x-koha-matchrule` header.

Behaviour:
* If no `x-koha-matchrule` header is sent the existing heading-based
  duplicate check is used. Existing clients are unaffected.
* If `x-koha-matchrule: <id>` is sent:
    * non-existent id          -> 400 `matching_rule_not_found`
    * matcher not record_type=authority
                               -> 400 `invalid_matching_rule_type`
    * matcher returns matches  -> 409 `duplicate`; the response
                                  body additionally contains a
                                  `matches: [{authid, score}, ...]`
                                  array listing every hit returned
                                  by the matcher
    * matcher returns nothing  -> record is created (201)
* `x-koha-override: any|duplicate` continues to bypass all duplicate
  checks, including the matcher.

A non-integer header value is rejected by the OpenAPI schema
validator before the controller runs.

Test plan:
 1) Apply the patch series.
 2) Run `prove t/db_dependent/api/v1/authorities.t`
    => all subtests pass.
 3) Log in to the staff interface as a user with the
    'manage_matching_rules' subpermission and go to
    Administration > Record matching rules > New record matching
    rule:
     a) Set Matching rule code e.g. `AUTH_HEADING`
     b) Set Description e.g. `Authority heading match`
     c) Set Record type to `authority`
     d) Set Threshold to e.g. `1000`
     e) Add a match point:
         * Search index:  `Heading-Main`  (or your authorities index)
         * Score:         `1000`
         * Tag:           `110` (or the heading tag used by your
                          authority type)
         * Subfields:     `a`
     f) Save. Note the numeric matching rule id in the edit URL
        (`admin/matching-rules.pl?op=edit_matching_rule&matcher_id=N`).
 4) Export an existing authority record as MARCXML (for example
    from the authority details page). Save it as `duplicate.xml`.
 5) From the command line, POST the record back to Koha using the
    new header (replace <N>, credentials and host):

    curl -u <user>:<pass> -X POST \
      -H 'Content-Type: application/marcxml+xml' \
      -H 'x-authority-type: CORPO_NAME' \
      -H 'x-koha-matchrule: <N>' \
      --data-binary @duplicate.xml \
      http://<your-koha>/api/v1/authorities

    => Expect HTTP 409. The JSON response body contains
       `error_code: "duplicate"` and a `matches` array listing the
       authid(s) that were found along with their score.
 6) Edit `duplicate.xml` so the main heading is something that is
    not already in the catalogue. POST it again with the same
    header.
    => Expect HTTP 201 and a `Location` header pointing to the new
       authority.
 7) Re-run the POST from step 5 but additionally send
    `-H 'x-koha-override: duplicate'`.
    => Expect HTTP 201 (override bypasses the matcher).
 8) Send a POST with `x-koha-matchrule: 999999`.
    => Expect HTTP 400 with `error_code: "matching_rule_not_found"`.
 9) Create a second matching rule with Record type `biblio` and
    note its id. POST with `x-koha-matchrule` set to that id.
    => Expect HTTP 400 with
       `error_code: "invalid_matching_rule_type"`.
10) POST with `x-koha-matchrule: abc`.
    => Expect HTTP 400 from the OpenAPI schema validator.
11) POST without `x-koha-matchrule`.
    => Expect the existing heading-based duplicate check to run
       exactly as before (409 for a known duplicate, 201 otherwise).
12) Sign off.

Signed-off-by: Brian J. Barr <brian.barr@churchofjesuschrist.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cb8f1ff9d5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Martin Renvoize df27f4884b
Bug 41901: Unit tests
Extends the existing `post() tests` subtest in
t/db_dependent/api/v1/authorities.t with coverage for the new
`x-koha-matchrule` header that selects a Koha record matching rule
(`C4::Matcher`, record_type=authority) for duplicate detection when
creating authorities via POST /api/v1/authorities.

The new cases exercise:
* non-integer id (rejected by the OpenAPI schema validator)
* unknown matcher id -> 400 `matching_rule_not_found`
* biblio matcher id -> 400 `invalid_matching_rule_type`
* valid authority matcher returning duplicates -> 409 with a
  `matches` array of `{authid, score}` objects
* valid authority matcher returning no duplicates -> 201
* matcher combined with `x-koha-override: duplicate` -> 201
  (override wins, matcher is skipped)

`C4::Matcher` is mocked deterministically to avoid relying on the
authority search engine in the test database.

These tests fail without the controller/spec changes introduced in
the follow-up commit.

Test plan:
1) Apply only this patch and run
   `prove t/db_dependent/api/v1/authorities.t`.
   => Failures are expected in the `post() tests` subtest for the
      `x-koha-matchrule` cases.
2) Apply the next patch in the series and re-run the tests.
   => All subtests pass.

Signed-off-by: Brian J. Barr <brian.barr@churchofjesuschrist.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5feb1e03eb)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Martin Renvoize 9870b2d850
Bug 37966: Fix renewal on hold override in circulation.pl
This extends the fix from Bug 37966 to circ/circulation.pl. The original
bug fix addressed circ/renew.pl, where renewing a book on hold with an
empty due date would result in the due date being set to "now" (today).

The same issue occurs in circ/circulation.pl when:
1. Attempting to check out an item that is already checked out to the
   same patron (which triggers a renewal)
2. The item has a hold on it, triggering the hold override dialog
3. The librarian overrides the hold without specifying a due date

In this scenario, the renewal would incorrectly set the due date to
today instead of calculating it based on circulation rules.

CHANGES:

1. circ/circulation.pl (lines 550-558)
   - Added logic to handle the `renewonholdduedate` parameter when
     both RENEW_ISSUE and RESERVED conditions are present
   - Follows the same pattern as circ/renew.pl
   - If `renewonholdduedate` is empty, passes empty string to AddIssue/
     AddRenewal, allowing proper date calculation

2. koha-tmpl/.../circulation.tt (lines 351-356)
   - Added "Renewal due date" input field in the hold override dialog
   - Only appears when both RESERVED and RENEW_ISSUE are true
   - Optional field - if left empty, due date is calculated per
     circulation rules

TEST PLAN:

1. Enable the RenewalOnHoldOverride system preference (set to "Allow")

2. Set up a patron, item, and circulation rules:
   - Create a patron (or use existing)
   - Create an item (or use existing)
   - Ensure circulation rules have a renewal period (e.g., 14 days)

3. Create a hold scenario:
   - Check out the item to the patron
   - Place a title-level hold on the same item (you may need a second
     patron or use the same patron depending on your holds rules)

4. Test renewal via circulation.pl:
   - Go to Circulation (Home > Circulation)
   - Scan the patron's barcode
   - Scan the item's barcode (the one that's already checked out with
     a hold)
   - Observe the hold override dialog appears

5. Test WITHOUT this patch:
   - Leave the "Renewal due date" field empty
   - Click "Yes, renew"
   - BUG: The due date is set to today (same as check-in date)

6. Test WITH this patch:
   - Leave the "Renewal due date" field empty
   - Click "Yes, renew"
   - SUCCESS: The due date is calculated based on circulation rules
     (e.g., 14 days from now if that's your renewal period)

7. Test optional due date override:
   - Repeat the renewal process
   - This time, enter a specific date in "Renewal due date" field
   - Click "Yes, renew"
   - SUCCESS: The due date is set to your specified date

8. Test SpecifyDueDate preference interaction:
   - If SpecifyDueDate is enabled and a due date is set via that
     interface, it should take precedence over renewonholdduedate

TECHNICAL NOTES:

The fix ensures that when `renewonholdduedate` is empty (empty string),
it's passed through to AddIssue which then calls AddRenewal. The
improved empty string handling in C4::Circulation (from the follow-up
commit) ensures empty strings are not parsed as "now" but instead
trigger proper date calculation based on circulation rules.

This matches the behavior fixed in circ/renew.pl and provides a
consistent user experience across both circulation interfaces.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d463fce02d)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Martin Renvoize 53ba4b4841
Bug 37966: (follow-up) Make empty string handling more explicit in Circulation.pm
This commit improves upon the original fix by making the intent more
explicit when handling empty string date parameters in AddRenewal and
AddIssue functions.

WHY THIS IS BETTER:

The original fix (changing `defined $datedue` to just `$datedue`)
works correctly but relies on Perl's implicit truthy/falsy semantics:

  if ( $datedue && ref $datedue ne 'DateTime' )

This is subtle because:
- Empty string "" is falsy, so parsing is skipped ✓
- But it's not immediately obvious that empty strings are being
  handled specially
- The code doesn't explicitly show its intent

THIS APPROACH:

  if ( defined $datedue && $datedue ne '' && ref $datedue ne 'DateTime' )

Benefits:
1. EXPLICIT: Clearly states "only parse if defined AND not empty
   AND not already a DateTime"
2. SELF-DOCUMENTING: Intent is obvious to future developers
3. NO RELIANCE on truthy/falsy semantics
4. CONSISTENT: Same pattern applied across all date parameter handling

COMPREHENSIVE CHANGES:

1. AddRenewal (C4/Circulation.pm:3449)
   - Made datedue empty string check explicit

2. AddIssue (C4/Circulation.pm:1611)
   - Made datedue empty string check explicit
   - Also updated issuedate handling (line 1616) to explicitly handle
     empty strings

3. Test Coverage (t/db_dependent/Circulation/issue.t)
   - Added test for AddIssue with empty string datedue
   - Added test for AddIssue with empty string issuedate
   - Ensures both functions properly calculate dates from circulation
     rules instead of using "now"

The existing test for AddRenewal already covered empty string datedue
(added in the original Bug 37966 commit). These new tests ensure the
same correct behavior for AddIssue.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 14de13d3ad)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Michael Hafen b91ad23bd5
Bug 37966: Add test coverage for AddRenewal with empty due date
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7dbaa5d77c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Michael Hafen 4414a91678
Bug 37966: When Renewing a book on hold, don't require the due date
When renewing a book on hold with the RenewalOnHoldOverride sys pref set
to "Allow", if the due date is not specified then it becomes "now".  By
checking the input is set rather than just defined the due date is set as
expected based on circulation rules.
Also change the description of the RenewalOnHoldOverride sys pref as the
due date would no longer be required to be entered with this change.

Test plan:
1. make sure RenewalOnHoldOverride is set to 'Allow'
2. check out a book, then place a title-level hold on it
3. renew the book, see the hold override dialog
4. leave the due date empty and hit the override button
5. observe the new due date is "now"
6. apply patch and restart plack
7. renew the book again, overriding the hold, and see the expected due date
   as per circulation rules.

Signed-off-by: Marion Durand <marion.durand@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c84de245e3)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Jacob O'Mara 79e9c95312
DBRev 25.11.04.010
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:22 +01:00
Lucas Gass 1149805fa5
Bug 37671: (follow-up) Add INSERT IGNORE to db_rev
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ce92e707e1)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Andrew Fuerste Henry 649170bf46
Bug 37671: (QA follow-up) Add exec flag to atomicupdate
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4586a37b7a)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Andrew Fuerste Henry 06c5be37f1
Bug 37671: (QA follow-up) Tidy printreceipt.pl
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3598cea2ba)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize 3ceca329d4
Bug 37671: (follow-up) Use PAYOUT notice for payout receipts on patron account page
This patch adds support for printing PAYOUT receipts from the patron
account page (members/boraccount.pl) using the new PAYOUT notice template.

Previously, PAYOUT debits used the generic invoice print template. Now
they use the same dedicated PAYOUT receipt template that is used in the
POS register, providing consistent receipt formatting across both
interfaces.

Test plan:
1. Create a charge on a patron account (e.g., Lost item)
2. Pay the charge
3. Refund the payment with a cash payout
4. On the patron account page, click "Print" for the PAYOUT transaction
5. Verify the receipt uses the PAYOUT notice template showing:
   - Transaction details (ID, operator, payout type)
   - Refund details showing what was refunded
   - Total payout amount
6. Verify it matches the format used in the POS register

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 528f81b7fd)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize 55a28aeb5f
Bug 37671: Fix POS receipt printing for refunds
The receipt printing logic was failing because it always expected a credit
but the "Print receipt" button was passing the payout debit line ID.

This fix:
- Updates pos/printreceipt.pl to use previously added PAYOUT template based
  on account line type
- Uses RECEIPT template for credits, PAYOUT template for PAYOUT debits
- Throws proper error for unsupported transaction types

Test plan:
1. Make a purchase through Point of Sale
2. Go to transaction history for the register used
3. Issue a refund for the purchase
4. Click "Print receipt" button for the refund
5. Verify receipt prints correctly with payout details

Sponsored-by: OpenFifth <https://openfifth.co.uk/>
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 e92dfc5ab0)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize c17bda6e93
Bug 37671: Add new 'PAYOUT' notice template
When a refund is processed through Point of Sale, the system creates:
1. A credit account line (the refund)
2. A debit account line (the payout)

The receipt printing logic currently only accounts for RECEIPTs against
credits.

This patch adds a new 'PAYOUT' template for dealing with the negative
debits that make up a payout so we can construct a proper receipt for
this action.

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 02fb697d21)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Jacob O'Mara b89f646461
DBRev 25.11.04.009
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Kyle M Hall 971d1db193
Bug 42447: Add unit tests
PA amended: Removed bug number from subtest

Signed-off-by: Charlie Arthur <carthur@slolibrary.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f0a4659e3c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Kyle M Hall 5cce1eba34
Bug 42447: SIP template fields in the database are too small
The SIP fields in the database are too small for the templates of some configurations, and are truncated during upgrade resulting in invalid templates. It's likely we need more than 255 characters for some templates. We should convert all sip template fields to TEXT fields.

Test Plan:
1) For each template field on a sip account attempt to save a template like:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY
2) Note error preventing you from doing so
3) Apply this patch
4) Run updatedatabase.pl
5) Repeat step 1
6) Note you can now do so without error!

Signed-off-by: Charlie Arthur <carthur@slolibrary.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7693360a0f)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Jacob O'Mara d265afefb5
DBRev 25.11.04.008
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize 95cddee07b
Bug 40633: Open fixed-length field helpers from the advanced editor
The advanced cataloging editor lets users hand-edit MARC records as
text but offers no equivalent of the basic editor's value_builder
popups for the fixed-length fields (Leader, 006, 007 and 008).
Catalogers have to type those byte strings by hand, which is error
prone.

This patch wires the 'open_helper_plugin' shortcut (added in the
preceding atomic update) to a new handler in the advanced editor
which:

 - inspects the line under the cursor;
 - if it is a Leader, 006, 007 or 008 control field, opens the
   corresponding marc21_*.pl plugin from cataloguing/value_builder/
   in a popup window, pre-populated with the current value;
 - splices the plugin's returned value back into the CodeMirror buffer
   when the popup closes.

The plugin templates are reused unchanged: a hidden
<input id="adv_editor_fixedfield_buffer"> on the editor page satisfies
the existing report() callback contract, and the editor polls
window.closed to detect submission. The 008 plugin is given the
current Leader value via &leader= so its material-type byte map
matches the record being edited.

The shortcut description is added to keyboard_shortcuts.inc so it
appears with a meaningful label in the in-editor "show shortcuts"
popover and in Administration > Keyboard shortcuts.

Test plan:
1. Apply this patch on top of the preceding atomic update.
2. Visit Administration > Keyboard shortcuts and confirm
   'open_helper_plugin' is listed with description "Open fixed-length
   field helper (Leader, 006, 007, 008)" and that the key combination
   can be edited.
3. Open the advanced cataloging editor on any record:
   a. Place the cursor on the 000 (Leader) line and press Shift-Ctrl-H.
      The marc21_leader popup should open with the current Leader
      value. Make a change, click OK, and confirm the Leader line
      updates in the editor and is marked modified in the gutter.
   b. Repeat for 006, 007 and 008. For 008, change the Leader's
      material-type byte first and confirm the 008 popup form adapts.
   c. Place the cursor on a 245 (or any non-fixed-length field) line
      and press Shift-Ctrl-H. Nothing should happen.
   d. Open a popup, then close it without saving. The editor line
      should remain unchanged.
4. Save the record and confirm the new fixed-field values round-trip
   correctly when the record is reloaded.
5. Confirm the basic editor's value_builder popups still work
   unchanged on Leader / 006 / 007 / 008.

Sponsored-by: Main Library Alliance <https://www.mainlib.org/>
Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 995bfe2083)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize a12b71e93c
Bug 40633: Add new keyboard shortcut for the fixed-length field helper
This adds a new 'open_helper_plugin' keyboard shortcut to the
keyboard_shortcuts table, used by the advanced cataloging editor to
open the value_builder popup for the Leader, 006, 007 and 008 fixed
length fields. The default key combination is Shift-Ctrl-H ("Helper")
and is rebindable from Administration > Keyboard shortcuts. The
behaviour bound to this shortcut is added in a follow-up patch.

Test plan:
1. Apply this patch and run installer/data/mysql/updatedatabase.pl in
   KTD.
2. Run:
     SELECT * FROM keyboard_shortcuts
      WHERE shortcut_name = 'open_helper_plugin';
   Confirm a row exists with shortcut_keys = 'Shift-Ctrl-H'.
3. Re-run updatedatabase.pl and confirm the atomic update is idempotent
   (no error, no duplicate row).
4. On a fresh install (or by re-loading mandatory/keyboard_shortcuts.sql
   on an empty table) confirm the same row is created.

Sponsored-by: Main Library Alliance <https://www.mainlib.org/>
Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 37ad6039c6)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Kabooshki a71b1e1043
Bug 42106: Spelling: Failed to load plugin url: {0}
This patch fixes the url casing on both translation messages from "url"
to "URL" for better grammatical accuracy of the acronym.

Error not mentioned in original Bug Message hence replication is
undefined.

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 f019e490f9)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Tom Yates 94d0f168ba
Bug 41516: Terminology: Change cardnumber to card number for system preference descriptions
Following the terminology guidelines, the descriptions for AutoSwitchPatron,
CardnumberLog and SelfCheckoutByLogin have been updated to use 'card number'
with a space.

Test plan:
1. Review the descriptions for the system preferences and note that 'cardnumber'
   is used, instead of 'card number' for:
   - AutoSwitchPatron
   - CardnumberLog
   - SelfCheckoutByLogin
2. Apply the patch.
3. Repeat step 1, and note that the system preferences now use 'card number'.

Signed-off-by: Tom Yates <tom@hire-tom.co.uk>
Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dc644f0095)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Jacob O'Mara f8ce8ea57c
DBRev 25.11.04.007
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize c5d5bba636
Bug 42156: (QA follow-up) Expand unit tests for recovery and skip paths
The original test only verified that a warning was emitted when a corrupt
authority record was encountered; it did not assert that get_matches
returned the recovered record, that an unrecoverable record was dropped,
or that a stale index pointing at a deleted authid was handled.

This patch turns the 'get_matches bad record test' subtest into a full
exercise of the three code paths introduced on this bug:

 1 - Recoverable: a record with stray non-XML characters is repaired by
     record_strip_nonxml and returned in the match list with the expected
     authid.
 2 - Unrecoverable: record_strip_nonxml is mocked to return undef; the
     parse warning still fires but the record is silently dropped from
     the result set (no die).
 3 - Stale search index: search_auth_compat returns an authid that does
     not exist in auth_header; get_matches no longer dies and returns an
     empty result.

The MarcMatcher fixture is given an explicit threshold of 1 so the 1000
score on the authority matchpoint always passes and matches are returned.

Test plan:
 1 - prove t/db_dependent/Matcher.t
 2 - All subtests pass including the expanded 'get_matches bad record test'.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 77237445b1)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize 9ebd378149
Bug 42156: (QA follow-up) Register the new 'authid' search field on upgrade
Adding an entry to admin/searchengine/elasticsearch/mappings.yaml is only
picked up by fresh installs or when an administrator explicitly resets the
search mappings (rebuild_elasticsearch.pl -r). Existing installations would
otherwise never see the new 'authid' index in the admin UI nor have it
available as a matching index until they ran the reset.

This atomicupdate inserts:
 - a search_field row for 'authid' (type 'stdno', staff_client + opac on)
 - search_marc_map rows for authorities/marc21/001 and authorities/unimarc/001
   (INSERT IGNORE - the rows are shared with 'local-number' and usually
   already exist)
 - search_marc_to_field rows linking those MARC maps to the new field with
   sort on, matching mappings.yaml

It is a no-op if 'authid' is already present.

Administrators still need to rebuild the Elasticsearch index for the new
field to become queryable - this is noted with say_info at the end.

Test plan:
 1 - On an existing instance without the patch: note there is no 'authid'
     field under Administration > Search engine configuration (Elasticsearch)
     for authorities.
 2 - Apply the whole patchset.
 3 - perl installer/data/mysql/updatedatabase.pl
 4 - Re-check the search engine configuration: 'authid' appears for the
     authorities index, mapped to 001 for both MARC flavours.
 5 - Run the update again - confirm the "already exists, skipping" warning.
 6 - misc/search_tools/rebuild_elasticsearch.pl -r -v -a
 7 - Confirm a matching rule using index 'authid' now works.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a3797f3f5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize 85d822f758
Bug 42156: (QA follow-up) Correct POD typos and demote private helpers
The previous POD follow-up added headings for the private helper subs but
introduced several typos and used =head2, which puts them at the same level
as the public API in the generated docs. This patch:

 - Fixes typos: matchpint, pionts, march matcher, mathcpoints, etc.
 - Clarifies a couple of descriptions.
 - Demotes each private helper from =head2 to =head3 so they render as
   implementation notes rather than peers of the public methods, matching
   the pattern used in Koha::Authority's "Internal methods" block.

Helper subs remain interleaved with the public API in source order to keep
the diff minimal; a wholesale move into a dedicated "Internal functions"
section would be a larger refactor outside the scope of this bug.

Test plan:
 1 - perldoc C4/Matcher.pm
 2 - Confirm no typos are rendered and the private helpers appear one level
     deeper than the public methods.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9f1ae44cc7)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Martin Renvoize 15878ddc15
Bug 42156: (QA follow-up) Guard against missing or unparseable authority records
The previous defensive block still dereferenced $target_auth unconditionally
when attempting to recover via record_strip_nonxml. If Koha::Authorities->find
returned undef (stale search index pointing at a deleted authid) the eval
around ->record would catch the first failure, but the recovery call on the
next line would die uncaught.

This patch:
 - Skips silently when the authid returned by the search engine no longer
   exists in the database, so get_matches cannot die on a stale index.
 - Wraps record_strip_nonxml in eval so an exception there is also handled
   and the record is simply skipped - matching the stated intent of the
   "skip when not possible" path.

Test plan:
 1 - Run t/db_dependent/Matcher.t - still passes.
 2 - Simulate a stale index: mock search_auth_compat to return an authid
     that is not present in auth_header. Confirm get_matches no longer dies
     and returns without error.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9d2b2c2493)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Nick Clemens 75884ec99a
Bug 42156: (QA follow-up) Missing POD
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 94a9712745)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Nick Clemens abef7dc7bd
Bug 42156: Unit tests
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 f141799531)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:21 +01:00
Nick Clemens a2584a71f4
Bug 42156: Attempt to repair corrupted records and skip when not possible
When matching authorities we can die on a bad record, we should add protection against this
on top of bug 41843

To test:
 1 - Apply index patch and rebuild elastic
    perl misc/search_tools/rebuild_elasticsearch.pl -r -v
 2 - Make a new record matching rule
    threshold: 1000
    type: authority
    index: authid
    score: 1000
    tag: 001
 3 - Choose an authority record and corrupt it:
    sudo koha-mysql kohadev
    UPDATE auth_header SET marcxml = UpdateXML(marcxml, '//datafield[@tag="040"]/subfield[@code="c"]',CONCAT('<subfield code',CHAR(27),'="c">OSt</subfield>')) WHERE auth_header.authid=92;
 4 - View and save the record as marcxml
    http://localhost:8081/cgi-bin/koha/authorities/detail.pl?authid=92
 5 - Cataloging - stage marc records - authority/marcxml/no matching
 6 - Confirm it stages
 7 - Attempt to match using your new rule
 8 - Get an error parsing the marc
 9 - Apply patch, restart all
10 - Relaod the staged batch
11 - Attempt matching agaion
12 - Success!

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 c5adbe0818)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Nick Clemens 190d132268
Bug 42156: Add a stdno index for authid
In order to allow matching on authid we need a search index with a ci_raw
field

local-number is indexed as a number, and needed that way for sorting. This adds
a stdno version of 001 as authid

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 88cfb35e5e)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
David Nind 38ab9ccf7a
Bug 39748: (follow-up) Update number of tests
Tests were failing as the number of tests was incorrect
as bug 42085 added additional tests.

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>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ec88f94c42)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
David Cook f398bd43f3
Bug 39748: Fix Koha::Patron->is_expired to calculate using floating timezone
This patch updates Koha::Patron->is_expired so that it uses the floating
timezone for its datemath calculation.

Test plan:
0. Apply only the first patch including the unit test
1. prove -v t/db_dependent/Koha/ILL/Request.t \
        t/db_dependent/Koha/Patron/Restriction.t \
        t/db_dependent/Koha/Patrons.t \
        t/db_dependent/Koha/AdditionalContents.t \
        t/db_dependent/ILSDI_Services.t
2. Note that the unit tests fail
3. Apply the patch including the fix
4. prove -v t/db_dependent/Koha/ILL/Request.t \
        t/db_dependent/Koha/Patron/Restriction.t \
        t/db_dependent/Koha/Patrons.t \
        t/db_dependent/Koha/AdditionalContents.t \
        t/db_dependent/ILSDI_Services.t
5. Note that all unit tests pass now

6. Bonus points:
- Add the following to the top of /etc/koha/sites/kohadev/plack.psgi
before Modern::Perl:
use Test::MockTime;
BEGIN {
    Test::MockTime::set_absolute_time('1745580600');
}

- koha-plack --restart kohadev
- Look at the About page and do some circulation
- Without the patches, you'll get an internal server error
- With the patches, it'll just work

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>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 076c5bce8d)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
David Cook 4a804af13c
Bug 39748: Add unit test
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>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e0859f245f)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Lucas Gass f37e638178
Bug 27826: (RM follow-up) Attempt to fix failing test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4f58ed8953)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Jonathan Druart 2ea04c6a80
Bug 27826: Fix OPAC/SCO_spec.ts
1. The DELETE in afterEach was not needed
2. The test was failing randomly on the UPDATE of the beforeEach
  `Duplicate entry '+42+' for key 'itembarcodeidx'`
I don't explain it, but this patch should fix the failure.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 084c07a0fe)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Jonathan Druart 1d3d23d09c
Bug 27826: Add a Cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0fb44d7ab5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Tadeusz „tadzik” Sośnierz 35b20bfc1b
Bug 27826: Escape regexes when checking for new items in sco-main.tt
Test plan:

1. In KTD, go to cgi-bin/koha/catalogue/detail.pl?biblionumber=11
2. Edit the item, set its biblionumber to "+12345"
3. Go to self-checkout at /cgi-bin/koha/sco/sco-main.pl, log in (42:koha)
4. Enter "+12345" into the "Scan a new item" input field, submit
5. Observe a crash
6. Apply patch
7. Refresh the page, observe no patch
8. Renew item, refresh a few times, to observe the "NEW" badge working as expected

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 ec938d2a1d)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Casey Conlin 64a36ad2fe
Bug 42359: Fix Guided.t update_sql test input
The test was feeding update_sql object field names instead of the parameter names it actually expects.
This let savedsql get cleared during the update.
The test was updated to pass the expected inputs so it still checks cache_expiry without creating the warning in the delete log path.

Test plan:
1. Confirm the issue by enabling the ReportsLog preference in Koha UI andin ktd shell running prove t/db_dependent/Reports/Guided.t
2. Apply the patch.
3. Run the tests again with prove t/db_dependent/Reports/Guided.t
4. The tests should pass.
5. Disable the preference and run again.
6. Tests should pass.
7. Sign off if steps above check out.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d09c65d047)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Andreas Roussos e172de3d7a
Bug 21453: Copy data to the correct subfields when linking authorities with authorities
When using the authority finder plugin from within Koha's
Authorities module, you can pick an entry from the 'Special
relationship:' dropdown menu in order to set the relationship
between authorities.

The problem is that in UNIMARC setups, when you click on
'Choose' to select an authority, it does not populate
subfields $3 (Authority Record Number) and $5 (Tracing
Control), which are required for authority linking and
authority hierarchies to work properly.

In MARC21, all authority data is correctly copied over.

This is due to hardcoded subfield values which are
MARC21-specific in blinddetail-biblio-search{.pl,.tt}.

This patch fixes that by checking the value of the
'marcflavour' syspref, and then setting the correct
subfields to copy the authority data to.

Test plan (involves testing in both a MARC21 and a UNIMARC instance):

0) [PREREQUISITES in order for the authority finder plugin to come up
    when testing in a UNIMARC instance]
   a) You must have at least one authority type besides the 'Default'.
   b) View the MARC structure of the 'Default' auth type, then click
      on 'Actions->Subfields' for tag 500; click on 'Edit subfields'.
      Select the subfield 'a' tab, then pick an auth type from the
      'Thesaurus:' dropdown menu; click 'Save changes' at the top.

1) In the Staff client, go to Authorities, then click 'New Authority'
   and pick the 'Default' authority type.

2) When the authority editor comes up, go to tag 500 and expand it.

3) Click on the Tag editor icon next to subfield $a.

4) When the authority finder comes up, search for an authority, pick
   a relator code from the 'Special relationship:' dropdown, and then
   click on the 'Choose' button for one of the authorities you found.

5) In MARC21: all subfields are populated correctly.
   In UNIMARC: notice how subfields $3 and $5 are *not* populated.

6) Apply the patch.

7) Repeat steps 3) and 4) above.
   In MARC21: all subfields are populated correctly, as before.
   In UNIMARC: both the relator code and the authority id are copied
               over along with any other subfields that may exist.

8) To ensure that authority linking in the Cataloging module works
   as before, launch the bibliographic record editor, find a MARC
   tag that allows you to search for an authority, and link it.
   In MARC21: all authority data is copied over (authid in $9).
   In UNIMARC: all authority data is copied over (authid in $9).

   NOTE: after linking, you may have to expand the MARC tag you
         chose so that subfield $9 becomes visible.

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 d88274881e)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Saiful Amin d0f0ec542f
Bug 41353: koha-dump failing on mysqldump PROCESS privileges
Problem:
Starting from MySQL 5.7.31 and MySQL 8.0.20, mysqldump requires the
PROCESS privilege to access tablespace metadata by default. Without
this privilege, backup operations fail with permission errors.

Solution:
Add the --no-tablespaces flag to the dbflag variable. This prevents
mysqldump from attempting to access tablespace metadata, allowing
backups to complete successfully without requiring the PROCESS privilege.

Test Plan:
  1. Set up a MySQL instance (5.7.31+ or 8.0.20+) without PROCESS privilege for the Koha database user
  2. Run the koha-dump script for a Koha instance:
     sudo koha-dump kohadev
  3. Notice the backup fails with a PROCESS privilege error
  4. Apply the patch
  5. Copy debian/scripts/koha-dump to /usr/sbin/koha-dump
  6. Repeat step 2
  7. Notice the backup now completes successfully without permission errors
  8. Test restoring the dump to ensure it's valid:
     zcat /var/spool/koha/kohadev/kohadev-<date>.sql.gz | tail
  9. 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 1f325d5799)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Caroline Cyr La Rose f957103cea
Bug 42309: JS error when there are no cash registers
This patch corrects a JavaScript error that appears on the cash
registers page when there are no cash registers yet.

To test :
BEFORE applying the patch
0. Make sure there are no cash registers in the database (reset_all if using ktd, or delete them)

1. Enable UseCashRegisters
   1.1. Go to Administration > System preferences
   1.2. Search for UseCashRegisters
   1.3. Set UseCashRegisters to Use
   1.4. Click Save all Accounting preferences

2. Open the browser developer tools (F12) and select the Console tab

3. Go to Administration > Cash registers
   --> Uncaught TypeError: can't access property "DataTable", crtable is undefined

4. Apply the patch

5. Refresh the cash registers page
   --> The error is gone!

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 b74f544231)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Jonathan Druart 06aad6058c
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>
2026-05-24 13:42:20 +01:00
Jonathan Druart 369acd42e2
Bug 42341: Fix translatability of 'Print label' on staff detail page
To test:
- Activate SpineLabelShowPrintOnBibDetails
- Install any translation. For ktd:
  sudo koha-translate --install de-DE --dev kohadev
- Activate translation with StaffInterfaceLanguages
- Find a bibliographic record with items and callnumbers in staff
- Verify the "Print label" is translated when switching between languages

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 be9efe452d)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
David Cook 75607c3f6b
Bug 42163: (follow-up) fix plugin wrapper menus, plugins-home.tt, and plugins-upload.tt
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 213693ed4f)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00
Lisette Scheer 16c68c9294
Bug 42163: Allow plugin wrapper to load VueJS
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 63695f05d5)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:20 +01:00