Commit Graph

59938 Commits

Author SHA1 Message Date
Eric Garcia 23eb2dbd39
Bug 35211: Fixed group tab item building logic
Changed to show logged in branch in group tabs

Test Plan:
1. Apply patch, restart_all, updatedatabase
2. Koha Administration -> System preferences -> SeparateHoldingsByGroup
3. Change to "Separate holdings by library group in subsequent tabs..." and Save
4. Koha Administration -> Library Groups
5. Create multiple library groups and check the 'Use for staff search groups' box.
6. Add your logged in library to each group and other libraries to each group.
7. Do catalog searches where the location of the item is a library in a library group
8. Notice tabs in the Holdings table for each library group if it contains a library that has the item

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:55 -07:00
Eric Garcia f438535b5c
Bug 35211: Fix tab building
Fixed naming when building tabs

Test Plan:
1. Apply patch, restart_all, updatedatabase
2. Koha Administration -> System preferences -> SeparateHoldingsByGroup
3. Change to "Separate holdings by library group in subsequent tabs..." and Save
4. Koha Administration -> Library Groups
5. Create multiple library groups and check the 'Use for staff search groups' box.
6. Add your logged in library to each group and other libraries to each group.
7. Do catalog searches where the location of the item is a library in a library group
8. Notice tabs in the Holdings table for each library group if it contains a library that has the item

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:55 -07:00
Eric Garcia d2a0527d86
Bug 35211: Set SeparateHoldingsByGroup to separate based on SeparateHoldingsBranch syspref
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:54 -07:00
Eric Garcia 96c7eb3459
Bug 35211: Fixed count on logged in holdings
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:54 -07:00
Eric Garcia 124c6c8670
Bug 35211: Removed local items from group tabs and removed group items from other holdings tab
Fixed the issues with tabs.

I cannot replicate the issue in the attached screenshot. What steps did you take?

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:53 -07:00
Eric Garcia 5c2b0fd496
Bug 35211: Reordered tabs in Holdings Table and fixed group tabnames
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:53 -07:00
Eric Garcia 08045c8009
Bug 35211: Separate group holdings into individual tabs
Added SeparateHoldingsByGroup system preference
Adds new tabs to Holdings table if preference is enabled
Separates by library groups

Test Plan:
1. Apply patch, restart_all, updatedatabase
2. Koha Administration -> System preferences -> SeparateHoldingsByGroup
3. Change to "Separate holdings by library group in subsequent tabs..." and Save
4. Koha Administration -> Library Groups
5. Create multiple library groups and check the 'Use for staff search groups' box.
6. Add your logged in library to each group and other libraries to each group.
7. Do catalog searches where the location of the item is a library in a library group
8. Notice tabs in the Holdings table for each library group if it contains a library that has the item

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:52 -07:00
Lucas Gass 39ca6bab0c
Bug 41332: DBRev 25.12.00.004
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:52 -07:00
Andreas Roussos 231a70ee45
Bug 41332: Add Greek to KohaManualLanguage system preference
The Koha Manual has been translated into Greek:
https://koha-community.org/manual/latest/el/html/index.html

However, 'Greek' is missing from the list of languages
available in the 'KohaManualLanguage' System Preference.

This patch fixes that.

Test plan:

1) Without the patch, visit Administration > System preferences >
   Enhanced content, and under the 'Manual' section notice that
   'Greek' is missing from the options of the 'KohaManualLanguage'
   syspref dropdown.
2) Apply the patch, and run updatedatabase.pl
   The 'KohaManualLanguage' dropdown should now list 'Greek'.

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>
2026-01-09 08:18:51 -07:00
Lucas Gass 19209df1c0
Bug 39142: DBRev 25.12.00.003
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:51 -07:00
Lucas Gass 34a1463e90
Bug 39142: (RM follow-up) Add missing comma to userflags.sql
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:50 -07:00
Martin Renvoize 5d4c8d1dba
Bug 39142: Improve debug controls UI integration
Moves debug controls from fixed bottom position (which overlapped navbar)
to an integrated navbar dropdown with bug icon. Improves UX with:
- Proper navbar integration at far right after user menu
- Dynamic button text (Enable/Disable) reflecting current state
- Icon color change (amber) when any toggles are active
- Prevents duplicate URL parameters on multiple clicks

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:50 -07:00
Imani Thomas cc05dc9221
Bug 39142: fixing capitalization as per coding guidelines https://wiki.koha-community.org/wiki/Coding_Guidelines#HTML4:_Upper_and_lower_cases_in_strings
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:49 -07:00
Martin Renvoize 6744b12d3a
Bug 39142: (QA follow-up) Add permission checking for syspref overrides
This follow-up adds proper security controls for the DISABLE_SYSPREF_*
URL parameter functionality introduced in Bug 14004. Previously, any
user could bypass system preferences by using URL parameters without
authorization.

Changes:
- Restricts DISABLE_SYSPREF_* parameter processing to users with debug permission
- Uses existing haspermission() method for consistent authorization checking
- Maintains superlibrarian access as expected
- Closes potential security loophole where unauthorized users could disable
  system preferences like IntranetUserJS and IntranetUserCSS

The debug UI buttons will only appear for authorized users, and now the
underlying syspref override functionality requires the same permission,
ensuring both UI and functional security are aligned.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:49 -07:00
Martin Renvoize d1d1f05415
Bug 39142: (QA follow-up) Add unit tests for DISABLE_SYSPREF permission checking
This commit adds a unit test for the syspref override permission checking
functionality to ensure:

- Users without debug permission cannot override system preferences via URL parameters
- Users with debug permission can successfully override system preferences
- Superlibrarians maintain their ability to override system preferences
- The permission checking logic works correctly with haspermission()

The test creates three test patrons:
1. Regular patron with only catalogue permission (should be denied)
2. Patron with debug permission (should be allowed)
3. Superlibrarian (should be allowed)

Tests verify both the permission checking and the actual environment variable
setting that controls syspref overrides.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:48 -07:00
Imani Thomas 315f9a95af
Bug 39142: Add debug permission to allow user to toggle JS and CSS customizations on/off
To test:
1. Apply the patch
2. Use updatedatabase run to update your db
3. Add custom JS and CSS in the IntranetUserJS and IntranetUserCSS fields
4. With a superLibrarian account confirm you have 3 buttons at the bottom of
   your screen, Disable User JS, Disable User CSS, and load only default
   stylesheets
5. Clicking the buttons should reload the current page with a query to
   disable those things.
6. Log in as a user that is not a superlibrarian and does not have the
   debug UI permission enabled
7. Confirm the buttons are no longer visible
8. Add the debug UI permission to the user
9. Confirm the debug buttons are now visible for that user.

Signed-off-by: Lari Strand <lari.strand@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:48 -07:00
Imani Thomas 9eef928712
Bug 39142: Add debug permission
This patch adds the database foundation for the debug permission feature:
- Creates bit 31 in userflags table for 'debug' permission
- Updates mandatory userflags.sql for fresh installations
- Provides atomic update script for existing installations

The debug permission will allow authorized users to access debugging
tools for toggling JavaScript and CSS customizations.

Signed-off-by: Lari Strand <lari.strand@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 08:18:41 -07:00
Lucas Gass 94ba3d5344
Bug 39014: Remove unnecessary tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-09 06:42:45 -07:00
Lucas Gass fc1104c912
Bug 41329: Update yarn.lock
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 13:03:53 -07:00
Matt Blenkinsop f7a02a6164
Bug 41523: Improve the output from db rev 251200002
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:39 -07:00
Martin Renvoize 60d84f91e6
Bug 41520: Filter out record_table from AdditionalFieldValue API responses
Bug 35451 added a record_table field to the additional_field_values
database table for performance optimization (better joins). However,
this field was not added to the OpenAPI schema, and with
additionalProperties: false, the API validator rejects responses
containing it.

Rather than adding this internal implementation detail to the public
API schema, this patch adds a custom to_api method to
Koha::AdditionalFieldValue that filters out the record_table field.

This approach:
1. Keeps the database optimization from Bug 35451
2. Prevents internal implementation details from cluttering the API
3. Maintains context that API consumers already have from parent objects
4. Fixes OpenAPI validation errors for ERM agreements, licenses, and
   packages using extended_attributes

Test plan:
1. Create an ERM agreement with additional fields/extended attributes
2. Access the agreement via the API with extended_attributes embedded
3. Verify the response includes extended_attributes but not record_table
4. Confirm no OpenAPI validation warnings in plack-api-error.log
5. prove t/db_dependent/api/v1/erm_agreements.t
6. Verify all tests pass

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
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>
2026-01-06 07:45:38 -07:00
Martin Renvoize c77b6b1a66
Bug 41520: Add tests for extended_attributes in ERM agreements API
This patch adds api unit tests for the extended_attributes functionality in the
ERM agreements API to ensure that:

1. Extended attributes are correctly returned when embedded
2. The internal record_table field is not exposed via the API
3. Both single GET and list endpoints work correctly with extended_attributes

Test plan:
1. prove t/db_dependent/api/v1/erm_agreements.t
2. Verify all tests pass

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
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>
2026-01-06 07:45:38 -07:00
David Nind ef2f7524c0
Bug 41494: Rename "Koha administration" module name to "Administration"
This changes "Koha administration" to "Administration" on the
staff interface home page and the administration module home page.

Everywhere else in the staff interface, such as browser page titles
and breadcrumbs, administration is used.

This improves consistency, and is how it is commonly referred to.

It also change some other occurences in the code base, such
as code comments.

Test plan:
1. Note the inconsistencies in how we name and refer to the
   administration module:
   1.1 Staff interface home page: Koha administration
   1.2 Administration module home page: Koha administration, but note
       that the breadcrumb and browser page title is "Administration".
   1.3 Breadcrumbs and browser page titles for any of the administration
       areas are just "Administration".
   1.4 More > Administration.
2. Apply the patch.
3. Note that on the staff interface home page and the administration
   home page are now labelled "Administration".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:37 -07:00
Lucas Gass 6ea77ba89a
Bug 41484: Clarify strings in checkouts.js
To test:
1. APPLY PATCH, clear browser cache.
2. Turn on UseRecalls
3. Turn on EnableBookings, make the item type bookable via item type administration.
4. Check 3 things out to a paton.
5. Put one item on hold, recall one, and book one.
6. Look at the renew and checkin columns on the issues table. They should now read:

-Item on hold for another patron
-Item booked for another patron
-Item recalled by another patron

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>
2026-01-06 07:45:36 -07:00
Jonathan Druart f47ab213fd
Bug 41456: Rename more item_type => item_type_id in hold's api spec
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:36 -07:00
Tomás Cohen Arazi af4c4a33ed
Bug 41362: Allow Cypress tests to use KOHA_USER and KOHA_PASS as override
The cypress.config.ts file had hardcoded API credentials (koha:koha)
which don't work in KTD environments that use different credentials.

This patch makes the config use KOHA_USER and KOHA_PASS environment
variables if set, falling back to koha:koha if not.

Test plan:
1. On a running KTD, run the cypress tests:
   $ ktd --shell
  k$ run_cypress
=> SUCCESS: Tests are run, no errors about credentials
2. Edit your KTD .env file, so KOHA_USER=tcohen, KOHA_PASS=tomasito
3. Shut your kTD down, and start a fresh one
4. Repeat 1
=> SUCCESS: The command shows `cypress run --env KOHA_USER=tcohen,KOHA_PASS=tomasito` is run.
=> FAIL: Some tests fail right away with invalid credentials error
5. Apply this patch
6. Repeat 1
=> SUCCESS: Same command as 4
=> SUCCESS: Tests don't fail for credentials
7. Sign off :-D

Signed-off-by: Tomás 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>
2026-01-06 07:45:35 -07:00
Jonathan Druart fee1396744
Bug 41329: Add datatables.net@^1.13.1 jquery@^3.6.0
warning " > datatables.net-vue3@2.1.3" has unmet peer dependency "datatables.net@^1.13.1".
warning " > datatables.net-vue3@2.1.3" has unmet peer dependency "jquery@^3.6.0".

Test plan:
yarn build should not show those 2 warnings after this patch is applied

@RM: You will need to push yarn.lock as well

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>
2026-01-06 07:45:35 -07:00
Caroline Cyr La Rose 1decca5f54
Bug 41190: Add space in "Default checkout, hold and return policy" title
This patch adds a space in the title "Default checkout, hold and return
policy" in the circulation rules page.

To test:
1. Go to Administration > Circulation and fine rules
2. Select a library (e.g. Centerville)
3. Scroll down to the second table
   --> Note the title of the section is
   "Default checkout, hold and return policyfor Centerville" with a
   space missing between "policy" and "for"
4. Apply the patch
5. Refresh the page
   --> The title should now look normal with all the spaces!
   "Default checkout, hold and return policy for Centerville"

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>
2026-01-06 07:45:34 -07:00
Tomás Cohen Arazi 8b594db9c4
Bug 40446: Allow overriding Cypress DB settings
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>

Amended-by: Jonathan Druart
tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:34 -07:00
Owen Leonard e856754c50
Bug 38739: (follow-up) Remove extra messages.inc include
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:33 -07:00
Jonathan Druart 2f5f801ad6
Bug 38739: Fix tools/batch_modify_holds.tt
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:33 -07:00
Jonathan Druart 877e117e26
Bug 38739: Fix basket/basket.tt
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:32 -07:00
Jonathan Druart 03dd0759fe
Bug 38739: Fix some other wrong templates
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:32 -07:00
Jonathan Druart 7d8f11c3f1
Bug 38739: Fix admin/file_transports.pl
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:31 -07:00
Jonathan Druart 3a1836be81
Bug 38739: Fix mana-report-search-result.inc
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-06 07:45:23 -07:00
Lucas Gass ea9c10d4eb
Bug 41409: DBRev 25.12.00.002
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-31 07:09:34 -07:00
Aleisha Amohia b9953974fb
Bug 16131: Show branch transfer error messages in separate alert boxes
Currently error messages show in one alert box as bullet points. When
there is only one error shown, this looks a bit strange to have a list
with one item. This enhancement displays each error message as its own
alert box.

To test:

1. Check out a Centerville item to someone in Centerville. For example,
   check out 39999000004175 to yourself.
2. Go to Circulation -> Transfers. Enter the barcode 39999000004175 and
   transfer the item to Centerville.
3. Confirm two error messages are shown, with one blue box for each.

4. Go to Koha administration -> System preferences. Set
   UseBranchTransferLimits to Enforce and BranchTransferLimitsType to
   collection code.
5. Go to Koha administration -> Library transfer limits. Go to the REF
   tab and uncheck the Allow transfer? box for FFL - Fairfield, then hit
   Save
6. Go to Circulation -> Transfers. Enter the barcode 39999000004175 and
   transfer the item to Fairfield.
7. Confirm the error message shows in a blue box with no bullet point.
8. Type something random in the item barcode box and click Transfer.
9. Confirm the error message shows in a blue box with no bullet point.

Sponsored-by: Catalyst IT
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>
2025-12-30 07:49:07 -07:00
Alex Buckley d989883b82
Bug 35192: Highlight search terms in the OPAC Title notes tab
Test plan:
1. Create a biblio record with the word 'Fish' in the title (245$a) and
the summary (520$a)
2. Set 'OpacHighlightedWords' system preference to 'Highlight'
3. Submit an OPAC search with the search term of 'Fish'. Click on the biblio created in #1
4. Notice 'Fish' in the title is highlighted, as is the Summary. Scroll
down to the Holdings table. Click on 'Title notes' and notice 'Fish' is
not highlighted in the 'Title notes'
5. Apply patch and restart services
6. Refresh the biblio page. Click on the 'Title notes' tab again
7. Notice 'Fish' is highlighted in the 'Title notes' tab
8. Right click, click 'Inspect element'. Confirm there are no JavaScript
errors in the console.

Sponsored-by: Catalyst IT, New Zealand
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>
2025-12-30 07:49:07 -07:00
Matt Blenkinsop d3df2cce0f
Bug 41411: Remove the input length restriction on streetnumber
Test plan:
1) In the intranet, try to add a new patron
2) When typing into the streetnumber field, the string will be
   truncated after 10 characters
3) Try the same in the OPAC, the field will be limited
4) Repeat for the streetnumber for the alternate addresses
5) Apply patch
6) Repeat steps 1-4, the field should now accept a longer string

Sponsored-by Cheshire West and Chester Council

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>
2025-12-30 07:49:06 -07:00
Matt Blenkinsop 366ce3f08e
Bug 41409: Convert streetnumber and B_streetnumber to tinytext
Test plan:
1) Run 'updatedatabase'
2) No errors should be thrown

Sponsored-by: Cheshire West and Chester Council
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>
2025-12-30 07:49:06 -07:00
Lari Taskula d214d441a8
Bug 39014: (follow-up) Refactoring and renaming to can_be_guaranteed_by
To test:
1. prove t/db_dependent/Koha/Patron.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>
2025-12-30 07:49:05 -07:00
Emmi Takkinen 382ba17a8c
Bug 39014: Add new method validate_guarantor
Adding a new guarantee and storing it fails with "Creating a patron"
selected in  TrackLastPatronActivityTriggers when guarantors are set
to be mandatory. The problem comes from Koha::Patron->store called
in update_lastseen. Since we validate guarantor in Koha::Patron->store
but don't store them in there, new call to store fails because it
doesn't receive guarantor info as parameter.

As a solution, we should validate guarantors in separated method.
Validation can't be moved e.g. to Koha::Patron::Relationship->store
since this could lead to situations where guarantee is stored without
guarantor. This patch adds new method validate_guarantor and adjusts
old guarantor requirements tests to match this new method.

To test:
1. Select option "Creating a patron" in "TrackLastPatronActivityTriggers" syspref.
2. Enable syspref "ChildNeedsGuarantor" and make sure you have options in
"borrowerRelationship" syspref.
3. Create a guarantee patron, fill all required fields and add guarantor for patron
(either add Patron guarantor or fill Non-patron guarantor inputs).
4. Attempt to save patron.
=> Error box is displayed with text "The following fields are wrong. Please fix them.".
=> Logs show error "Patron creation failed! - [Child patron needs a guarantor]".
5. Apply this patch.
6. Create a guarantee patron again and save.
=> Patron should be saved correctly.
7. Create a new guarantee patron but this time don't add patron guarantor or fill
non-patron guarantor inputs.
8. Attempt to save patron.
=> Save should fail with error "A child patron needs a guarantor."
9. Add patron guarantor who can also be a guarantee and save.
=> Save should fail with error "A guarantor cannot be a guarantee."

Also prove t/db_dependent/Koha/Patron.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-30 07:48:56 -07:00
Jonathan Druart 66d92ba6c6
Bug 41456: Fix item type searching and filtering on the holds history table
Use should use coded_values for the library and item type column so that
we can search using the code and the description.

With this patch we now have a dropdown list with the libraries and item
types in the table's headers.

Test plan:
0. Turn on AllowHoldItemTypeSelection
1. Create a hold and select an item type
Note: I think there is a bug if you select it from "Hold next available
item", use "Hold details". Please confirm?
2. Go to the holds history view
3. Filter and search by item type description and code. Same for
   library.
   Use the dropdown list in the headers.

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-12-29 09:56:19 -07:00
Martin Renvoize 5810633b67
Bug 41404: (QA follow-up) Add tests for empty string and zero edge cases
This QA follow-up adds comprehensive test coverage for edge cases that
the original patch handles:

1. Empty string values ('') - the default value in sysprefs
   - Verifies that empty strings are treated as "not set"
   - Confirms charge calculations are skipped (performance optimization)
   - Ensures patrons are not blocked

2. Zero values (0) - valid numeric limit
   - Verifies that zero triggers charge calculation (valid number)
   - Confirms patrons are not blocked (0 means "no limit")
   - Documents intended behavior that 0 disables blocking

3. Positive numeric values - normal case
   - Confirms charges are calculated and blocking works correctly

These tests validate that looks_like_number() is the correct approach
rather than simple truthiness checking, as it properly distinguishes
between:
- Empty string '' (not a number, skip calculation)
- Zero 0 (is a number, calculate but don't block)

Test plan:
1. Apply this patch
2. Run the tests:
   prove t/db_dependent/Koha/Patron.t
3. Verify all tests pass

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-29 09:56:18 -07:00
Nick Clemens 154f807f6b
Bug 41404: Use looks_like_a_number to verify if prefs are set
This check adds a check to ensure we have number, not just defined

To test:
1 - Apply only unit tests patch
2 - Run the tests
    prove -v t/db_dependent/Koha/Patron.t
3 - Apply this patch
4 - Run the tests
5 - They pass!

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-12-29 09:56:18 -07:00
Lucas Gass e2943ae5e1
Bug 39482: (follow-up) Adjust tests
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-29 09:56:17 -07:00
Owen Leonard bfa29d0dc0
Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page
When editing a library which has an associated OpacLibraryInfo HTML
customization the "Edit HTML content" link passes the wrong id
parameter.

To test, apply the patch and restart services.

- Rebuild OPAC CSS.
- Go to Administration -> Libraries.
- Edit a library.
- If there is no OpacLibraryInfo customization associated with that
  library, add at least two OpacLibraryInfo entries and then return to
  the library edit form.
- By the "OPAC information" label you should see all of the
  OpacLibraryInfo entries you added for that library.
- If you have permission to edit HTML customizations you should see
  an edit link.
- Test each to confirm that it opens the correct entry for editing.
- Return to Administration -> Libraries and click the library name to
  view it (rather than edit).
- The correct HTML customizations should appear. If you have permission
  to edit HTML customizations you should see corresponding "Edit" links.
- Test each to confirm that it opens the correct entry for editing.

- In the OPAC, locate a bibliographic record which has one or more items
  from the library you added OpacLibraryInfo to.
- In the holdings table, click the one of the library links to trigger
  the info modal.
- Confirm that all the correct information displays.
- Go to "Libraries" link in the menu under the quick search bar.
- Click the library you modified. Confirm that the correct
  OpacLibraryInfo entries display.

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: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-29 09:56:16 -07:00
David Nind dca9a6e23c
Bug 41363: (follow-up) Add full stop at the end of the hint text
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>
2025-12-29 09:56:15 -07:00
Owen Leonard 096cc9088e
Bug 41363: Don't hide patron category limitation warning behind icon
This patch takes the warning text hidden behind an icon and puts
it into a "hint" <div> in order to make the information more accessible.

To test, apply the patch and go to Administration -> Patron categories.

- Edit a patron category to lmit it to a single library.
- Switch to that library and locate a patron in that category. Copy the
  card number.
- Switch to different library and search for the patron by card number.
- Edit the patron.
- Scroll down to the "Library management" section. Under the category
  dropdown you should see a "hint" style div with the library limitation
  warning.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-29 09:56:14 -07:00
Tomás Cohen Arazi af756eb19d
Bug 41339: Fix 'Too many checkout' typo
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
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>
2025-12-29 09:56:14 -07:00