Commit Graph

58093 Commits

Author SHA1 Message Date
Jonathan Druart 53fdcd4e2c
Bug 38899: Move the toolbar out of the form
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f24e0d52e2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:44 +02:00
Matt Blenkinsop cf18d97ca5
Bug 38899: (QA follow-up) Match buttons to patron toolbar
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4fc93fee00)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:44 +02:00
Matt Blenkinsop fe6182ed90
Bug 38899: Add a cypress test
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 57bd44ae0f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:43 +02:00
Matt Blenkinsop 4fe86bf009
Bug 38899: Add a sticky toolbar
This patch adds a sticky toolbar to the vendors form

Test plan:
N.B: This patchset will not work on a sandbox

1) Navigate to Acquisitions and click New vendor
2) The toolbar should appear at the top of the page underneath Add vendor
3) Scroll down, the toolbar should stick and be given the 'floating' class
4) Scroll back up and the toolbar should unstick and lose the 'floating' class

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 716980ce2f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:43 +02:00
Laura_Escamilla a21d6166c9
Bug 40080: QA Follow-up - Code tidy-up based on QA tool feedback
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9cdf597a83)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:42 +02:00
Martin Renvoize d0dc3ffd71
Bug 40080: Fix search position on course reserves page
This patch corrects the position of the table search box on the course
reserves details pages by warpping the presented table in a 'rows' class
div.

We also update the search box dom configuration in the datatable itself
to match that of other opac tables.

Test plan
1) Add some course reserves to a course
2) View that course on the OPAC
3) Note that the search box for the table is aligned to the top of the
   main section of the page and over to the far right almost off screen.
4) Apply this patch
5) Confirm that the display of the search box is now nested just above
   the table in the same location as the course reserves list page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 32242f438a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:42 +02:00
Kyle M Hall 7c06904612
Bug 39911: Trap DIE signals in SIP server
At some point our SIP server stopped logging fatal errors to either logs or standard error. We should restore this vital functionality.

Test Plan:
1) Apply the first patch which will cause the patron information request
   to fail
2) Stop the SIP server
3) Start it again with: perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
4) Trigger the failure with the following command:
   ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l MPL --patron koha -m patron_information
5) Note "THIS IS A TEST" is not found in logs or stderr
6) Apply the second patch
7) Repeat steps 2-4
8) Note the error message is now visible from stderr at the command line
   and also in the SIP log

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f214db14dd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:42 +02:00
David Cook ce008cf965
Bug 40087: Fix t/Scrubber.t unit test
Remove "tag" and "staff" and add the missing "note"

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1d10d8b8c9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:41 +02:00
David Cook f72d9f2962
Bug 40087: Remove "tag" and "staff" scrubber profiles
This patch removes unused "tag" and "staff" scrubber profiles.

Test plan:
0. Apply the patch
1. prove t/Koha/Plugins/HtmlScrubber.t
2. prove t/Scrubber.t
3. Grep around the code for C4::Scrubber and make sure "tag"
and "staff" aren't used as arguments for C4::Scrubber

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e846abeeb7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:41 +02:00
Pedro Amorim 18daee91ff
Bug 39875: (QA follow-up): Correct historycheck ui_context
This ui_context is supposed to be opac, not staff.
For the purposes of these tests, this is not important, as the ui_context is
only needed for the template params and this is testing if the history check
stage is supposed to show or not.
Reckon this was a copy paste without consequences hence missed, but the code
is now semantically more correct.

prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dfd028871a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:40 +02:00
Pedro Amorim ed3f66e0b8
Bug 39875: Dont show history check
Unless there is a cardnumber or an authenticated user

Test plan:
1) Apply only the the tests file highlighting the issue:
prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t
2) Notice it fails.
3) Apply this patch.
4) Run tests again. Notice it passes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6a0fcefa22)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:40 +02:00
Pedro Amorim 8cf43dc2f9
Bug 39875: Add tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ae2e9e23de)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:40 +02:00
Owen Leonard 1210d6aafa
Bug 39919: Overdues with fines report has incorrect title, breadcrumbs, etc.
This patch corrects the "Overdues with fines" page so that the page
title, breadcrumbs, and main heading match the name used in navigation
menus.

To test, apply the patch and go to Circulation -> Overdues with fines.
Confirm that the page title, breadcrumb menu, and page heading are
correct: "Overdues with fines at [library]"

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 28cf1da6ea)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:39 +02:00
Tomas Cohen Arazi 79f69e7e4c
Bug 39961: (follow-up) Make `koha-disable` stop all queues
This patch applies the same logic to `koha-disable`.

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d2ffae92a7)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:39 +02:00
Tomas Cohen Arazi 5a6ad66117
Bug 39961: Make `koha-create` start all queues
Taking advantage of the `get_worker_queues` function introduced in bug
31124, this patch makes `koha-create` start all defined queues.

To test:
1. Run:
   $ ktd --shell
  k$ sudo -s
  k$ koha-create --create-db test
=> FAIL: No mention of `long_tasks`
2. Apply 31124 and then this patch
3. Run:
  k$ cp debian/scripts/koha-functions.sh \
        /usr/share/koha/bin/koha-functions.sh
  k$ debian/scripts/koha-create --create-db test1
=> SUCCESS: `long_tasks` worker is started
4. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 45089704fa)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:38 +02:00
Tomas Cohen Arazi 86fd02bd1a
Bug 31124: Make koha-remove stop all workers
This patch makes two things:

* Adds a `get_worker_queues` function to koha-functions.sh
* Makes `koha-remove` loop through all the defined queues to stop all
  the running workers before trying to remove the unix user for the
  instance.

To test:
1. Run:
   $ ktd --shell
  k$ sudo -s
  k$ koha-create --create-db test1
  k$ service koha-common restart
  k$ koha-remove test1
=> FAIL: There's an error about not being able to drop the instance user
2. Run:
  k$ ps -ef | grep test1
=> FAIL: There's a running process for the 'long_tasks' queue worker.
3. Apply this patch
4. Run:
  k$ cp debian/scripts/koha-functions.sh \
        /usr/share/koha/bin/koha-functions.sh
5. Repeat 1 naming the instance `test2`
=> SUCCESS: The instance is removed correctly. No error about running
processes
=> SUCCESS: No process is running for `test2`
6. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 576c496442)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:38 +02:00
Andreas Jonsson c3a9ef0989
Bug 38974: Fix error in OPAC patron update
Test plan:

1) Make sure Patron category is checked in the system preference PatronSelfModificationBorrowerUnwantedField
2) Log in to the opac
3) Go to "Personal details"
4) Select any value for "Date of birth"
5) Click save
6) This must not yield error 500. (But may be a successful save or a validation error).

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 04ebdd4ac1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:37 +02:00
Jonathan Druart 65b15bcc19
Bug 40003: Add a test
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>
(cherry picked from commit c4f7b14906)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:37 +02:00
Jonathan Druart fd6552957e
Bug 40003: Remove warning from log when creating a new bib record
Test plan:
Hit cataloguing/addbiblio.pl?frameworkcode=FA

Without this patch you get warnings in the Koha log file:
Use of uninitialized value in string eq at /kohadevbox/koha/cataloguing/addbiblio.pl line 572.
Use of uninitialized value in substitution (s///) at /kohadevbox/koha/Koha/UI/Form/Builder/Biblio.pm line 55.

with this patch applied: no warning

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>
(cherry picked from commit 0ba11f98f9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:37 +02:00
Jonathan Druart 21ffc157f8
Bug 40021: Remove warnings from Koha/Plugins/Recall_hooks.t
Test plan:
  prove t/db_dependent/Koha/Plugins/Recall_hooks.t
should return green

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit db655799ad)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:36 +02:00
Jonathan Druart 2af2c4f6f9
Bug 40018: Remove warnings from Koha/Template/Plugin/Koha.t
Because we still use CGI::Session (bug 17427), we need to mock
CGI::Session to remove those 2 warnings
rollback ineffective with AutoCommit enabled

Test plan:
Run the tests after this patch, it should be green

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eaaabf66dd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:36 +02:00
Lucas Gass c5ff343c2c
Bug 40036: Add reason back to status column and add classes/data attributes
To test:
0. APPLY PATCH
1. Make a few AVs for SUGGEST ( reason ) and SUGGEST_STATUS ( status ).
2. Make some new suggestions and give them new statues w/ a reason.
3. The reason should display, in parentheses, in the status column.
4. There should be a status class and a reason class for each.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 35baa3ec46)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:35 +02:00
Jonathan Druart ca2ff9b46b
Bug 40019: Remove warnings from Koha/Auth/Client.t
Test plan:
  prove t/db_dependent/Koha/Auth/Client.t
should return green

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c695e6ce4c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:35 +02:00
Jonathan Druart ef3ee7d69c
Bug 40020: Remove warnings from Koha/AdditionalContents.t
Test plan:
  prove t/db_dependent/Koha/AdditionalContents.t
should return green

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 827ad21244)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:35 +02:00
Tomas Cohen Arazi 3284f58e95
Bug 40034: Only check notforloan on itemtype if it exists
This patch makes the code in `CheckReserves` survive the non-existence
of the referenced item type in the `items` table for the passed item.

To test:
1. Apply the regression tests
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Reserves.t
=> FAIL: Tests explode like this:

```
Can't call method "notforloan" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 870.
```

3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 854783c836)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:34 +02:00
Tomas Cohen Arazi 7cc3b371fe
Bug 40034: Regression tests
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6c26ce01d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:34 +02:00
Fridolin Somers eb9da8a8d6
Bug 40042: Add default value 0 for index var in search_indexes.inc
In koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc some calls do not set 'index' var generating idx="idx_".
Set 0 has default value.

Test plan :
1) Enable system preference 'IntranetCatalogSearchPulldown'
2) Go to catalogue advanced search
3) Look HTML source and check you see:
     <select class="advsearch" name="idx" id="idx_0">
     <select class="advsearch" name="idx" id="idx_1">
     <select class="advsearch" name="idx" id="idx_2">
4) In page page toolbar, click 'Search catalog'
5) Click on 'More options' icon
6) Look HTML source of this part and check you see:
      <select class="advsearch" name="idx" id="idx_0">
Without patch you see:
      <select class="advsearch" name="idx" id="idx_">

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0d39336f71)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:33 +02:00
Owen Leonard d99a9e28b6
Bug 40061: (follow-up) Delete last image using checkbox
This followup corrects a problem in image deletion which isn't really
the same issue (it's not CSRF related) but is another problem with
deletion. The JS for grabbing all the checkboxes by name wasn't working
when there is only one checkbox.

To test, apply the patch and delete all but one image from the patron
card creator image manager.

- Check the checkbox for the last image and click the "Delete selected"
  button.
- The image should be deleted successfully.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 727b9d2dde)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:33 +02:00
Owen Leonard 4862281a98
Bug 40061: Add CSRF protection to patron image deletion
The patron image deletion operation was not fully updated in Bug 34478.
The individual "Delete" buttons in the table of images need to be
updated to use form-submit.js

Unrelated: I removed an invalid "align" attribute from a <td>.

To test, apply the patch and go to Tools -> Patron card creator -> Image
manager.

- Upload multiple images
- Test the individual "Delete" buttons in the table of images.
  - Test that both the "OK" and "Cancel" operations work correctly.
- Test the process of checking one or more checkboxes and clicking the
  "Delete selected" button.
   - Test that both the "OK" and "Cancel" operations work correctly.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f3bfcfa66)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:33 +02:00
Pedro Amorim 5eb5d33f2f
Bug 40057: Fix db revision
Test plan (ktd):
1) reset_all
2) Run first part of the 241200017.pl atomicupdate manually
	koha-mysql kohadev
	ALTER TABLE illrequests DROP FOREIGN KEY illrequests_bnfk;
3) Create an ILL request linked to a borrower that doesn't exist (simulate old data):
	INSERT INTO illrequests (`backend`, `borrowernumber`,`branchcode` ) VALUES ('Standard', '99999', 'CPL');
4) Run the 2nd part of the atomicupdate manually:
   ALTER TABLE illrequests ADD CONSTRAINT illrequests_bnfk FOREIGN KEY(`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE;
5) Notice you get the error:
	ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (., CONSTRAINT  FOREIGN KEY () REFERENCES  () ON DELETE SET NULL ON UPDATE CASCADE)
6) Run the added query in the patch:
	UPDATE illrequests SET borrowernumber = NULL WHERE borrowernumber NOT IN (SELECT borrowernumber FROM borrowers);
7) Repeat step 4)
8) Notice there's no errors

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 94d5c37db8)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:32 +02:00
Jonathan Druart 893bd2af71
Bug 40067: Improve waits and intercepts
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 688b5961c9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:32 +02:00
Matt Blenkinsop e692023eb0
Bug 40067: Add a cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 79567178ec)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:31 +02:00
Jonathan Druart 67319ff0b8
Bug 40067: Simplify code
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7715e3ae4e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:31 +02:00
Matt Blenkinsop 2db7eb95c3
Bug 40067: Prevent receive shipments opening in a new tab
Test plan:
1) Navigate to a vendor record
2) Click the Receive shipments button
3) It will open in a new tab
4) Apply patch - yarn js:build
5) Hard refresh the browser
6) Repeat steps 1 - 2
7) The page will open in the same tab

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 052cc1b6ef)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:30 +02:00
Martin Renvoize 8215156088
Bug 23978: (QA follow-up) Use html_scrubber
This followup replaces the $raw filter with `scrub_html type => 'note' |
$raw`.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eb19513f48)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:30 +02:00
Theodoros Theodoropoulos 8690acce45
Bug 23978: Expose HTML in Reports
This patch updates the notes field to a $raw filter to prevent html
escaping of the data within it.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3bcbb66ded)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-22 23:48:25 +02:00
Matt Blenkinsop e88dc60ff8
Bug 38298: Add permission checks to EDI breadcrumbs
Test plan:
1) Choose a staff patron and assign them the following permissions
    - catalogue
    - edi_manage
2) Enable the edifact syspref
3) Log in as the chosen staff patron and navigate to Acquisitions > EDI accounts from the left hand menu
4) The breadcrumb will contain Administration
5) Clicking this will result in a permissions error
6) Apply patch
7) Refresh the page and the breadcrumb will now read Acquisitions and will work

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ff366554fe)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:05 +02:00
Nick Clemens 812cca9610
Bug 39558: Update biblio and biblioitems timestamps explicitly
This patch simply adds 'timestamp = current_timestamp()' to the SQL statements
run when editing a biblio. This ensures the tables timestamps are kept in sync

To test:
1 - Choose a biblio in the database and make an update to a 650 field
2 - Check the timestamps in MySQL:
    SELECT biblio.timestamp, biblioitems.timestamp, biblio_metadata.timestamp FROM biblio JOIN biblioitems USING (biblionumber) JOIN biblio_metadata USING (biblionumber) WHERE biblionumber=9;
3 - Note the timestamps
4 - Edit the same 650 again
5 - Check the timestamps and note that the biblio_metadata is updated, but the others are not
6 - Apply patch, restart all
7 - Update the 650 again
8 - Check the timestamps, all are updated!
9 - Sign off

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 0aa820de32)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:04 +02:00
Matt Blenkinsop 064825e3e0
Bug 40066: Restore budget check to booksellers.pl
Test plan:
1) Navigate to a vendor record and select the baskets view from the left menu
2) Click "add to basket" in the table
3) A modal will display requiring the user to define a budget and fund
4) Apply patch and restart_all
5) Repeat steps 1 and 2
6) You will get the modal to add to the basket

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

Amended-by: Jonathan Druart
Remove import of GetBudget

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3293ae32bc)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:04 +02:00
Lucas Gass 13bff9ff2f
Bug 38477: (follow-up) Correct failing Item.t test
prove /kohadevbox/koha/t/db_dependent/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 53a9631335)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:03 +02:00
Tadeusz „tadzik” Sośnierz d5707a9ee6
Bug 40033: Call GetPlugins correctly in background_jobs.pl
Test plan:

1. Install a plugin that does not have any background_tasks, e.g. https://github.com/HKS3/HKS3GeoSearch/releases/tag/v0.12
2. Navigate to http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl, observe a 500
3. Apply patch
4. Observe no 500

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 53630add0d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:03 +02:00
Marcel de Rooy 1096a512e2
Bug 39866: (QA follow-up) Rudimentary validation of line/column
Prevent SQL injection.

Note: output_error in Output.pm needs further attention, but out
of scope here. (The error passed gets replaced by 404 here too.)

Test plan:
Pass something else than table.field in Line or Column URL param.
(Manipulate URL.)
You should be redirected to 404 error instead of 500.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eedb6cece6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:02 +02:00
Adolfo Rodríguez 169b255f9d
Bug 39866: Acquisitions statistics fails when filling only the To date
This patch fixes the exection of the report Acquisitions statistics if you fill only the To date
Test plan:
1 Execute the report Acquisitions statistics filling only To date filter in Placed on or Received on (/cgi-bin/koha/reports/acquisitions_stats.pl) Koha returns an Internal Server Error
2 Apply patch, restart services
3 Repeat step 1, now the report returns the results page as expected

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed superfluous COALESCEs.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 856a85d3af)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:02 +02:00
Martin Renvoize b48f5c432d
Bug 37364: Add requested RDA handling to generate_marc_host_field
This patch adds handling for the 264 field in precedence to the 260 for
the generate_marc_host_field method and also adds subfields n and p to
the 245 handling.

Test plan
1) The routine is currently only called during bundle linking so...
1a) Creating a new bundle
   * Add a new bib record
   * Mark the bib record as a 'collection' type by setting leader
     position 7 to 'c'
   * Add a new item to this bib record
   * You should see a new 'Manage bundle' button available in the
     'Actions' column of the Holdings table.
   * Clicking 'Manage bundle' should expand the table to include a new
     row directly beneath this one.
   * Use the new 'Add to bundle' button that appears in this row to
     trigger a modal that allows entering the barcode of items you wish
     to add to the bundle
   * Ensure the 'Add MARC link' checkbox is checked to create 773 links
     and trigger the code above
2) Inspect the MARC record for the host biblio and confirm the 773 has
   been built.
3) Run unit tests to confirm they now pass

Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 300247d2c6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:02 +02:00
Martin Renvoize 3826b4794e
Bug 37364: Unit tests
This patch adds unit tests to confirm that the 773 record created by
Koha::Biblio now takes account of RDA updates and subfield ordering.

Test plan
1. Apply patch
2. Run `prove ./t/db_dependent/Koha/Biblio.t`.
3. Test fails.
4. Apply next patch in series
5. Run `prove ./t/db_dependent/Koha/Biblio.t`.
6. All tests pass.

Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f234fe5a1c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:01 +02:00
Owen Leonard 1c62677aa0
Bug 39955: Report subgroup filter not cleared when changing tabs
This patch fixes the JS on the saved SQL reports page so that the
subgroup column filter is correctly cleared when the tab changes. The
wrong table column is targeted.

To test, apply the patch and go to Reports -> Saved SQL reports.

- If necessary, at least two SQL reports, each with in a different group
  and different subgroup. For example:
  - sql: SELECT * FROM items LIMIT 10;
  - group: Catalog
  - subgroup: Statistics
  ...and...
  - sql: SELECT * FROM borrowers LIMIT 10;
  - group: Patrons
  - subgroup: Statistics
- From the saved reports page, go to the tab for one of your reports and
  filter by subgroup.
- Switch to a different tab containing SQL reports. The reports should
  be shown as expected.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2de0265166)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:01 +02:00
Lucas Gass 56f329e843
Bug 39991: Fix MARC record display on showdiffmarc.pl
To test:

1. Download a record you already have in Koha
2. Cataloging > Stage MARC records for import
3. Record matching rule: KohaBiblio (99$c)
4. Stage for import > View batch
5. In the table results there should be a link to 'View' in the 'Diff' column.
6. Notice the Record comparison is not side by side.
7. APPLY PATCH
8. Try steps 1 - 6 again, this time the record comparison should be side by side.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0cafda92b6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:00 +02:00
Pedro Amorim b801888856
Bug 39823: Identify error messages based on code
Even if severity does not exist. Additionally, only add severity to message if it exists.

Test plan:
1) Apply tests patches. Run tests (they should fail):
prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t
2) Apply this patch and run tests again (they should pass this time).

UI test:
1) Create a new data provider linked to Gale Cengage, service url:
https://api.siqcloud.online/counterapi/r51
2) Add report release 5, customer id: '123', requestor id: '123', report types: 'TR_J1'
3) Run a report for this data provider, from Feb 2025 to Apr 2025. Notice that before applying patches, the job report results in a red bar with no error message.
4) Apply patches, repeat 3. Notice it now results in a nice error message.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 023f935360)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:00 +02:00
Pedro Amorim d4fb56be5b
Bug 39823: Add tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9b0d6260bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:43:00 +02:00
Pedro Amorim 54ee4ded1e
Bug 39823: Clean-up: Mock LWP response instead of class method being tested
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d618dc808f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-06-17 21:42:59 +02:00