Commit Graph

56848 Commits

Author SHA1 Message Date
Owen Leonard e0b01daef3
Bug 38968: Identity providers "More" controls broken after Bootstrap 5 upgrade
This patch corrects the data attribute on "More" buttons which were
incorrectly updated during the Bootstrap 5 upgrade. "data-bs-target" is
corrected to "data-target."

Also fixed are instances of a misspelled class, "ligth" -> "light"

To test, apply the patch and go to Administration -> Identity providers.

- Click "New identity provider."
  - In the "Advanced configuration" section, test the "More" buttons
    underneath the textareas. Clicking them should expand the hidden
    help text and hide the button.
- Perform the same test when updating an identity provider.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b138eb0e83)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:59 +00:00
Magnus Enger be7347f507
Bug 34681: (follow-up) Fix typo
Change from: [% last_retruned_by | html %]
To: [% last_returned_by | html %]

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e284f9ddb5)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:58 +00:00
Lucas Gass 9e6b1ac355
Bug 34681: Fallback to borrowernumber when there is no cardnumber
To test:
1. Have StoreLastBorrower enabled to store Last Returned By.
2. Create account and leave cardnumber empty.
3. Check out and return item with that account.
4. Go to items detail page.
5. See that Last Returned By and, if return is not anonymized, Last Borrower appears blank (you can inspect the fields and see that borrower information is there but not visible). Previous borrower will similarly be blank if it is from an account with no cardnumber.
6. APPLY PATCH
7. Try the items detail page again. You should see the link for 'Last borrower' and/or 'Previous borrower' now as the borrowernumber.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised, with the tiny followup I am providing.
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 90dce0f0f1)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:58 +00:00
Jonathan Druart 485aeff5d5
Bug 38794: say_success only if updated
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 74c000763c)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:58 +00:00
Nicolas Hunstein 6094cf1b05
Bug 38794: (follow-up) Add database update
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 40c45a3905)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:57 +00:00
Nicolas Hunstein 6c8fe86c30
Bug 38794: Update authorized value description for AggregatedFullText
Update the authorized value description for AggregatedFullText in
the ERM_PACKAGE_CONTENT_TYPE category from "Aggregated full" to
"Aggregated full text".

Test plan:
1. Go to Administration > Authorized values.
2. Check the authorized values for the ERM_PACKAGE_CONTENT_TYPE
   category.
3. Note that the description for AggregatedFullText is
   "Aggregated full".
4. Apply the patch.
5. Update the database: updatedatabase
   (Bonus: To check for new installations: reset_all)
6. Refresh the page and note that the description is
   now "Aggregated full text".

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3fb75be0fb)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2025-08-06 09:56:57 +00:00
Jonathan Druart 694870248f
Bug 38546: Set tabWidth and useTabs in prettierrc
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2025-08-06 09:56:52 +00:00
Janusz Kaczmarek 1100be5167
Bug 38895: In advanced editor, the fixed data helpers put '#' instead of space in record content
When editing a bibliographic record in advanced editor, there are
helpers for fixed data coded fields (like 008).  Like in the standard
editor, empty value (space) is represented by a hash sign.  But unlike
in the standard editor, the hash sign is not converted into a space but
remains as '#' in the saved record.  This is obviously wrong.

Test plan:
==========
1. Ensure to have EnableAdvancedCatalogingEditor set to 'enable'.
2. Create of edit a record, choosing for one of one-letter codes
   an empty value (represented by '#' in the helper).
3. Save the record, control in 'MARC preview' that you got a hash sign
   in the 008 field instead of a space.
4. Apply the patch ; restart all.
5. Open a record in advanced editor, refresh the page to reload the java
   script (Shift+Ctrl+R or another appropriate shortcut).  Edit the 008
   field again choosing for one of one-letter codes an empty value.
6. Save the record, control in 'MARC preview' that there is a space
   and not the hash sign.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Esther Melander <esther@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37a7222de0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 17:21:35 +02:00
Pedro Amorim 847e199460
Bug 39446: Show both status and status_alias
If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column is empty. Click the 'View', notice the 'status' entry is empty.
12) Apply patch. Repeat
2025-08-04 16:46:08 +02:00
Caroline Cyr La Rose 870613f604
Bug 39565: Move OPACVirtualCard system preferences to features section
This patch moves the OPACVirtualCard and OPACVirtualCardBarcode system
preferences from the Suggestions subsection of the OPAC preferences to the
Features subsection.

To test:
1. Apply patch
2. Go to Administration > System preferences > OPAC
3. Search the page (Ctrl + F) for OPACVirtualCard
   --> The two preferences (OPACVirtualCard and OPACVirtualCardBarcode)
       should be in the Features section

Signed-off-by: Aude Charillon <aude.charillon@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 68325b37e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 15:11:18 +02:00
Nick Clemens e35423d666
Bug 39303: Add audience index to SRU
This patch adds a 'koha.audience' entry to the pqf properties for searching

To test:
1 - curl -XGET "http://localhost:2100/biblios?version=1.1&operation=searchRetrieve&query=ta=a&maximumRecords=60&recordSchema=marcxml"
2 - Unsupported index
3 - Apply patch
4 - cp etc/z3950/pqf.properties /etc/koha/sites/kohadev/z3950/pqf.properties
5 - sudo koha-z3950-responder --restart kohadev (or restart_all)
6 - Test a search:
    curl -XGET "http://localhost:2100/biblios?version=1.1&operation=searchRetrieve&query=koha.audience=a&maximumRecords=60&recordSchema=marcxml"
7 - Results!

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d8f6cf398c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 15:02:17 +02:00
Owen Leonard d15364b49c
Bug 25947: (follow-up) Tidiness fix
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 18d9297bda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 14:44:05 +02:00
Baptiste Wojtkowski 2f6eb09ecc
Bug 25947: (follow-up) Improve locked account message
Test plan:

To test:
1. Change system preference 'FailedLoginAttempts' to a small number,
   like 2
2. Go to a patron's account and copy their username (while you're there,
   change the password and add some fines, too)
3. In the OPAC, try to log in with the username and a wrong password 3
   times
4. Go back to the patron's account in the staff interface
5. Note that there is a message : "Patron's account has been locked (due
   to 3 failed login attempts)". Note there is a tooltip at the right
6. Click on "Change password", you go to change password page

Note: the follow-up might be unclear to understand:
1 - it moves the button outside the IF patron.login_attempt < 0
2 - Hence it requires the </li> to be moved out so button remains on the
    lane
3 - Finally the <li> must be put before the if and changed a bit

Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 20a87564f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 14:40:04 +02:00
Fridolin Somers a3284990f8
Bug 25947: Improve locked account message
When using system preference 'FailedLoginAttempts', a patron's account
is blocked after X many failed login attempts on the OPAC.

This patch adds, like for "Patron's card has expired" message :
  * a message "Patron's account has been locked (due to X failed login
    attempts)" on the patron details and circulation pages
  * a link to change password
Links are only displayed if libarian has permission to edit patrons.

For administrative lock, only a message is displayed :
"Patron's account has been administratively locked"

To test:
1. Change system preference 'FailedLoginAttempts' to a small number,
   like 2
2. Go to a patron's account and copy their username (while you're there,
   change the password and add some fines, too)
3. In the OPAC, try to log in with the username and a wrong password 3
   times
4. Go back to the patron's account in the staff interface
5. Note that there is a message : "Patron's account has been locked (due
   to 3 failed login attempts)"
6. Click on "Change password", you go to change password page

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54bf6c815c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 14:40:03 +02:00
Tomas Cohen Arazi c7517371a8
Bug 36433: (follow-up) Include required library
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a07368e5ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:27:01 +02:00
Frédéric Demians 6cc6dabe66
Bug 36433: fix test failing on Jenkins
Transaction rollback not called.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a8b41c344)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:27:01 +02:00
Frédéric Demians 864550dbaf
Bug 36433: Plugin hook elasticsearch_to_document
Add a new hook elasticsearch_to_document in order to allow completing
the 'document' to be sent to Elasticsearch. Usage example: (1) add new
search fields, (2) normalize/sanitize existing fields, (3) use id fields
to retrieve info via web services in other repositories (say VIAF), (4)
download file referenced in a field, and index its content.

To test:

1. Apply the unit tests patch, and run it:

   prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

   => FAIL: Tests fail! The hook is not implemented so the desired

2. Apply this patch, and then repeat 1:

   => SUCCESS: It works!

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e0b829bd66)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:27:00 +02:00
Frédéric Demians 3df9218a88
Bug 36433: UT
Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 359fa68458)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:26:59 +02:00
Jake Deery 9b60397705
Bug 38313: Remove confusing string from RESTOAuth2ClientCredentials
This patch removes a once necessary and now confusing warning
from the RESTOAuth2ClientCredentials syspref.

TO TEST:
a)  Notice how the RESTOAuth2ClientCredentials syspref references
    installing Net::OAuth2::AuthorizationServer, even though this
    module is in the cpanfile and koha-perldeps and has been since
    22.11
b)  APPLY PATCH
c)  Run reset_all in k.t.d
d)  Notice how the message is now gone

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7f48902403)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 12:11:06 +02:00
Emily Lamancusa a963246d1c
Bug 38095: Include logged-in branch in custom patron message
To test:
1. Create a new notice template for a custom patron message
    i. Go to Tools > Notices and Slips
    ii. Create a new notice and choose Patrons (custom message) module
    iii. Add the following text to the email notice:
    You have a new notification from  [% branches.branchname %]
    iv. Fill in other fields and save
2. Find a patron and go to their details page
3. Send the custom notice you just created
    i. Click Add message
    ii. Under "add a message for", select the email option
    iii. Under "Patron notice", select the notice you just created
    iv. Click "Save"
4. Open the patron's notices tab and look at the notice that was sent
--> The branch name is left blank
5. Apply patch and refresh the patron page
6. Repeat steps 3-4
--> The branch code is now included in the notice

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6c7ebf28e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:56:29 +02:00
Caroline Cyr La Rose 41ebf1901b
Bug 38873: Update MARC21 default framework to Update 39 (December 2024)
This patch updates the MARC21 default bibliographic framework to include
changes brought by Update 39 to the MARC21 format.

See https://www.loc.gov/marc/bibliographic/bdapndxg.html for the list of
changes.

Changes to field 506
- Added subfield $0 Authority record control number or standard number (R)
- Added subfield $1 Real World Object URI (R)

Changes to field 508
- Added subfield $3 Materials specified (NR)

Changes to field 511
- Added subfield $3 Materials specified (NR)

Changes to field 540
- Added subfield $0 Authority record control number or standard number (R)
- Added subfield $1 Real World Object URI (R)
- Renamed subfield $f to Standardized terminology for use and reproduction rights

To test:
1. Apply patch and reset_all
2. Go to Administration > MARC bibliographic framework > Default
   framework
3. Check that the additions/modifications are correct as per the list
   above
4. Optionally, run the MARC bibliographic framework test, and make sure
   there are no errors

NOTE: This change only applies to NEW installations. For existing
installations, you must make the changes yourself in Administration >
MARC bibliographic framework. This is to avoid overwriting
customizations libraries might have made to their cataloging frameworks.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d5c533e6f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:54:15 +02:00
Tomas Cohen Arazi 363383eee7
Bug 38762: Make compare_es_to_db.pl provide links to staff interface
This patch makes the script provide links to the staff interface instead
of the OPAC. This way, the links can just be picked to access the
problematic records for fixing them.

To test:
1. Run:
   $ ktd --shell
  k$ perl misc/maintenance/compare_es_to_db.pl
=> FAIL: Generated links point to the OPAC
2. Apply this patch
3. Repeat 1
=> SUCCESS: Generated links are useful as they point to the staff
interface
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cc0aa072dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:42:46 +02:00
Lucas Gass 180e54a871
Bug 39848: Restrict record deletion to staff who have edit_catalogue permission
To test,
1. Create a user with the following permissions: edit_any_item, edit_items, items_batchdel, items_batchmod.
2. When logged in as that user, use the batch item deletion tool to delete a few items.
3. Select “Delete records if no items remain” and “Delete selected items.”
When the job has processed, notice that X item(s) deleted. X record(s) deleted.
4. APPLY PATCH
5. With the same user repeat step 2.
6. This time there should be no option to 'Delete records if no items remain'.
7. Give the same use the Edit catalog (Modify bibliographic/holdings data) (edit_catalogue) permission.
8. Make sure you can successfully delete a record using the 'Delete records if no items remain'.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f70ec68c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 11:04:14 +02:00
Owen Leonard ebf2ec8553
Bug 39680: "Clear" menu item doesn't delete search history
This patch fixes the behavior of the OPAC's "Clear" link, which was not
updated to work with CSRF protection.

To test:

- If necessary, go to Administration -> System preferences in the staff
  interface and set the EnableOpacSearchHistory preference to "Keep."
- Log in to the OPAC.
- If necessary, perform several catalog searches in order to populate
  your search history.
- Expand the user menu in the upper right-hand corner and click the
  "Clear" link next to "Search history."
  - You should be prompted to confirm.
  - After confirming your search history should be empty.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fa557624e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:55:35 +02:00
David Cook a885752801
Bug 39567: Run JS change in separate file ESM as per JS1
As per JS1 in the coding guidelines, I've moved the inline JS from
the template into a separate file.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit eeb86254da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:55:13 +02:00
Emily Lamancusa ae3fb6470d
Bug 39567: Remove form-submit includes from tt files
Now that the form-submit code has been added to the global js-includes
files for both the staff interface and OPAC, it no longer needs to be
included directly in each template file.

To test:
1. Apply patch
2. Clear browser cache
3. git grep "form-submit.js"
--> Confirm that all imports of the form-submit.js asset have been
    removed, and the only results are the comment in global.js and
    staff-global.js

4. Test OPAC > Account page > Renew a checkout to confirm the link
    submission still works as expected in the OPAC
    i. Check out an item to a patron
    ii. Set a known password for that patron
    iii. Log into that patron's account in the OPAC
    iv. Click the "Renew" link next to that checkout in the checkouts
        table on the patron's OPAC account page
    --> Confirm the item is renewed as expected

5. Test some of the following buttons to confirm the link submission
   still works as expected in the staff interface:
    - Bib record > Holds > Revert transit/waiting status on a hold
    - Acquisitions > Basket > Create EDIFACT order
    - Acquisitions > Invoices > detail for a specific invoice > Delete
    - Acquisitions > Invoices > perform actions on invoices using the
                                action drop-down
    - Acquisitions > Invoices > open/close invoices by selecting the
                                checkboxes
    - Administration > Additional fields > Delete an additional field
    - Administration > Background jobs > Cancel a background job
    - Edit an item > scroll up > Actions drop-down > Print label
    - Cataloging > Label creator > Manage label batches > Edit a batch
        > Delete batch
    - Cataloging > Label creator > Manage label batches > Delete a batch
    - Patron account > holds > delete a hold
    - Tools > Patron lists > delete a list from the Actions drop-down
    - Reports > Saved reports > Preview SQL on a report > Delete
    - Reports > Saved reports > Delete a report from the actions drop-down
    - Rotating collections > Delete a collection from the actions drop-down
    - Stock rotations > move item to the next stage
    - Stock rotations > remove item from a rota
    - Stock rotations > Add/remove "In demand"
    - More > Lists > edit a specific list > Edit drop-down > Delete

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3478e09d41)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:55:13 +02:00
Emily Lamancusa 8f4dff799d
Bug 39567: Include form-submit code from opac-bottom.inc (OPAC)
Import the form-submit.js script in the global includes file for the
OPAC, so that all pages have access to it without needing to
import it directly.

This patch also aligns the OPAC copy of form-submit.js to the staff
interface copy, as the OPAC copy is missing 3 lines to support opening
the link in a new tab (added to the staff interface copy in bug 37192).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 984cf190a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:54:09 +02:00
Jonathan Druart 6866a02948
Bug 39567: Include form-submit code from js_includes.inc (staff interface)
Import the form-submit.js script in the global includes file for the
staff interface, so that all pages have access to it without needing to
import it directly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9f44cb8a88)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:53:11 +02:00
Martin Renvoize a649160b0a
Bug 39754: Enable fixed height and overflow on EDIFACT dropdown
This patch updates the 'Create EDIFACT order' menu dropdown for cases
where multiple EANs are available for the library.

We set the dropdown to a max-height of 75% of the window height and then
we enable y scrolling and hide the x scrollbar.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4564ed5ef1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:33:38 +02:00
Jonathan Druart bc6548c5e1
Bug 34070: Display the 'jobs will be processed anyway' message from worker
->connect does not raise an exception, so we didn't reached the catch
block.

Adjusting the code but I am not really happy with it, but more changes
will derail the original bug

Now we log:
Cannot connect to broker (Access refused for user 'guest') at /kohadevbox/koha/Koha/BackgroundJob.pm line 96.
Cannot connect to the message broker, the jobs will be processed anyway at /kohadevbox/koha/misc/workers/background_jobs_worker.pl line 100.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8dfb19a45a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:33 +02:00
Jonathan Druart 12b5981e3b
Bug 34070: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6ee689c7c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:32 +02:00
Jonathan Druart e8de06a0de
Bug 34070: Deal with broker connection issues
This patch suggests to deal with connection issues at
Koha::BackgroundJob->connect level.
It incorrectly returned a Net::Stomp object when the connection failed.
With this patch, if the CONNECT does not return a CONNECTED frame then
Koha::BackgroundJob->connect returns nothing and the caller is not
fooled.

It also fixes the about page, we now have:
 "Using SQL polling (Fallback, Error connecting to RabbitMQ)"
instead of
 "Using RabbitMQ"

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c407ce021e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:32 +02:00
David Cook ad35b19273
Bug 34070: Add error handling for ERROR frames for background worker
This change adds error handling for ERROR frames to background_jobs_worker.pl.
A previous patch added it to es_indexer_daemon.pl which is a different
background jobs worker.

To test ERROR handling for background_jobs_worker.pl:
1. Change your RabbitMQ connection details in koha-conf.xml or the hard-coded ones in Koha/BackgroundJob.pm
to include an invalid password. For example, if you don't have a message_broker already defined, use the following:
<message_broker>
 <password>bad</password>
</message_broker>
2. sudo koha-worker --restart --quiet kohadev
3. View the errors in the logs:
tail -f /var/log/koha/kohadev/worker-output.log
tail -f /var/log/koha/kohadev/worker-error.log

To test MESSAGE handling for background_jobs_worker.pl:
1. Ensure RabbitMQ connection details are correct
2. Go to Batch item modification and add the following barcodes:
39999000001310
39999000004571
3. Add a z - Public Note of the following and click Save:
THEBACKGROUNDWORKERWORKED
4. Search the catalogue using THEBACKGROUNDWORKERWORKED in the top
catalogue search
5. Note that you get 2 results in your search
6. Look in the logs just to make sure there are no new messages there

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4dc4a232c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:31 +02:00
David Cook 0927850a43
Bug 34070: Add error handling for ERROR frames
This change causes es_indexer_daemon.pl to die on ERROR frames instead
of spinning in an infinite loop. It also adds a content-type STOMP frame header
to help consumers know what data type is in the MESSAGE frame body.

To test ERROR handling for es_indexer_daemon.pl:
1. Switch to using Elasticsearch
2. Change your RabbitMQ connection details in koha-conf.xml or the hard-coded ones in Koha/BackgroundJob.pm
to include an invalid password. For example, if you don't have a message_broker already defined, use the following:
<message_broker>
 <password>bad</password>
</message_broker>
3. sudo koha-es-indexer --restart kohadev
4. View the errors in the logs:
tail -f /var/log/koha/kohadev/es-indexer-output.log
tail -f /var/log/koha/kohadev/es-indexer-error.log

To test MESSAGE handling for es_indexer_daemon.pl:
1. Switch to using Elasticsearch (and ensure RabbitMQ connection details are correct)
2. Change the title of a bib record to something new and unique
3. Try to search for the bib using the new title
4. Note you can find it
5. Look in the logs just to make sure there are no messages there

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2c1314ead6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:29:31 +02:00
Jonathan Druart bb697a165d
Bug 39286: Use mock_config instead of env vars
Bug 35655 needed to mock the config, but instead introduced new env variables.

Test plan:
  prove t/db_dependent/Koha/BackgroundJob.t
should still return green

Bonus 1: no more warning
t/db_dependent/Koha/BackgroundJob.t .. 1/6 Cannot connect to broker Failed to connect: Error connecting to not_localhost:99999: Invalid argument at /usr/share/perl5/Net/Stomp.pm line 27.; giving up at /usr/share/perl5/Net/Stomp.pm line 27.

Bonus 2: tests are passing even if you have 'message_broker' in the
config
To test this, add the following entry to $KOHA_CONf then prove again
 <message_broker>
    <hostname>localhost</hostname>
    <port>61613</port>
    <username>guest</username>
    <password>guest</password>
    <vhost></vhost>
 </message_broker>
=> Without this patch the tests fail because the config will overwrite
the env vars.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Warning goes away and prove works even with the message_broker config.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 15a272e1e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:26:45 +02:00
David Nind 673306f563
Bug 39878: (follow-up) Update hints for default FTP and SFTP ports
Hint now covers the default ports for FTP (21) and
SFTP (22), instead of "will default to 22".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ef8329bd37)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:21:58 +02:00
Kyle M Hall 2d6824c287
Bug 39878: EDIFACT vendor account records sets default port incorrectly for FTP
When creating or editing an EDI (EDIFACT vendor record) if the port is left empty it will be set to port 22. This is fine then the service is SFTP, but if FTP is selected the default to 21.

Test plan:
1) Enable EDIFACT
2) Create a new EDI Vendor account with the FTP transport selected. Pleave the ports unpopulated
3) Note the saved record has port 22 set
4) Apply this patch
5) Restart all the things!
6) Repeat stepts 1 and 2
7) The port should now be 21 for new ftp site and 22 for new stp sites!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fb9722a128)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:21:57 +02:00
Martin Renvoize b494793ce8
Bug 33284: (follow-up) Fix unit tests
We have a case here where we have checkout_id pointing at issues and
old_issues tables. We need to trick TestBuilder to NOT automagically
build our related checkout.. This patch passes 'undef' to the foreign
key field and then sets it after the fact to the related Old::Checkouts
objects we've already built above.

This patch should prevent the random failures we were seeing before

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d6af10d881)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:13:04 +02:00
Martin Renvoize bf1680c913
Bug 33284: Set renewer_id for sets of checkouts
This patch adds a trigger into the anonymize function of
Koha::Old::Checkouts such that we pass along the anonymize action to
the renewals record.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4f77ec8387)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:13:03 +02:00
Martin Renvoize 05f18896f7
Bug 33284: Set renewer_id appropriately for anonymize settings
This patch adds a trigger into the anonymize function of
Koha::Old::Checkout such that we pass along the anonymize action to the
renewals record.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e6d0df1156)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:13:03 +02:00
Martin Renvoize 9054bb131e
Bug 33284: Unit test
This patch adds unit tests to ensure renewals properly respect the
patron privacy settings.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d82abae1da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-04 10:12:58 +02:00
Tomas Cohen Arazi 23ff8a7b1d
Bug 39694: Make `es_indexer_daemon.pl` use batch_size to limit DB poll size
This patch makes the indexer poll the DB in configurable batches. Pretty
much like Rabbit does.

The only change is that it will now pass a LIMIT <batch_size> to the
query.

To test:
0. Have KTD started with ES (skip if you have an instance running):
   $ ktd --es7 up -d
1. Stop the indexer and rabbit:
   $ ktd --shell
  k$ sudo koha-es-indexer --stop kohadev
  k$ sudo service rabbitmq-server stop
2. On a separate terminal, watch the queue:
  k$ watch -n 0.5 'echo "SELECT COUNT(*) FROM background_jobs WHERE status=\"new\"" | koha-mysql kohadev'
=> SUCCESS: It should be empty
3. Add a bunch of things to index (this works with default KTD data):
  k$ for i in $(seq 1 438; seq 1 438) ; do echo "INSERT INTO background_jobs (status,queue,data) VALUES ('new','elastic_index','{\"record_server\":\"biblioserver\",\"record_ids\":[$i]}')" | koha-mysql kohadev ; done
4. Start the ES indexer:
  k$ sudo koha-es-indexer --start kohadev
5. Look at the queue size
=> FAIL: It shrinks too fast [1]
6. Apply this patch
7. Restart the indexer
  k$ perl misc/workers/es_indexer_daemon.pl &
8. Repeat 3
9. Look at the queue size:
=> SUCCESS: It shrinks 'slowly'
10. Sign off :-D

[1] This is a problem in certain scenarios, not in all of them. This is
the best I come up with in order to test the behavior change. Anyone can
set a new size of their taste.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 20b600d450)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 16:45:16 +02:00
Baptiste Wojtkowski 82d2b6a2e5
Bug 40458: add pod coverage to Discharge.pm
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Replaced borrowers in the ->request POD by borrower
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ff2fda90d4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f5f5fded2d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:52:50 +02:00
Jonathan Druart 2f6cff5899
Bug 18772: Remove warnings from t/ImportBatch.t
Use of uninitialized value in concatenation (.) or string at /usr/local/share/perl/5.20.2/MARC/File/XML.pm line 399, <__ANONIO__> chunk 1.

Those are 2 warnings coming from MARC::File::XML when called with
invalid XML.
We should not use Test::Warn as they are not expected and that may be
fixed upstream.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b696642df7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 0af79e24cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:50:08 +02:00
Jonathan Druart 7eb5b8fcae
Bug 40407: Remove legacy "pre-wrap" versions
From https://css-tricks.com/snippets/css/make-pre-text-wrap/

/* Browser specific (not valid) styles to make preformatted text wrap */

pre {
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

... I think it's now safe to remove the backward compatibility versions and simply keep pre-wrap.

Test plan (from bug 921)0:
  * place a hold on a title with a very very long title or author
  * mark it as "waiting for pickup" by doing a checkin
  * go to command line interface, and run
  * misc/cronjobs/gather_print_notices.pl /tmp
  * misc/cronjobs/printoverdues.sh /tmp
  * if your title/author is long enough, it's splitted on 2 lines
    with this patch (it is not before this patch)

It will also remove the warnings from t/db_dependent/Patron/Borrower_Discharge.t
WARNING: Ignored `white-space: -moz-pre-wrap` at 6:14, invalid value.
WARNING: Ignored `white-space: -o-pre-wrap` at 7:14, invalid value.
WARNING: Ignored `word-wrap: break-work` at 8:14, invalid value.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 03cf21fd92)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7f05cfc408)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:47:58 +02:00
Jonathan Druart b81c5d6dee
Bug 40372: Remove warning from api/v1/holds.t
t/db_dependent/api/v1/holds.t .. 1/16 No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 602.

We do not test the notification here, we can simply ignore the letters
code

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c14e72e782)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 98b97ea075)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:35:37 +02:00
Jonathan Druart 288aa52ad1
Bug 40374: Remove warnings from Koha/Booking.t
t/db_dependent/Koha/Booking.t .. 1/2 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry '7' for key 'PRIMARY' at /kohadevbox/koha/Koha/Object.pm line 174
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'status' at row 1 at /kohadevbox/koha/Koha/Object.pm line 174

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit da423a717e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 7566ed0d99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:29:59 +02:00
Jonathan Druart 08cd0737c8
Bug 40376: Remove warning from AuthorisedValues.t
t/db_dependent/AuthorisedValues.t .. 1/17 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'tagsubfield' on MarcSubfieldStructure - perhaps you forgot to set its 'is_auto_increment' attrib
ute during add_columns()? Treating 'tagsubfield' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174

It is a bit scary but it's only that we forgot to pass a value for
tagsubfield (that is NOT NULL and part of the PK)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 50b9abfe4f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4091d99c0c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:28:51 +02:00
Jonathan Druart d9eeb0c341
Bug 40377: Remove warnings from HoldsQueue/TransportCostOptimizations.t
UseTransportCostMatrix set to yes, but matrix not populated at /kohadevbox/koha/C4/HoldsQueue.pm line 188.
UseTransportCostMatrix set to yes, but matrix not populated at /kohadevbox/koha/C4/HoldsQueue.pm line 188.

It seems that they are expected, we simply need to catch them.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 364b78e653)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 66c969e037)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:25:55 +02:00
Jonathan Druart c29a9e67a8
Bug 40381: Remove warning from Koha/SearchEngine/Elasticsearch/ExportConfig.t
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'filter' on SearchMarcToField - perhaps you forgot to set its 'is_auto_increment' attribute during add_columns()? Treating 'filter' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/SearchField.pm line 42
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c2df4af991)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c19ce68db1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-01 15:24:58 +02:00