Commit Graph

59808 Commits

Author SHA1 Message Date
Martin Renvoize 92d6fcf2bd
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>
2025-12-01 08:34:05 -07:00
Jonathan Druart 46bfbfee2d
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>
2025-12-01 08:34:04 -07:00
Jonathan Druart 0485296221
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>
2025-12-01 08:34:04 -07:00
Katrin Fischer 59d07337de
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>
2025-12-01 08:34:03 -07:00
Martin Renvoize af31453c63
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>
2025-12-01 08:34:03 -07:00
David Cook a6ba625592
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>
2025-12-01 08:34:02 -07:00
Jonathan Druart 17b3158b35
Bug 41314: Fix column visibility on the checkouts table
Currently the column visibility is broken because the table is not using bKohaColumnsUseNames.
We should first fix that because it's a bug (and a regression certainly caused by DT's saveState, bug 33484).

Then it will be quite trivial to move it to the table's settings.

Column visibility must use bKohaColumnsUseNames when some columns are
displayed/hidden depending on sysprefs (or other variables).

Test plan:
0. Do not apply this patch
1. Check an item out for a patron
2. Turn on ExportCircHistory
3. Reload the checkouts table
=> The export column is not displayed (FAIL)
4. Open the dev console (ctrl+shift+c on Firefox), Storage tab => local
   storage. Remove the 2 keys (only one may exist)
   DataTables_circ_circulation_issues-table
   DataTables_members_moremember_issues-table
5. Reload the checkouts table
=> The export column is displayed
6. Turn off ExportCircHistory
7. Reload the checkouts table
=> The column column is displayed (FAIL)
Well, you got the idea, the syspref's value is not taken into account
when a DataTable's state already exists in the local storage.
Now apply this patch and repeat the different steps, on the two tabs
 * "Check out" (circ/circulation.pl)
 * "Default" (members/moremember.pl)

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>
2025-12-01 08:34:01 -07:00
Jonathan Druart d3577b9277
Bug 40680: Fix t tests
Amended patch
@ t/db_dependent/Realtime_holdsqueue.t:26 @ use Test::MockModule;
-use C4::SIP::ILS::Transaction::Checkin qw( do_checkin );
+use C4::SIP::ILS::Transaction::Checkin;

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:34:01 -07:00
Jonathan Druart 41341ecccc
Bug 40680: Fix C4::Calendar imports
Attempt to call undefined import method with arguments (new ...) via package C4::Calendar (Perhaps you forgot to load the package?) at t/db_dependent/Hold.t line 25.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:34:00 -07:00
Jonathan Druart af63bcd9d3
Bug 40680: Fix t/Labels*
Attempt to call undefined import method with arguments (split_callnumber) via package C4::ClassSplitRoutine::LCC (Perhaps you forgot to load the package?) at t/Labels.t line 22.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:34:00 -07:00
Jonathan Druart 03f8ca2578
Bug 40680: Fix svc/virtualshelves/search
Attempt to call undefined import method with arguments (search) via package C4::Utils::DataTables::VirtualShelves (Perhaps you forgot to load the package?) at svc/virtualshelves/search line 8.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:59 -07:00
Jonathan Druart 38d518c7bf
Bug 40680: Fix TestBuilder
perl -wc misc/devel/create_test_data.pl
Attempt to call undefined import method with arguments ("schema") via package "Koha::Database" (Perhaps you forgot to load the package?) at /kohadevbox/koha/t/lib/TestBuilder.pm line 5.
Attempt to call undefined import method with arguments ("_type") via package "Koha::Biblios" (Perhaps you forgot to load the package?) at /kohadevbox/koha/t/lib/TestBuilder.pm line 7.
Attempt to call undefined import method with arguments ("_type") via package "Koha::Items" (Perhaps you forgot to load the package?) at /kohadevbox/koha/t/lib/TestBuilder.pm line 8.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:59 -07:00
Jonathan Druart 7f9e2019a0
Bug 40680: Fix admin/matching-rules.pl
Attempt to call undefined import method with arguments (valid_normalization_routines) via package C4::Matcher (Perhaps you forgot to load the package?) at admin/matching-rules.pl line 27.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:58 -07:00
Jonathan Druart a42a263cbf
Bug 40680: Fix admin/columns_settings.pl
Attempt to call undefined import method with arguments (get_modules) via package C4::Utils::DataTables::TablesSettings (Perhaps you forgot to load the package?) at admin/columns_settings.pl line 8.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:58 -07:00
Jonathan Druart dbdf80ad1f
Bug 40680: Fix acqui scripts
Attempt to call undefined import method with arguments (get_active) via package Koha::Acquisition::Currencies (Perhaps you forgot to load the package?) at acqui/addorder.pl line 133.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:57 -07:00
Jonathan Druart 1c485e7668
Bug 40680: Fix C4/Patroncards/Patroncard.pm
Attempt to call undefined import method with arguments (StrWidth) via package C4::Creators::PDF (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 28.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:57 -07:00
Jonathan Druart beac9eae8f
Bug 40680: Move EXPORT_OK right after Modern::Perl
So it is done before the other use statements.

Also uniformize the pattern, must now be:
```
use Modern::Perl;
use base 'Exporter';
BEGIN {
    our @EXPORT_OK = qw(subroutine list);
}
```

Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
  Bug38936 exported redirect_if_opac_suppressed
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:56 -07:00
Jonathan Druart 95e704450c
Bug 40680: Remove duplicated code
From commit b40ceb1cf5
     Bug 39367: Manual changes

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-01 08:33:47 -07:00
Jonathan Druart 7adeda91f1
Bug 38426: yarn.lock changes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-11-28 09:27:25 +01:00
Jonathan Druart dda7bfde67
Bug 38426: Correct types/ws version
error "webpack-dev-server##@types/ws@^8.5.5" doesn't satisfy found match of "webpack-dev-server#@types/ws@8.5.3"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-11-28 09:27:22 +01:00
Pedro Amorim 592d966d67
Bug 37893: Handle SIPconfig.xml not found / unreadable
prove t/db_dependent/Koha/SIP2/SIP2ModuleMigration.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-26 10:40:35 -07:00
Owen Leonard 0eb18dffd7
Bug 26258: Circulation tabs inconsistent with counters
This patch makes changes to the markup, style, and behaviour of counters
which are displayed on the patron's account tabs: Checkouts, Holds, etc.

This is a simplified patch compared to previous versions in order to try
to get this moving foward. The patch no longer includes added code to
keep tab counts up to date as, for instance, claims are added or
removed.

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

 - Enable features if necessary: recalls, article requests, claims,
   clubs, and patron lists. Test both from the checkout page and the
   patron detail page.

Recalls:

- If necessary, check out some items to patrons so that there are titles
  which can be recalled.
- Log in to the OPAC and place one or more recalls.
- Return to the staff interface and view the "Recalls" tab on the
  patron's account.

Return claims:

- If necessary, check out some items to a patron. Click the "Claim
  returned" button on a few of the patron's checkouts.
- As you add claims, the "Claims" tab should update the count of claims.

  *** NOTE: This changes the display of claims in the tab so that the
      count of unresolved claims appears first: "Unresolved / Resolved".
      I think it makes more sense for the first number to be the one
      which shows the number of "active" issues.

- Test setting the ClaimReturnedWarningThreshold system preference to
  various values: e.g. empty, 1, 5.
  - If the pref is empty, OR if the pref is set to a number higher
    than the number of patron claims, the count of claims should be
    styled with the "info" blue background and the count of resolved
    claims is not shown.

    *** NOTE: Hiding the resolved claims seems logical if there is not a
        concern about the total number of claims.

  - If the number of all claims exceeds the value of the preference,
    the tab should show a count of "Unresolved claims / Resolved claims"
    with the yellow warning style.

Restrictions:

- Adding a restriction to the account should cause a counter with a
  red background to appear on the tab.

Clubs:

- If necessary, create at least one club template and then multiple
  clubs.
- From the "Clubs" tab on the patron's account, try enrolling and
  cancelling enrollments to confirm that the count on the tab updates
  correctly.

  *** NOTE: I have removed the count of available clubs because I think
      it's not relevant to this interface. We don't do it with patron
      lists, so this makes it a little more consistent..

Patron lists:

- If necessary, create two ore more patron lists.
- From the "Patron lists" tab, try adding and removing the patron from
  lists.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-26 10:40:35 -07:00
CJ Lynce cd36f5182b
Bug 33647: (follow-up) Wording update & only show lastseen if activity is tracked
This follow-up implements these suggestions:
A. Uses 'not recorded' instead of never when there is no date.
B. Only shows lastseen if syspref TrackLastPatronActivityTriggers has at least one trigger.

To test:

1. Apply patch
2. Ensure syspref TrackLastPatronActivityTriggers has no triggers set.
3. Check patron record top left corner to verify lastseen is not shown.
4. Change system TrackLastPatronActivityTriggers to trigger on Checking out an item.
5. Recheck patron record top left corner to verify lastseen says "not recorded".
6. Check out a book to patron
7. Recheck patron record top left corner to verify there is a date and time shown.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
2025-11-26 10:40:34 -07:00
Lari Strand 6597894506
Bug 33647: (follow-up) Add UI improvements
Use colon for Updated on and Last seen on texts
If lastseen value doesn't exist, show the text 'Never' in UI

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
2025-11-26 10:40:34 -07:00
Owen Leonard e2ad52b829
Bug 33647: (follow-up) Don't try to show last seen info if there is none
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
2025-11-26 10:40:33 -07:00
Lari Strand 0cafe666a3
Bug 33647: Display borrowers.lastseen on patronbriefinfo
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
2025-11-26 10:40:33 -07:00
Jonathan Druart 149db8979f
Bug 41088: (bug 38201 follow-up) Fix I18N for relationships
"Add new x", "Remove this x" and "There are no x created yet" were not
translatable correctly.

Test plan:
Add a new agreement, then a new title, and confirm that the 3 strings
are correctly displayed.
Then try to update .po files, translate the strings, and install the
translations and confirm that the strings are correctly translated when
using a translated interface.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-26 10:40:32 -07:00
Tomás Cohen Arazi cee02bbf3b
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>
2025-11-26 10:40:25 -07:00
Jonathan Druart 1085f9a18b
Bug 40942: Hide the 'Contacts' block if nothing to display
If there is no contact we should hide the "Contacts" block on the "show"
view.

Fixes VueFramework_spec.ts
AssertionError: Timed out retrying after 10000ms: Expected to find content: 'Contracts' within the element: <fieldset.rows> but never did.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-25 10:13:27 -07:00
Lucas Gass 2721b0516d
Bug 41177: Adjust Cypress tests
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-25 10:13:27 -07:00
Lucas Gass bd6f876706
Bug 38426: Adjust yarn.lock after node upgrade (18 to 20)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-25 10:13:20 -07:00
Lucas Gass 5bc2ca6557
Bug 39532: DBRev 25.06.00.036
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 13:05:59 -07:00
Jonathan Druart 438e51351d
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>
2025-11-21 08:41:52 -07:00
Lucas Gass d51dc1fc69
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>
2025-11-21 08:41:51 -07:00
Martin Renvoize d90333e911
Bug 39532: Use new FINES restriction type to avoid conflict with SUSPENSION
This patch introduces a new unique restriction type 'FINES' specifically
for the debar_patrons_with_fines.pl script to prevent duplicate
restrictions on repeated runs.

The original fix used 'SUSPENSION' but this conflicted with the
fine-in-days feature which uses SUSPENSION for time-limited restrictions
when overdue items are returned. Running the script would overwrite
those time-limited restrictions with indefinite ones.

Changes:
- Add new 'FINES' system restriction type to patron_restriction_types.yml
  for new installations
- Create database update to add 'FINES' type to existing installations
- Update debar_patrons_with_fines.pl to use 'FINES' instead of 'SUSPENSION'
- Update AddUniqueDebarment and DelUniqueDebarment POD documentation

This keeps SUSPENSION exclusively for the fine-in-days feature while
preventing duplicate restrictions from the fines script.

Test plan:
1. Run database update
2. Verify new FINES restriction type exists in restriction_types table
3. Run debar_patrons_with_fines.pl multiple times
4. Confirm only one FINES restriction per patron (no duplicates)
5. Verify SUSPENSION restrictions from fine-in-days are not affected
6. Run tests: prove t/db_dependent/Patron/Borrower_Debarments.t

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:51 -07:00
Kyle M Hall fdb7c9b405
Bug 39532: Script debar_patrons_with_fines.pl creates repeat restrictions, uses wrong restriction type
The cronjob debar_patrons_with_fines.pl is meant to add a restriction based on a fines threshold.

The problem is that the script adds a MANUAL restriction, which makes no sense. MANUAL restrictions are meant to be manually created, never automatic as this script does.
In addition, they are repeatable, not unique. Every time this script runs, it will add an additional restriction.

There is already a restriction type meant for this type of use case: SUSPENSION
We should change this script to create SUSPENSION restrictions instead of MANUAL restrictions.

In summary, this script should use the unique restriction type SUSPENSION to prevent multiple additional restrictions from being created on each run.

Test Plan:
1) Set up a patron with fines
2) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message"
3) Note the restriction is created
4) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message" again
5) Note another restriction is created
6) Delete the restrictions
7) Apply this patch
8) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message"
9) Note the restriction is created
10) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message" again
11) Note another restriction is *not* created!

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:50 -07:00
Pedro Amorim e4db78bf21
Bug 41271: Revert follow-up from bug 37893
This was a bad workaround.
It was ugly and is no longer relevant now that pod_coverage.t no longer attempts to launch a SIP server.

prove xt/author/pod_coverage.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:50 -07:00
Pedro Amorim a2917e2172
Bug 41271: Fix pod_coverage for SIPServer.pm
Because the file is now being properly checked for pod_coverage, it fails (because a lot of methods dont have pod coverage. Add here

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:49 -07:00
Pedro Amorim c01b5d68ea
Bug 41271: Dont run Net::Server::PreFork->run on 'require' or 'use'
By using 'unless caller' we ensure the class is not executed when Pod::Coverage->new does 'require C4/SIP/SIPServer.pm

Ensure no regressions are added:
prove t/db_dependent/SIP/*

koha-sip --restart kohadev
koha-sip --status kohadev

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:49 -07:00
Jonathan Druart a8526d4419
Bug 41274: Remove exceptions from files listed in the result repo
IF we have pushed some files that should have been excluded from the
tests but have been processed previously and failed, we should skip it
the next build anyway

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:48 -07:00
Jonathan Druart a0f768f784
Bug 41274: Remove the exceptions from git range
When listing the files from a git range we want to remove the exception
files from that list

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:48 -07:00
Jonathan Druart 5253306187
Bug 41274: Remove range parameter from ls_perl_files
It's not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-21 08:41:40 -07:00
Marcel de Rooy 291c2f103d
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>
2025-11-19 12:28:18 -07:00
Marcel de Rooy f4ff248b5c
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>
2025-11-19 12:28:18 -07:00
Lucas Gass 343786b406
Bug 41211: Deal with findborrower in holds_table_patron_page function
To test:

1. Find a patron, take note of their cardnumber, and place some holds for that patron. I use Ronnie Ballard ( 23529000139858 ) in k-t-d.
2. Scan the patrons cardnumber to bring you directly to their record. The URL for me is KOHA/cgi-bin/koha/circ/circulation.pl?findborrower=23529000139858
3. Go to the patron's "Hold" tab, check at least 1 hold and click "Cancel selected".
4. Nothing happens. Console error: Uncaught ReferenceError: biblionumbers is not defined
5. Try using the red trash can icon to delete the hold. A modal pops up, click "Confirm cancellation".
6. You are redirected to KOHA/cgi-bin/koha/circ/circulation.pl?borrowernumber=
7. IF you go back to the patron record the hold is not cancelled.
8. APPLY PATCH and clear the browser cache.
9. Try again, eveything should work!

Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-19 12:28:17 -07:00
Lucas Gass 644e4af1f6
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>
2025-11-19 12:28:17 -07:00
Lucas Gass 29f9518785
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>
2025-11-19 12:28:16 -07:00
Marcel de Rooy ea00bef828
Bug 41168: Remove part "by keyword" from OPAC search bar placeholder
Side note: The if test on ms_kw in OPAC masthead seems not to be used,
but considering that out of scope here.

Test plan:
Check the shorter text on OPAC search bar.
Toggle SearchMyLibraryFirst and OpacAddMastheadLibraryPulldown. Refresh.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-19 12:28:16 -07:00
Caroline Cyr La Rose 4bb7a1371c
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>
2025-11-19 12:28:15 -07:00
Jan Kissig ac7861bbe2
Bug 40836: (QA follow-up) Reduce params
Reduce params given to process method.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-19 12:28:15 -07:00