Commit Graph

57077 Commits

Author SHA1 Message Date
Fridolin Somers 147d89d8bf
Bug 39737: Obsolete call on system preference 'PatronSelfRegistrationAdditionalInstructions'
Bug 34889 moved to additional contents.
Remove call in opac pages.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cef1685925)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:58:52 +02:00
Fridolin Somers d6132642f6
Bug 39736: Remove obsolete call on system preference 'OPACResultsSidebar'
Bug 34869 moved additional contents.
Remove call in opac/opac-search.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a210683610)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:57:01 +02:00
Martin Renvoize 2c80caac7d
Bug 39696: (follow-up) Set text-bg-info on badge
We also use a badge without a text-bg-# class on the modal claims
include.. this patch adds the same text-bg-info to that.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 79e872915f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:54:02 +02:00
Martin Renvoize ad5d362fc4
Bug 39696: Set text-bg-info on badge
With bootstrap 5, a 'badge' class should always be accompanied by a
text-bg-# class. This second class sets the badge color and an
appropriate forground text color to ensure appropriate contrast.

Steps to test:
1. Enable the ability to mark items as "Claimed Returned" by setting
   the ClaimReturnedLostValue system preference.
2. Check out an item to a patron, and backdate the due date so that it
   becomes overdue.
3. Navigate to: /cgi-bin/koha/circ/overdue.pl to view the overdue item.
4. Mark the item as "Claims Returned".
5. Observe the display: the claim return date text uses #fff (white),
   which is not visible on white table rows and has poor contrast on
   grey rows.
6. Apply the patch
7. Clear cache in browser and observe the display: the claim return date
   badge is now blue with black text.
8. Sign off and have an amazing day! :D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2f4f34de0a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:53:27 +02:00
Nick Clemens ae937750a9
Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat
When building queries for matchign Zebra uses OR to combine searches - Elasticsearch
has been effectively using 'AND' - this patch checks whether and_or has been passed
and follows the variable when present.

To test:
1 - Have an import file of auths with multiple 035
2 - Setup an authority matching rule
    Search index: other-control-number
    Score: 1000
    Tag: 035
    Subfields: a
3 - Make sure Koha is using Elasticsearch
4 - Stage file without matching, import file
5 - Stage file again, using your matching rule
6 - Note all records match
7 - Setup Cataloging->Marc modification template
8 - Add an action to delete first 035 field
9 - Run it against the records you just imported
    You can use a report:
    SELECT authid FROM auth_header WHERE authid > #### (find the lowest new record number in batch you imported)
10 - Change matching rule in batch to none, then back to your rule
11 - No matches!
12 - Apply patch, restart all
13 - Set matchign rule to none, then back to your rule
14 - Matches!

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised!
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-10-03 14:35:53 +02:00
Lucas Gass 5044496b38
Bug 39861: Delegate click function to the table
To test:
1 - Add a new Z3950 server with basic information filled out, it doesn't need to be valid
2 - Add a second copy via the DB:
    INSERT INTO z3950servers SELECT null,host,port,db,userid,password,servername,checked,rank,syntax,timeout,servertype,encoding,recordtype,sru_options,sru_fields,add_xslt,attributes FROM z3950servers WHERE id=6;
3 - Delete the copy, assuming it is on page one, it works
4 - Spam the DB with the SQL above and create 20+ entries
5 - Open the Z3950 admin page
6 - Go to second page of servers
7 - Attempt to delete any entry
8 - Nothing happens
9 - APPLY PATCH
10 - Try deleting again, it should now work.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a009011d5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:27:14 +02:00
Slava Shishkin 652126118f
Bug 39787: Fix missing sender EAN when only one EAN is defined
If only one EAN is defined for the library, the Create EDIFACT order
button template used the eans.0 object instead of its ean field.
As a result, the data-ean attribute contained an object, not the EAN
string. Fixed by explicitly accessing the field: eans.0.ean.

Steps to reproduce:
1. Ensure only one Library EAN is configured in
   /cgi-bin/koha/admin/edi_ean_accounts.pl.
2. Create a new basket.
3. Inspect the HTML of the Create EDIFACT order button.
4. The data-ean attribute will show an object instead
   of EAN string — e.g. Koha::Schema::Result... (this is the bug).
5. Apply the patch and reload the basket page.
6. Inspect the HTML again — data-ean should now show
   the EAN string (fixed).
7. Click the button, confirm basket closure, then go to EDIFACT messages
(/cgi-bin/koha/acqui/edifactmsgs.pl) and verify the message was created.

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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 14:24:47 +02:00
Jonathan Druart ecb96b76d0
Bug 39930: Prevent DT's state to be lost overnight
The default value for stateDuration is 7200 (2h). Which means DataTables
will ignore the saved state if reused after this delay.

Additionally is causes problem on some tables where the default state is
not restored and all columns are displayed.

From https://datatables.net/reference/option/stateDuration
```
Please note that the value is given in seconds. The value 0 is a special value as it indicates that the state can be stored and retrieved indefinitely with no time limit.
```

We are going to set it to 0 so that the state is only lost/reset after a
logout

Test plan:
Ideally you can should edit this file and set saveState to 60 (seconds),
so it's easy to test.
Do not apply this patch and confirm that the state is not restored after
either 60s or 2h (if you modified the file or not).
It is a problem on the checkout list table as extra columns (like
"Today's checkouts") are displayed.

With this patch applied the state should be restored correctly.
If you logout the state will be lost however.

Ideally we might want to store user's preferences on the server.

Signed-off-by: Ludovic Julien <ludovic.julien@inLibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ad11a32584)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c2a7a1906c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-10-03 08:22:25 +02:00
Tomas Cohen Arazi aef73ebc5d
Bug 39784: Remove stray 'xxx' string in migrate.inc
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a8afc9f8d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 12:03:44 +02:00
Tomas Cohen Arazi 7df6e4d9f7
Bug 39771: Make `data` attribute nullable for jobs
This patch makes the `data` attribute nullable. This happens when
`$job->finish()` is called with no parameters.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/jobs.t
=> FAIL: Tests don't pass, a 500 is returned when `finish()` was called
with no data
3. Apply this patch
4. Rebuild the API spec:
  k$ yarn api:bundle
5. Repeat 2
=> SUCCESS: Tests pass! The API doesn't explode
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.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 b0f21ad50a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:59:15 +02:00
Tomas Cohen Arazi 2e4e7387f9
Bug 39771: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.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 01e3a6f600)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:59:05 +02:00
David Cook 4273af433f
Bug 39623: Remove "install" target's dependency on "all" target
This change removes the install target's dependency on "all". There
is no clear reason why "install" would need to depend on all other
build targets.

After you remove this dependency, running "make" and "make install"
work the way you'd expect them to work. "make" does the build and
"make install" does the install.

Test plan:
0. DO NOT APPLY THE PATCH YET!
1. Setup intall target
sudo mkdir /opt/koha
sudo chown kohadev-koha  /opt/koha
2. Clean build env
rm -rf blib Makefile /opt/koha/*
3. perl Makefile.PL
Installation mode (dev, single, standard) [standard] single
Please specify the directory in which to install Koha [/var/lib/koha/kohadev/koha] /opt/koha
NOTE: Otherwise accept all defaults
4. make
NOTE: build-resources.PL is run and the blib directory is populated
5. make install
NOTE: build-resources.PL is run and the blib directory is populated and the built
files are installed to /opt/koha

6. Apply the patch now
7. mv /opt/koha /opt/koha.bak
8. Re-setup install target
sudo mkdir /opt/koha
sudo chown kohadev-koha /opt/koha
9. Clean build env
rm -rf blib Makefile /opt/koha/*
10. perl Makefile.PL
Installation mode (dev, single, standard) [standard] single
Please specify the directory in which to install Koha [/var/lib/koha/kohadev/koha] /opt/koha
NOTE: Otherwise accept all defaults
11. make
NOTE: build-resources.PL is run and the blib directory is populated
12. make install
NOTE: Only the install step is run

13. diff -r /opt/koha /opt/koha.bak
14. Note that there are no differences between the two directories

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 0d06c27e75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:56:35 +02:00
Jonathan Druart a5a3c0b292
Bug 39826: UTF8-decode vendor interface's password on display
We store an encrypted version of the passwords for vendor's interfaces, but we don't utf8 decode it after it is decrypted

Test plan:
0. Do not apply this patch
1. Create or edit a vendor and add at least one interface with non ascii
   characters, eg. émyPassword❤
2. Go to the detail view of the vendor and click the "Show password"
   link
=> The password is not correctly utf8-decoded
3. Apply this patch, repeat 2
=> The password is correctly displayed
4. Repeat 1 and 2
=> The password is correctly displayed

Note that maybe we should make sure the encrypt_hex is getting a valid
utf8-encoded variable.

(cherry picked from commit 25a805e8e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:51:09 +02:00
Lucas Gass 19ad8d24b5
Bug 39582: Syndetics support for UPC and OCLC numbers on OPAC results page
To test:
1. Enable Syndetics
2. Have a record with an 024 and 1st indicator.
3. Do a search to return the record from step 3.
4. The image does not display.
5. APPLY PATCH
6. Try step 3 again, this time the cover image should display properly on the OPAC results page.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2d484d326b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:47:51 +02:00
Nick Clemens e2a3710b7d
Bug 39076: Use state variable to avoid creating extra ES connections
As elsewhere in the code, we should use a state variable for our
'bib_searcher' object to avoid overhead of extra ES connections.

Worth noting - we don't actually use the 'bib_searcher' at all during
record auto linking as we pass skipmetadata

To test:
0 - Apply patch
1 - Enable biblio auto linking
    AutoLinkBiblios, CatalogModuleRelink, LinkerRelink
2 - Stage and import a marc file
3 - Confirm record authorities link as expected
4 - Search authorities in the staff interface
5 - Confirm usage counts are shown for results

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e2207cb478)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:39:37 +02:00
Matt Blenkinsop d31f8d7279
Bug 39752: Check for biblio existence when matches are found
Currently when adding to a basket from a new/staged file, we don't check whether a matched record still exists when importing. This patch changes the conditional check to be based on the existence of the biblio record rather than just on the biblionumber from the match

Test plan:
1) Stage and import a record into Koha
2) Stage the same record again, this time matching on ISBN
3) Check that the match has been found in the batch details
4) Delete the original record that you imported in step 1
5) Find a basket, and add to it from a staged file
6) Choose the file/record you imported in stage 2
7) Select the record and save to add the orders
8) You will get a 500 error
9) Apply patch and restart_all
10) Refresh the page to re-submit the form
11) The form should submit correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37538b22a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:35:15 +02:00
Nick Clemens 2f45f272a2
Bug 39752: (QA follow-up) Unit test
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 08da4b33b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:35:15 +02:00
Nick Clemens 9aba7c0b4e
Bug 39070: Don't request facets when searching for recrod matches
This patch adds a new option to Elasticsearch to skip facets in build_query and
build_query_compat.

There should be no behavior change, however, queries to ES should be simpler

To test:
1 - Export some record from Koha
2 - Stage the records for import, matching on 999c
3 - Confirm expected matches
4 - Switch batch to use ISBN for matching
5 - Confirm expected matches
6 - Apply patches, restart all
7 - Switch batch to use 999c
8 - Confirm matches
9 - Switch batch to use ISBN
10 - Confirm matches

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d73e3399ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:31:25 +02:00
Fridolin Somers a63b204191
Bug 39747: Fix wrong system preference 'DefaultHoldExpirationUnitOfTime' in test suite
Correct preference is 'DefaultHoldExpirationdateUnitOfTime'.
Also no reason for ";".

Test by running : prove t/db_dependent/Reserves.t

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b79fb6aedf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:23:57 +02:00
Fridolin Somers 523eee0bf2
Bug 39746: Fix wrong system preference 'AutoLocation' in test suite
Bug 26176 renamed 'AutoLocation' to 'StaffLoginRestrictLibraryByIP'
Needs to be fixed in test suite

Test plan:
Enable 'StaffLoginRestrictLibraryByIP' in prefs
Run : prove Auth.t
Should pass

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ea6e31c39b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:21:34 +02:00
Fridolin Somers 8b0fef77af
Bug 39735: Fix typo in system preference call 'OPACFineNoRenewalsIncludeCredit'
Typo in system preference call 'OPACFineNoRenewalsIncludeCredit'
=> 'OPACFineNoRenewalsIncludeCredits'

Test plan :
Run : prove t/db_dependent/Circulation.t
Run test plan of Bug 23293

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0a32b7371f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:19:13 +02:00
Lucas Gass 2fa1204cc8
Bug 39603: Make sure authorised value category is ITEMTYPECAT
To test:
1. Add some AVs for ITEMTYPECAT and set some of your item types to be in that Search category. I made one called OTHER
2. Go to the OPAC advanced search page, the item types should be correctly displaying under ITEMTYPECAT with the correct description from ITEMTYPECAT.
3. Create a new AV called OTHER in a different category like 'ERM_AGREEMENT_CLOSURE_REASON'. Make the description something different like 'Wrong description'.
4. Now go back to the OPAC advanced search.
5. Notice your OTHER option now reads 'Wrong description'.
6. APPLY PATCH and restart_all
7. Try again, the OPAC descriptions should now be correct.

Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f79aec38b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:09:45 +02:00
Andrew Fuerste Henry 5fc9393cb6
Bug 39525: Label policy as 'Hold and booking pickup library match'
To test:
Apply patch, go to circ rules, confirm it says "Hold and booking library pickup match" under both "Defaul checkout, hold and return policy" and under "Default holds and bookings policies by item type" at both the all libraries and library-specific levels.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 66074093c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:08:12 +02:00
Tomas Cohen Arazi d0895bf487
Bug 39379: Only display Edit patron button if enough permissions
This patch adds a check for the current user permissions in order to
display the 'Edit' button on the patron search screen.

To test:
1. Have a patron with staff access and only `list_borrowers` permission
   (I picked Henry Acevedo, henry - Acevedo123)
2. Login as that user
3. Perform a patron search at http://kohadev-intra.localhost/cgi-bin/koha/members/members-home.pl
=> FAIL: There's an 'Edit' button
4. Click on the 'Edit' button
=> SUCCESS: You are told you don't have enough permissions
5. Apply this patch
6. Repeat 3
=> SUCCESS: The button is not displayed
7. Login with a superlibrarian user
8. Repeat 3
=> SUCCESS: You can see the button
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 989924e963)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:04:37 +02:00
Fridolin Somers c53631d969
Bug 39734: Remove obsolete call of system preference IntranetmainUserblock
Bug 35153 moved IntranetmainUserblock to additional contents.

Remove call in C4/Auth.pm

Test plan :
Check additional content "IntranetmainUserblock" is still OK ;)

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 c74a67a8ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 11:02:01 +02:00
Jonathan Druart 6e614957e2
Bug 39833: Adjust character_set_client in kohastructure.sql
koha-dump now generates the dump with utf8mb4

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a41f52530a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:58:56 +02:00
Fridolin Somers e6d570ee11
Bug 39738: Obsolete call on system preference 'SelfCheckHelpMessage'
Bug 35065 moved to additional contents.
Remove call in opac/sco/help.pl.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 49e852e0a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:55:16 +02:00
Tomas Cohen Arazi a6d13bd980
Bug 39783: Fix typo in migrate.inc
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2b69baa3c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:53:10 +02:00
Janusz Kaczmarek 6a4699397c
Bug 39692: With OnSiteCheckoutsForce the due date should be set
When OnSiteCheckoutsForce is set it is possible to on-site checkout an
item to a restricted patron. But the due data that is labelled with
"Automatic due date:" is not being set. As a result, when such a
checkout is performed and you do not set the date manually, the due
date will be set as for normal checkout (even if it is marked as
on-site checkout).

Test plan:
==========
1. Enable OnSiteCheckouts and OnSiteCheckoutsForce; manually restrict
   a patron.
2. Go to checkout page for this patron. You will notice:
   "On-site checkouts only. Automatic due date:" with an empty input
   field for the date. Perform the checkout (pick any existing
   barcode).
   Note the due date in patron's checkouts. In standard ktd it will be
   +5 days from today, as for a regular checkuot (cf. Circulation and
   fine rules) and the checkout will be marked as on-site checkout.
3. Apply the patch ; restart_all.
4. Repeat p. 2 (with another barcode or after checking-in). The date
   in the date input field should be set to today's date and after
   performing the checkout the sue date should also be set to
   the current date.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 103f095c2e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:49:24 +02:00
Owen Leonard daca6c3e3f
Bug 39947: Do not use bg-* Bootstrap classes
This patch removes a few instances of the "bg-*" class from our
templates, and adds some CSS to ensure that we can safely add the
".bg-*-subtle" class to a div with ".page-section."

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

- Go to Administration -> Circulation and fine rules. The information
  about rules specificity should have a pale blue background matching
  the color found in an "info" style alert.
- Go to Tools -> Import patrons. The "Notes" section should match what
  you saw in the previous step.
  NOTE: I made a small change to whitespace in the markup of this
  section to prevent the database column list from displaying without
  line breaks--an issue introduced by the global tidy.
- Go to Authorities and perform a search which will return results.
  - Click Actions -> Merge on one of the results. An "info" style alert
    should be shown at the top of the page, "Merging with authority..."
  - Without completing a merge, go to the Authorities home page. You
    should see an identical alert.
- In KTD, bibliographic record 369 can be used to test errors related to
  encoding problems:
  - Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=369
    and confirm that you see a "warning" style alert (a pale yellow
    background).
  - Edit that record and confirm you see a similar error messages on
    that page.

Sponsored-by: Athens County Public Libraries
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 753ce067e6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 71f601dabb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:38:27 +02:00
Brendan Lawlor b6f36fcf40
Bug 39597: Fix cancel_hold_alert badge color contrast for accesibilty
This patch add a class for the background on the badge element to fix color contrast

To test:
1. Go to a bib record and place multiple holds on it
2. Select multiple holds and click 'Cancel selected (4)'
3. The Alert says 'This action will cancel 4 hold(s).'
4. Note that the contrast on the number of holds is very low
5. Click 'Cancel' apply patch and restart_all
6. Repeat steps 2-3
7. Note that the contrast on the number of holds is good

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 858a53d897)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:32:41 +02:00
Owen Leonard 7a2f563974
Bug 39274: [24.11.x] Non public notes are low contrast in the issues table - Previous checkouts
This patch reflects some rethinking on my part about how the Bootstrap
color classes are meant to be used, and makes some changes which I hope
will be more consistent with the Bootstrap 5 documentation while keeping
our interface usable.

The main difference is in the use of the classes "text-bg-*" and
"bg-*-subtle." For example the class "bg-info-subtle" will give an
element a subtle colored background. "text-bg-info" will have a more
saturated background color. The "text-" part of the class is a reference
to the fact that elements with that category of classes will have text
color which adapts to provide correct contrast.

This patch also makes a minor adjustment to the color used for "warning"
type elements (e.g. <div class="alert alert-warning">. I've adjusted the
color slightly in order to differentiate it from the "primary"
class color we use for submit buttons.

To test, apply the patch and rebuil the staff interface CSS. Clear your
browser cache if necessary.

Checkouts:
1. Have an item with a non-public note.
2. Check it out, it looks fine while under "Today's issues"
3. Set the issuedate to some time in the past
   `update issues set issuedate = '2025-03-04 15:58:46';`
4. The non-public note should appear in legible red.

Return claims:
1. The "Claims" tab on the patron detail and checkout pages already used
   the "text-bg-*" classes but the "-success" class didn't work well
   with the tab background color so I removed it. I notice there is a bug
   in the way the classes change as the tab is activated, but that will
   have to be dealt with on another bug.

Bibliographic details:
1. Place at least one hold and at least one article request on a title.
2. The detail view should show "Holds: 1", and "Article requests: 1"
   with the numbers in legible Bootstrap badges.

Holds:
1. Perform a catalog search which will return multiple titles.
2. Select multiple titles and click "Place hold."
3. Select a patron to place a hold for.
4. Confirm the holds by clicking "Place hold."
5. The holds should now be shown under the heading "Existing holds,"
   with Bootstrap badgets showing the hold count on each.

Patrons requesting modification:
1. Submit an update to a patron record via the OPAC.
2. On the patrons home page in the staff interface there should be a
   "Patrons requesting modifications" link at the top, with a count of
   pending modifications shown in a Bootstrap badge.

Check-ins:
1. Check in an item from a patron account with multiple other checkouts.
2. In the table of checked-in items the patron's remaining checkout
   count should be shown in a Bootstrap badge.

SMTP servers:
1. Go to Administration -> SMTP Servers.
2. Edit at least one server so that debug mode is enabled and it is
   marked as a default server.
3. In the view of servers, the debug mode and default status should be
   shown in Bootstrap badges.

Plugins:
1. Go to Administration -> Plugins.
2. Upload a plugin if necessary, and check the list of installed plugins
   when the plugin is disabled and when it is enabled. In both cases the
   status should appear in a Bootstrap badge.

About page:
1. Go to the About page.
2. Under the "Server information" tab, the status of Memcached and
   Message broker should be shown with a background color--pale blue for
   okay statuses.

Tools home page:
1. If necessary, go to the OPAC and submit at least one comment on a
   bibliographic record and tag at least one record.
2. In the staff interface, on the Tools home page, the number of tags
   pending approval and the number of comments awaiting moderation
   should show in Bootstrap badges.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:30:28 +02:00
Matt Blenkinsop 71d4afd742
Bug 39530: Make MARC order cronjob dependent on AcqCreateitems
Test plan:
1) View the patch diff and confirm that the hardcoded value of 'ordering' has been replaced with undef
2) In C4/Acquisition.pm, look at the method description for ModBasketHeader and observe the descritpion for 'create_items'
3) Note that if the value is set to undef as per step 1, the AcqCreateItem syspref takes precedence

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2186bf7fa8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:07:33 +02:00
Nick Clemens 6e1b270b65
Bug 39717: Use numeric comparison for stock rotation stages
To test:
 1 - Enable SotckRotation
     http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=StockRotation
 2 - Browse to "Cataloging -> StockRotation"
 3 - 'New rota' - fill out the form and save
 4 - Manage->stages
 5 - Add many stages, more than 10 at least
 6 - Try to move a stage form the bottom to position 3
 7 - Note message above list: Saving changes... Error: Bad Request
 8 - Apply patch, restart_all
 9 - Attempt to move stages, try many combinations
10 - Success!

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 85003674ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:06:37 +02:00
Nick Clemens d30fdab95b
Bug 39652: (QA follow-up) Update misc/maintenance/pseudonymize_statistics.pl
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e744f001ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:00:07 +02:00
Pedro Amorim 325d608293
Bug 39652: Rename new_from_statistic
This new method name better reflects the fact that it now creates - and stores - the PseudonymizedTransaction object

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54205bd6ba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:00:07 +02:00
Pedro Amorim 4649544ee8
Bug 39652: store PseudonymizedTransaction before adding related entries
Test plan:
Run the tests before and after applying this patch:
perl t/db_dependent/Koha/Pseudonymization.t

They should fail before this patch and pass after applying patch.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f23632a352)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 10:00:00 +02:00
Pedro Amorim dfa1d9918f
Bug 39652: Add tests
These tests prove the bug:
perl t/db_dependent/Koha/Pseudonymization.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:59:54 +02:00
Marcel de Rooy fb8198142c
Bug 39485: Fix wide character in print-warn in opac-export
Similar change in intranet counterpart: catalogue/export.

Test plan:
Verify no warning anymore when using ris or isbd when record
contains specific Unicode character(s).

Signed-off-by: Magnus Enger <magnus@libriotech.no>
I could not trigger "Wide character" for RIS in the OPAC, but for
ISBD I can see it removes that warning.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 81359cc8a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:55:22 +02:00
Pedro Amorim 7d1afb05dd
Bug 39663: Fix header element for Patrons
Commit https://github.com/Koha-Community/Koha/commit/f42df40 renamed 'Members' to 'Patrons' but didnt adjust h3->h2 as it did with every other entry in this page

Signed-off-by: Pedro Amorim <pedro.amorim@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 8538c885f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:52:00 +02:00
Janusz Kaczmarek 7f850b8d35
Bug 39500: Subfield 111 $n is badly displayed in OPAC (MARC21)
If the main heading is 111 and id contains subfield $n, the content of
this subfield is badly displayed in OPAC: at the beginning of the
heading text (right after "By:"), and then correctly, as the part of
the link.

Test plan:
==========
1. Check if the 111 $n subfield is available in the framework you are
   using. If not, activate it (Editor checkbox).
2. Take any bibliographic record and replace the main heading with a
   conference heading (111), e.g.:
   111 $a Annual Koha Hackfest $n (13 : $c Marseille : $d 2025)
   Control in OPAC that the $n subfield is displayed twice (first time
   at the beginning)
3. Apply the patch ; restart_all
4. Check the result in OPAC: the main heading should be displayed
   correctly now.

Signed-off-by: Thomas Klausner <domm@plix.at>

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 34870b7d6a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:46:42 +02:00
Pedro Amorim b64fc2ecd7
Bug 39449: Fix table sort arrows
Test plan:
1) Look at the same biblio on both OPAC and Staff:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=76

2) Click on the 'current library' column header for OPAC and 'Home
   library' for staff. Notice that on Staff when it's DESC, arrow points
   down (as expected), but on OPAC when it's DESC, the arrows points up.

3) Apply patch. Reset CSS:
   yarn css:build

4) Do a hard refresh on the OPAC. Repeat test plan. Notice they now
   behave the same.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1d6017bbd8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:44:48 +02:00
Andrew Fuerste Henry 3a30284d32
Bug 39321: Hide subfield tag information for control fields in bib and authority editing
This applies only to the basic editor, but for both bibs and authorities
To test:
1 - Open a bib in the basic editor, see that the control fields show the subfield tag value label and that the value of 00 is slightly cut off in the display
2 - Open an authority in the basic editor and confirm same
3 - apply patch
4 - reload your records and see that the subfield value and label are now hidden for control fields in both bib and authrority editing

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 13b813a4f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:40:28 +02:00
Marcel de Rooy c7c6726f34
Bug 38904: Allow opac translation in admin/localization
Test plan:
Try to translate itemtype for an opac language not part of
intranet languages.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c80e9c015c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:38:48 +02:00
Marcel de Rooy cfe71bde53
Bug 38903: Fix theme in some getTranslatedLanguages calls
Combining opac with pref template is wrong. This pref should
actually be renamed to something like intranetTheme(s) or so.

Replacing the obsolete prog theme in Languages.t by undef. This
achieves the same: getting all themes for that interface.

Test plan:
Add some languages for opac and intranet. Do not enable exactly
the same set.
Enable TranslateNotices.
Verify that you have all OPAC languages on memberentry and
opac-messaging. And all languages on additional contents.
Run t/db_dependent/Languages.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with:
OPAC  languages: en, nl-NL, de-DE
Staff languages: en, de-DE, fr-FR
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit baea457996)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:37:15 +02:00
Marcel de Rooy 6c7bed9109
Bug 38630: (QA follow-up) Fixing few calls of getTranslatedLanguages
The fourth parameter is now removed and was never used.
Also replacing the 'both' interface by passing no interface to make
it consistent with call in additional-contents.
Resolving warn for empty interface or theme on Languages.pm L128.

Test plan:
Run t/db_dependent/Languages.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1f6e409871)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:52 +02:00
Marcel de Rooy 49dfd3899a
Bug 38630: (QA follow-up) Two typos
Prefered and chose.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d84f06ebab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:51 +02:00
Marcel de Rooy 830146cb81
Bug 38630: (QA follow-up) Add copyright, license and/or POD
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bbf0392359)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:51 +02:00
Julian Maurice 045818de6e
Bug 38630: Make the REST API respect KohaOpacLanguage cookie
The REST API can return translated strings to the opac or staff
interface, so it should respect the KohaOpacLanguage cookie and return
translations in the same language than the interface.

Test plan:
1. Do not apply patch yet
2. Log in to koha staff interface
3. Use the browser's devtools to get the value of CGISESSID cookie
4. Make sure you have at least 2 languages installed ('en' + another
   one - I'll use 'fr-FR' as an example in this test plan)
5. Find an item and note its itemnumber and itemtype
6. Go translate this itemtype's description (admin » item types » edit
   item type » translate). Add a translation for 'en' and another one
   for your language.
7. Close your browser tab (do not logout) and restart Koha to flush the
   memory cache.
8. Execute the following commands (replace variables by the correct
   value):

    curl -sSL "$KOHA_URL/api/v1/items/$ITEMNUMBER" \
        -H 'x-koha-embed: +strings' \
        -H "Cookie: KohaOpacLanguage=en; CGISESSID=$CGISESSID" \
        | jq -r '._strings.item_type_id.str'

   If you do not have jq, it can be found in most distributions
   packages. Or you could inspect the JSON manually at the path
   /_strings/item_type_id/str

   Restart Koha again, and execute the same command but with your
   language set in KohaOpacLanguage cookie:

    curl -sSL "$KOHA_URL/api/v1/items/$ITEMNUMBER" \
        -H 'x-koha-embed: +strings' \
        -H "Cookie: KohaOpacLanguage=fr-FR; CGISESSID=$CGISESSID" \
        | jq -r '._strings.item_type_id.str'

   Depending on how Koha sort the languages (not sure how it's done),
   you should get either the 'en' one or the 'fr-FR' one, but the
   important thing is you should get the same translation, no matter
   what the value of KohaOpacLanguage is, which is the issue this patch
   is trying to fix.
9. Apply the patch and restart Koha
10. Repeat step 8. This time you should get the translation
    corresponding to the language set in KohaOpacLanguage cookie

Side note:
* The need to restart Koha before each request is due to a bug (see bug
  38454). If already pushed when you're testing this one, you don't have
  to restart.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ca5db9ffb7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-29 09:34:42 +02:00
Marcel de Rooy c575e4bb6a
Bug 40608: (QA follow-up) Delete notice in test, adjust about.tt
[1] This prevents a warn 'Violation of unique constraint in Letter'
    from TestBuilder if the notice already exists.
[2] The about warn should no longer say that password changes will
    fail but only warn about a missing notification.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8d31c2e067)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 585ea49741)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-26 16:25:50 +02:00