Commit Graph

59655 Commits

Author SHA1 Message Date
Nick Clemens 7185201e93
Bug 41205: Skip undef records in Z39 response
This patch simply skips undefined records - this prevents the error
though it doesn't explain why we get undef records here and a Z39 search
from standard cataloging just returns nothing.

This prevents a breakage of the search.

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-17 15:15:48 -07:00
Jake Deery f40387ed12
Bug 41201: Removed definite article from hold and cart
This patch removes the definite article from some labels, so that their
visual and hidden labels are in sync.

== TO TEST ==
a)  (optionally) read the patch code to understand what locations have change
b)  inspect the code on the results and details pages
c)  note that some visual and hidden labels differ
    *)  specifically, the add to cart and place hold labels
== APPLY PATCH ==
d)  repeat step b)
e)  notice now that the visual and hidden labels match
== SIGN OFF ==

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-11-17 15:15:47 -07:00
Matt Blenkinsop a9c1583675
Bug 38446: Add a unit test for the additional fields wrapper
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-17 15:15:47 -07:00
Jonathan Druart e0ca94ae18
Bug 38446: Add a dedicated route to retrieve ERM-related additional fields
In order to prevent permission errors to user without the 'parameters'
permission we are introducing a separate endpoint for the ERM module to
retrieve additional fields for this specific module.

* Adds a new endpoint /erm/extended_attribute_types
* Adjusts Cypress and REST API tests
* Adds REST API swagger specs

I wanted to keep the code as simple as possible and decided to create a
wrapper for the additional fields API client. The magic is in
koha-tmpl/intranet-tmpl/prog/js/fetch/additional-fields-api-client.js
Ideally we should provide a test for this but I failed to write them.
If required by QA I would suggest to deal with them on a separate bug to
not delay this bugfix. The code has been kept designed to be used in
other contexts but the api client is not used outside of Vue and
outside of the ERM module.

Test plan:
Confirm that user without the 'parameters' permission can use the ERM
module with additional fields.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-17 15:15:38 -07:00
Pedro Amorim 74d5af9b39
Bug 41001: (QA follow-up): Add 'Confirmation messages with inputs' specific tests
cypress run --spec t/cypress/integration/ERM/Dialog_spec.ts

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:22 -07:00
Pedro Amorim 9d6ad3bbc5
Bug 41001: Add cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:21 -07:00
Pedro Amorim f403a49d4e
Bug 41001: Remove messages when dialog closes, even if not through the close button
This ensures that when the dialog is closed, even when clicked outside of it, the messages are correctly removed, same as if the 'close' button had been clicked.

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:21 -07:00
Michael Hafen 07e379e741
Bug 40288: Apply overflow css to all of patronbriefinfo li's
and patroninfo-section li's too.

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-11-07 10:54:20 -07:00
Michael Hafen c403c1fc20
Bug 40288: constrain patron brief info in patron sidebar to parent width
The patron info in the patron / circ-menu sidebar is not constrained to
it's parent's width.  I found this with a very long email address, where
the ul grew to match the email address length, and the patron image
container also grew.  Both overflowed the sidebar.

Test plan:
1. find or make a patron with a very long email address (more tha 50
   characters).
2. open the patron details page for that patron.  Observe the patron
   image and patron details overflows the patron sidebar (the email
   address will be hidden under the contact information panel.
3. Apply patch and rebuild css files.  It may be necessary to clear the
   browser cache.
4. open the patron details page for that patron again.  Observe the
   patron image and details does not overflow the patron sidebar.

Signed-off-by: George <george@nekls.org>
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-11-07 10:54:20 -07:00
Owen Leonard 5f8cc2de5d
Bug 40086: Table settings for Article Requests tables
This patch adds table settings for the three tables on the article
requests page in the staff interface: New, Pending, and Processing. The
patch also disables sorting on the checkbox column and adds "anti-the"
sorting to the title column.

To test, apply the patch and restart services.

- If necessary, enable article requests in at least one rule in
  Circulation and Fine Rules.
- If there are no article requests in your system, log in to the OPAC as
  a user who can place article requests and submit multiple requests for
  various titles.
- Go to Circulation -> Article requests
- If there are no requests under the "Pending" and "Processing" tables,
  use the "Actions" menu to set some as pending and some as processing.
- Test the "Columns" menu for each table, confirming that the correct
  columns are shown or hidden according to your selections.
- Test sorting of the "Title" column to confirm that articles are
  ignored in sorting.
- Go to Administration -> Table settings -> Circulation -> Article
  requests and try making various changes to the default configuration.
- Return to the Article requests page to confirm that your selections
  are reflected there*
  * You may need to delete the table settings in local storage in order
    for the default table settings to be shown. In Firefox DevTools look
    under the "Storage" tab -> Local storage -> Delete all.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:19 -07:00
Tomás Cohen Arazi e23f51a017
Bug 32581: (follow-up) Tidy files
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:19 -07:00
Sam Lau 8e165a80c1
Bug 32581: Add confirmation modal
This patch makes changing the expiration date optional, by providing a modal when switching a patron category. Confirming the modal will change the expiration date to the default and cancelling will keep the same expiration date.

To test:
1) Same plan as before except now there is a modal when changing the patron category.
- Attempt confirming the modal: expiration date should change to default.
- Attempt canceling the modal: expiration date should stay the same

Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:18 -07:00
Sam Lau 12f8488b13
Bug 32581: Automatically update patron expiration date when changing their category
To test:
1) In Administration-> Patron categories, set the enrollment period for the 'School' category to 12 months.
2) Find a patron that is from another category, edit their info and change their category from patron to school.
3) Note that the expiry date automatically changes to 12 months from today.
4) Save your changes and ensure on the patron's detail page that their expiration date was successfully changed.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:18 -07:00
Kyle M Hall c5cb44a8e4
Bug 40890: Move fetching of batch size to within the instance loop
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:17 -07:00
Tomás Cohen Arazi 03aec74eb6
Bug 40890: Make batch_size configurable for koha-es-indexer
This patch adds a new configuration entry in `koha-conf.xml` for making
it possible to set a different `batch_size` for `koha-es-indexer`.

The current implementation has a default of *10* that can be overridden
using the CLI parameter `--batch_size N`.

Unfortunately, if you restart the server or the service without passing
the parameter, it will be set back to 10. This patch solves that by
adding a new config entry and making the script use it. The passed CLI
parameter will keep overridding the configured value.

To test:
1. Run:
   $ ktd --shell
  k$ koha-es-indexer --restart --batch_size 100 kohadev
  k$ ps -ef | grep elastic
=> SUCCESS: No errors. Notice '100' is passed to the called perl script
2. Run:
  k$ koha-es-indexer --restart kohadev
  k$ ps -ef | grep elastic
=> FAIL: Notice '10' is the new value
3. Apply this patch
4. Run:
  k$ reset_all
5. Repeat 1 and 2
=> SUCCESS: '100' is kept.
6. Try standalone `--start` too
7. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:17 -07:00
sashaanastasi 33f4935bce
Bug 39280: Remove misleading message text for ODUE notice
This patch removes unnecessary and misleading wording from the overdue note as it depends on the library's circulation rules: "If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned."

Test plan:
1. Check the wording of the ODUE notice under Tools > Patrons and circulation > Notices and slips.
2. Note that it includes this wording, which may be unnecessary or misleading depending on the library's settings: "If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned."
3. Apply the patch.
4. Check that the updated ODUE notice has removed the wording by either:
   4.1 Resetting everything: reset_all
   4.2 Viewing the default notice - click "View default" when viewing the email notice
5. Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:16 -07:00
Pedro Amorim ed56082a4c
Bug 40613: (QA follow-up): Add hold_group_id param
This now passes:
prove xt/api.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:16 -07:00
Pedro Amorim de53593b49
Bug 40613: Add 'ungroup holds' button
Test plan, k-t-d, patches applied:
1) Search for 'test':
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test
2) Click the 'Select all' link on the left of the search toolbar
3) Click the 'Place hold' button on the same toolbar
4) On the patron input, add 'koha'
5) You need to pick the 'Pickup location' specifically for each hold. Click 'Place holds'
6) Now visit the patron details page:
http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
7) Click the 'Holds' tab.
8) Click the top most checkbox to select all holds. Click the 'group selected' button. Notice the holds are grouped and the 'group hold' column shows the hold group number accordingly.
9) Test that selecting the hold group number opens the hold group modal and a new 'ungroup holds' button exist.
10) Click that button, ensure it deletes the holde group. Test with more holds, more groups, etc.

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:15 -07:00
Pedro Amorim 8648c3982c
Bug 40613: Add DELETE hold groups REST API endpoint
prove t/db_dependent/api/v1/patrons_hold_groups.t

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:15 -07:00
Janusz Kaczmarek 4fedfc5adb
Bug 29733: MARC21: Link 7xx linking fields to marc21_linking_section.pl value builder
When creating an analytical record from scratch and filling the 773
field with marc21_linking_section.pl plugin, the information put
in field 773 is very basic, incomplete, sometimes buggy ($9, $0).

Test plan
=========
1. Configure a MARC bibliographic framework: enable essential
   subfields in 773: 7, a, t, b, d, g, k, x, z, w (check the Editor
   checkbox), put them in this order, and chose plugin
   marc21_linking_section.pl for 773 $t.
2. Start creating a new record and go to 773 $t. Activate the plugin
   to find the a record to become the host record (perform a search
   for 'Linux kernel development'). Note the content of the 773
   field.
3. Apply the patch, restart plack etc.
4. Repeat p. 2.-3. See that the generated 773 field contains now much
   more information, including 773 $7.

Additionally, commented code has been removed and check/variable
initialization added to get rid of warnings in log.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:14 -07:00
Janusz Kaczmarek 38b0e7ce61
Bug 33296: Unit tests
Unit tests for Bug 33296.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:14 -07:00
Janusz Kaczmarek 082de62252
Bug 33296: Linker should search for authority records with an appropriate 008/14,15,16 value
In an authority record, 008/14 = 'a' says it's appropriate for use as a
main or added entry (1xx, 7xx), 008/15 = 'a' says it's appropriate for
use as a subject entry, and 008/16 = 'a' says it's appropriate for use
as a series entry.

Test plan:
==========
1. Have a standard KTD environment. Have the patches from Bug 38494
   applied.
2. Set AutoLinkBiblios system preference to 'Do', and
   ConsiderHeadingUse to 'Do'.
3. Open an existing bibliographic record and add a new field 650. In
   subfield $a enter 'Application software' (without quotes), and in $x
   'Development.' (with final dot).
4. Save the record. In Normal view control that the entered subject
   heading entry has been linked with the existing authority record (note
   the magnifying glass icon).
5. Apply the patch ; restart all.
6. Repeat p. 3. Note that this time the newly entered subject heading
   entry has not been linked with the existing authority record. This is
   because the authority record has 008/15 = '|' while 'a' is required with
   ConsiderHeadingUse.
7. In Authorities, find the record for 'Application
   software--Development.' Modify it by changing 008/15 to 'a' (Heading
   use--subject added entry).
8. Return to the bibliographic record. Open it in the editor and save.
   The subject heading entry for 'Application software--Development.'
   should now be linked with the existing authority record.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:13 -07:00
Fridolin Somers 27230e64ad
Bug 29908: Remove warning when empty ClaimReturnedWarningThreshold in patron_messages.inc
System preference ClaimReturnedWarningThreshold manages the display of a patron message in case of too many claims.
But this preference may be empty. It is created empty in installer/data/mysql/mandatory/sysprefs.sql.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:13 -07:00
Jonathan Druart 1ba4ff89a7
Bug 40964: Add long version of options to man
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:12 -07:00
Thomas Klausner 41266e4e71
Bug 40964: add --where to koha-elasticsearch wrapper scripts and document it
Test Plan:

* Start and enter ktd
* run koha-elasticsearch with --where, which has no effect:
  debian/scripts/koha-elasticsearch --rebuild -b -v --where 'biblionumber > 427'  kohadev
* But you will see some warnings like:
  Unknown instance --where
  Unknown instance biblionumber > 427
* Final output is: Total 435 records indexed

Apply the patch

* run the same command again:
  debian/scripts/koha-elasticsearch --rebuild -b -v --where 'biblionumber > 427'  kohadev
* output should be
 Checking state of biblios index
 Indexing biblios
 Committing final records...
 Total 11 records indexed

* Run `debian/scripts/koha-elasticsearch --help`
* "-w|--where" should show up in the docs

Sponsored-by: HKS3
Sponsored-by: Koha DACH Hackfest
Signed-off-by: Anke Bruns <anke.bruns@gwdg.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:12 -07:00
Lucas Gass dbf341bfcb
Bug 40245: DBRev 25.06.00.034
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:11 -07:00
CJ Lynce cf9c631c6b
Bug 40245: Update cypress test to handle ShowPatronFirstnameIfDifferentThanPreferredname
Updates patron format cypress tests to allow for ShowPatronFirstnameIfDifferentThanPreferredname

Test Plan:
-Install Patch
-On command line, in koha root directory, run `cypress run --spec t/cypress/integration/Patron/Format.ts`
-Check to make all tests pass

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:11 -07:00
CJ Lynce 3bb0936785
Bug 40245: Show firstname in patron search results when different than preferred_name
This patch shows the patron's firstname in patron search results and autosuggestions
	when the patrons preferred_name is different than their first name. Requires that
	the ShowPatronFirstnameIfDifferentThanPreferredname system preference is enabled.

Test plan:
0. Apply patches and login to the staff interface.
1. Edit a patron to give a different preferred name than firstname.
2. Return to home page and search for the patron in the quick-search bar.
3. Verify patron shows up in autosuggest list, showing preferred name only.
4. Verify patron shows up in regular list (member.pl) with preferred name showing only.
5. Change syspref ShowFirstIfDifferentThanPreferred to "Show" and save.
6. Return to home page and search for the patron in the quick-search bar.
7. Verify patron shows up in autosuggest list, showing preferred name, and firstname in brackets.
8. Verify patron shows up in regular list (member.pl) with preferred name, and firstname in brackets.

Sponsored-by: Westlake Porter Public Library <https://westlakelibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:10 -07:00
CJ Lynce 1d6eb51d20
Bug 40245: Add new system preference ShowPatronFirstnameIfDifferentThanPreferredname
Adds a new system preference ShowPatronFirstnameIfDifferentThanPreferredname
	to allow a patron's firstname to be shown in search results when
	different than their preferred name.

Sponsored-by: Westlake Porter Public Library <https://westlakelibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:10 -07:00
Baptiste Wojtkowski b0656241de
Bug 41119: Add missing function to acqui-home.tt
TEST PLAN:
DO NOT APPLY PATCH BEFORE TESTING
1 - Go to histsearch.pl, type "ko" in "Basket created by" -> autocompletion starts
2 - Go to acqui-home.pl, type "ko" in "Basket created by" -> autocompletion is ko
3 - Apply patch
4 - Go to histsearch.pl, type "ko" in "Basket created by" -> autocompletion starts
5 - Go to acqui-home.pl, type "ko" in "Basket created by" -> autocompletion starts

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

Amended-by: Jonathan Druart
Tidy
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:09 -07:00
Jonathan Druart 19c7179a13
Bug 41153: Clean up catalogue/MARCdetail.pl
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:09 -07:00
Paul Derscheid 68451ad918
Bug 35451: (QA follow-up) Add newlines to updated DBIC files as per Bug 40541
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:08 -07:00
Lucas Gass 99f5f3d145
Bug 35451: DBIC
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:08 -07:00
Lucas Gass c26e26a697
Bug 35451: DBRev 25.06.00.033
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:07 -07:00
Martin Renvoize 316304431a
Bug 35451: (follow-up) Save join in C4::Serials::DelSubscription
We can use the new record_table field to save ourselves a join in here
too.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:07 -07:00
Martin Renvoize 0c7e44022e
Bug 35451: (follow-up) Fix C4::Acquisition::TransferOrder
This patch adds table name to the additional fields clone found insdie
TransferOrder.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:54:06 -07:00
Martin Renvoize 65b3aee93f
Bug 35451: Fix test data
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>
2025-11-07 10:54:06 -07:00
Martin Renvoize 63d3b4d4de
Bug 35451: Update relations
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>
2025-11-07 10:54:05 -07:00
Martin Renvoize 48840e9d95
Bug 35451: Record table in set_additional_fields
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>
2025-11-07 10:54:05 -07:00
Martin Renvoize ddd8e697b4
Bug 35451: Add record_table to additional_field_values
This patch updates the database to include a record_table field in the
additional_field_values table and adds an index on that field.

This should facilitate more performant joins.

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>
2025-11-07 10:53:56 -07:00
Martin Renvoize 882247a474
Bug 20253: (follow-up) Re-add missing is_boolean flag
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 07:43:59 -07:00
Jonathan Druart ce474740a2
Bug 39860: Fix selenium/opac_holds.t
#   Failed test 'Correctly in search results page'
        #   at t/db_dependent/selenium/opac_holds.t line 88.
        #                   'Error: Can't use an undefined value as a HASH reference at /kohadevbox/koha/C4/XSLT.pm line 247'
        #     doesn't match '(?^u:Results of search for 'opac holds test place hold button')'

might be a conflict with bug 40943

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 07:43:59 -07:00
Jonathan Druart 2a3c21f0d5
Bug 40943: Fix t/Koha/Script.t
Failed with:
   Failed test 'Context userenv set correctly with no flags'
   at t/Koha/Script.t line 31.
     Structures begin differing at:
          $got->{session_id} = undef
     $expected->{session_id} = Does not exist

session_id is now part of userenv

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 07:43:52 -07:00
David Cook b385f7b4ec
Bug 18148: Add unit tests
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-11-05 07:12:35 -07:00
David Cook 5908412f34
Bug 18148: Make list of lists in OPAC sortable
This patch adds sorting to lists of lists in the OPAC.

The mechanism used here for op=list is similar to the one
used in op=view, so it's stylistically and functionally
consistent with the rest of the Lists module in the OPAC.

Test plan:
0. Apply the patch and restart Plack (ie koha-plack --restart kohadev)
1. Create 20+ public lists and 20+ private lists for a particular user
you control (try to use names that range throughout the alphabet)
2. Using SQL, update the Modification date for at least 1 public
list and 1 private list
3. As an anonymous (ie not logged in user), go to
/cgi-bin/koha/opac-shelves.pl?op=list&public=0
4. Note you cannot see any lists
5. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=list&public=1
6, Note you can see public lists with a toolbar with the button "Sort"
below the alert "Log in to create a new list"
7. Using the "Sort" option, try out all the different sort options
for default, "List name", and "Modification date"
8. After sorting, try paging through the list of lists. You should
note that the sorting is retained through the paging.
9. prove t/db_dependent/Virtualshelves.t
10. Celebrate!

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-11-05 07:12:35 -07:00
David Cook 4bb7582066
Bug 41128: Only use data rating if it's available
This patch prevents span elements being filled with "undefined"
which are then shown to screen readers and print output.

Test plan:
0. Apply the patch
1. Enable the following system preference: OpacStarRatings (results,
   details, and patron).
2. Check out an item to a user you can log in as (e.g. koha user)
3. Go to /cgi-bin/koha/opac-user.pl in the OPAC
4. Click "Print" on the toolbar above the summary table
5. Note that 5 occurrences of "undefined" do not appear next to the
   title in the print output

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:34 -07:00
Tomas Cohen Arazi fbbf00c904
Bug 37711: DBIC schema
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:34 -07:00
Lucas Gass b60b190358
Bug 37711: DBRev 25.06.00.032
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:33 -07:00
Tomás Cohen Arazi 35fd016f88
Bug 37711: (follow-up) Fix AuthClient plugin database upgrade handling
The AuthClient template plugin was causing 500 errors during database
upgrades when the identity_providers schema was out of sync. The plugin
tried to query the new 'auto_register_opac' column before the database
schema was updated, creating a chicken-egg problem.

This patch wraps the database query in Try::Tiny to handle schema
mismatches gracefully during upgrades, allowing the upgrade process
to continue without crashing the authentication interface.

Test plan:
1. On main, apply all bug 37711 patches BUT THIS ONE
2. Simulate an upgrade by:

* Edit Koha.pm so it points to the next version
* Move the atomicupdate file to the right number in db_revs

3. Restart everything:
   $ ktd --shell
  k$ restart_all
4. Access http://kohadev-intra.localhost
=> FAIL: You get a 500! With a stack trace!
5. Apply this patch
6. Repeat 3 and 4
=> SUCCESS: No 500 error, redirects to installer
7. Proceed with the upgrade:
=> SUCCESS: It works as it should
8. Run tests:
  k$ prove -v t/db_dependent/Template/Plugin/AuthClient.t
=> SUCCESS: All tests pass
9. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:33 -07:00
Tomas Cohen Arazi 6290b9ac7b
Bug 37711: Domains CRUD update
This patch adapts the `Identity provider domains` CRUD page to handle
the new configuration options.

To test:
1. Have an IdP with some domains set. Make sure there's at least one
   domain with auto-register enabled and one with it disabled.
2. Apply this patches
3. Run:
   $ ktd --shell
  k$ updatedatabase
=> SUCCESS: Updates successfully
4. Run:
  k$ yarn build
5. Refresh the IdP domains page
=> SUCCESS: The domains table shows both OPAC and staff auto-register
   options.
=> SUCCESS: The staff auto-register is disabled for both domains
=> SUCCESS: The OPAC auto-register matches what was set for each domain
regarding auto-register (remember that before this patchset,
auto-register only works for the OPAC).
6. Play with editing/adding/removing domain configurations
=> SUCCESS: Things work as expected, values are persisted on the DB
correctly.
7. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:32 -07:00