]> git.koha-community.org Git - koha.git/log
koha.git
2 months agoBug 37478: (follow-up) Add MARC::Lint to cpanfile
Nick Clemens [Thu, 22 Aug 2024 11:26:52 +0000 (11:26 +0000)]
Bug 37478: (follow-up) Add MARC::Lint to cpanfile

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 43fd84508d8017979d203363c7f3b6231562666d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37478: Add strict mode to bulkmarcimport
Nick Clemens [Thu, 25 Jul 2024 16:37:17 +0000 (16:37 +0000)]
Bug 37478: Add strict mode to bulkmarcimport

This patch adds a conversion from MARC -> XML -> MARC to catch any parsing errors.
If errors are found, we then lint the record to catch any problems, output the
warnings, and skip the record.

To test:
1 - Download the sample records from this bug report
2 - perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v
    fails!
3 - perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v
    fails!
4 - Apply patch
5 - Repeat 2 & 3 - no change
6 - Add -st switch to the commands:
    perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v -st
    perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v -st
7 - The records are now skipped, and the script completes
8 - Confirm the warnings generated are useful
9 - Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0306281e417ffe8f3f7e3ff033f58a0872ce980d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38329: Remove orphan confirm_deletion() in supplier.tt
Phil Ringnalda [Fri, 1 Nov 2024 19:33:32 +0000 (12:33 -0700)]
Bug 38329: Remove orphan confirm_deletion() in supplier.tt

The JavaScript function confirm_deletion() in supplier.tt has either
been an unused orphan since bug 28082 two years ago, or since the switch
from YUI to Bootstrap 12 years ago. Doesn't matter which, nothing calls
it, and if it was called, it would fail by trying to GET with
op="delete" rather than POST with op="cud-delete".

Test plan:
 1. Acquisitions - New vendor, enter a name and Save
 2. Click the name of your new vendor, so your URL is at supplier.pl
 3. Click Delete vendor to verify that deleting still works without this
    unused code which would fail

Sponsored-by: Chetco Community Public Library
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 c70946a0bef61297a0d31893d47a0fe7c98c39ce)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37863: Fix checking if a patron is already in the list adding users to a patron...
Adolfo Rodríguez [Mon, 9 Sep 2024 07:20:08 +0000 (09:20 +0200)]
Bug 37863: Fix checking if a patron is already in the list adding users to a patron card batch

If the patron is already in the card batch it won't add it and it will show an error message

Test plan:
1 Create or edit an patron card batch
2 Try adding twice or more the same patron. It will show a success message everytime and you will end up with the same patron several times in the card batch
3 Apply patch, restart services
4 Repeat step 2. The first time you click on add user, it will do it and show the success message (Patron 'Patron name' added.), but after that it won't add the user and it will display an error message (Patron 'Patron name' is already in the list.)

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 293afd3de6a7f88d6da4311026fd294e49eb6b96)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 35126: Remove onload from opac-addbybiblionumber.pl
Lari Taskula [Wed, 2 Oct 2024 18:44:27 +0000 (18:44 +0000)]
Bug 35126: Remove onload from opac-addbybiblionumber.pl

To test:

Case a) Adding to a new list

1. Enable virtualshelves system preference
2. Search for any record and click it
3. On the right hand side of record view, click "Save to your lists"
4. A new pop up opens.
5. Under "Add to a new list", give any name to the list
6. Under "Add to a new list", click "Save"
7. Observe popup closing
8. Observe record view page reloading

Case b) Adding to an existing list

1. Enable virtualshelves system preference
2. Search for any record and click it
3. On the right hand side of record view, click "Save to your lists"
4. A new pop up opens.
5. Under "Add to a list", select an existing list
(it can be the same as the one you created in case a, it does not matter here)
6. Under "Add to a list", click "Save"
7. Observe popup closing
8. Unlike case a, observe record view page NOT reloading

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8cfce49d14ec38ff0fb053b0051391d55a9a341a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38325: Cannot delete invoice while viewing it
Phil Ringnalda [Fri, 1 Nov 2024 16:13:50 +0000 (09:13 -0700)]
Bug 38325: Cannot delete invoice while viewing it

The link to delete while viewing an individual invoice needs to be updated to
use submit-form-link so it can POST with op='cud-delete'.

Test plan:
 1. Home - Acquisitions, click Search with an empty Vendor: input
 2. Click Receive shipments, enter a number in the Vendor invoice input,
    click Next
 3. In the left sidebar, click Invoices, click Search without any parameters
 4. In the row for your invoice, click the invoice number link
 5. Next to the Save button, click the Delete link, click OK in the
    confirmation alert
 6. You'll see the page reload, and the URL change to include ?op=delete,
    but your invoice remains undeleted.
 7. Apply patch, reload the page
 8. Click Delete, click OK in the confirmation alert
 9. Click Search with no parameters, just to make sure the message about
    "Sorry, but there are no results for your search" really truly means
    that your invoice was deleted and now you don't have any invoices

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f9bfb4d0ca279909398dc1501469ca2625f6c6ac)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38309: Cannot delete additional fields
Phil Ringnalda [Fri, 1 Nov 2024 02:44:35 +0000 (19:44 -0700)]
Bug 38309: Cannot delete additional fields

Deleting an additional field tries to do a GET of ?op=delete... which no
longer works with CSRF protection. It needs to be a POST with op=cud-delete.

Test plan:
 1. Administration - Additional fields, click any table name
 2. New field, fill in a name and Save
 3. In the row for your field, click Delete
 4. You have a blank page
 5. Apply patch, click the browser Back button, refresh the page
 6. In the row for your undeleted field, click Delete
 7. Your field is deleted

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d5fbb1e87c6964b27b7d9829ca41e40f49869009)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38257: Do not use js_includes.inc in two different files
Emmi Takkinen [Mon, 28 Oct 2024 10:03:26 +0000 (12:03 +0200)]
Bug 38257: Do not use js_includes.inc in two different files

Downloading cart didn't work because js_includes.inc file
was included both in basket.tt and intranet-bottom.inc.
This patch removes related codeline from basket.tt.

To test:
1. Search for items and add one or more search results to your cart.
2. Open cart.
3. Attempt to download items from your cart.
=> Either nothing happens.
4. Apply this patch, restart services if needed.
5. Again attempt to download.
=> Download menu should now work as expected.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f8e20489134d5b865b931c0db481dbbcb0382cf1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38257: Fix cart pop up functionalities
Emmi Takkinen [Thu, 24 Oct 2024 11:57:46 +0000 (14:57 +0300)]
Bug 38257: Fix cart pop up functionalities

Almost all functionalities in cart pop up were broken
due changes made in bug 37033. Also following errors
were displayed in browsers console:

> Uncaught TypeError: antiClickjack is null
> Uncaught TypeError: $(...).dataTable is not a function

This happens because when 'intranet-bottom.inc' is loaded
after other .inc files in page.

To test:
1. Search for items and add one or more search results to your cart.
2. Open cart.
3. Attempt to use one or more functionalities (download, remove item etc.).
=> Either nothing happens or table is loaded again with no items in
table. However items are still displayed in cart when it's opened again.
4. Apply this patch, restart services if needed.
5. Again attempt to download, remove items, print etc. from cart
=> Everything should now work as expected.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9cae91c7da4c429350584dd394282be9d01e79da)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37912: Restore detail-trigger handling
Martin Renvoize [Tue, 29 Oct 2024 15:16:42 +0000 (15:16 +0000)]
Bug 37912: Restore detail-trigger handling

This patch converts our jQuery based click to native JS and restores the
bootstrap modal button click trigger handling.

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 93be319372e13890a4cb426904aed682c8eedba6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37684: Direct link to expired news are broken
Baptiste Wojtkowski [Tue, 20 Aug 2024 10:38:38 +0000 (12:38 +0200)]
Bug 37684: Direct link to expired news are broken

When using a direct link to a news (koha.url/cgi-bin/koha/opac-main.pl?news_id=XXX), the link is broken if the news is expired.

Formerly, a using AdditionalContent->get( id => "my_news_id") on an
expired news was returning a news, and calling get without id was
returning all news but the expired ones.

This patch adds tests to check this behaviour by adding one expired news and performing following new tests:
1 - It may not be returned by AdditionalContent.get()
2 - It must be returned by AdditionalContent.get() using its id

This patch fixes the behaviour by addind the new behaviour or
AdditionalContent.get:
1 - Any news must be returned by AdditionalContent.get() using its id;

TEST PLAN:
1 - Apply patch
2 - Remove the changes made to Koha/AdditionalContents.pm
3 - Run tests -> one test must fail
4 - Create a news with a expired expiration date, notice the id of the
  news in the url of the modification panel
5 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
  it does not work
6 - Reapply the whole patch
7 - Run test -> all test must pass
8 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
  it does work now

Signed-off-by: Olivier V <olivier.vezina@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 4ad5cbdb9708774e91a198e5e9a04d548a4503a7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37550: CheckItemPreSave should run barcodes through barcodedecode
Nick Clemens [Thu, 1 Aug 2024 18:01:25 +0000 (18:01 +0000)]
Bug 37550: CheckItemPreSave should run barcodes through barcodedecode

In Koha::Item we run a barcode through barcodedecode before any save.
We should do the same when checking barcodes to avoid a duplicate error
when the barcode is cleaned before it is written to the DB

To test:
1 - Follow previous test plan
2 - Note that after this patch is applied there is no exception
    All items are skipped as duplicate barcodes

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a262ffbdfa2adf54f36774547fd95c30b83ed8c6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37550: Unit test for CheckItemPreSave
Nick Clemens [Thu, 1 Aug 2024 18:00:57 +0000 (18:00 +0000)]
Bug 37550: Unit test for CheckItemPreSave

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5cab218d91cae9088cf043917cdd00c22574a089)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37550: Move item check after error handling
Nick Clemens [Thu, 1 Aug 2024 17:37:35 +0000 (17:37 +0000)]
Bug 37550: Move item check after error handling

To test:
1 - Grab the sample file on this bug report
2 - perl misc/migration_tools/bulkmarcimport.pl -b --file=spaceditems.pl -v
3 - An exception for 'Duplicate ID' is thrown and script dies
4 - Apply patch
5 - run script again
6 - The script finishes, no items are added, but record is

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5e15ede505b413b46f36fe428c8e87e5c8217ae4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37365: (QA follow-up) Add error checking around AddFile call
Marcel de Rooy [Fri, 4 Oct 2024 09:11:47 +0000 (09:11 +0000)]
Bug 37365: (QA follow-up) Add error checking around AddFile call

Test plan:
Add a return; in AddFile to simulate a failing db insert.
Verify that an alert pops up.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 35d90969f14bd55fb77acbbafbf0f9a23a2b2d18)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37365: (QA follow-up) Add borrowernumber to referrer url
Marcel de Rooy [Fri, 4 Oct 2024 09:04:18 +0000 (09:04 +0000)]
Bug 37365: (QA follow-up) Add borrowernumber to referrer url

Since we post to add_message, we need to ensure that the
borrowernumber is added to the referrer url. This 'tric' is
already done there for another form.

Test plan:
See original plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fbc2e2e9333fbdd61a744297e36a6752106c1977)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30397: Remove duplicate entry from length menu of patrons search
Jonathan Druart [Thu, 31 Oct 2024 13:41:19 +0000 (14:41 +0100)]
Bug 30397: Remove duplicate entry from length menu of patrons search

If you have 20 in PatronsPerPage, there will be two 20 entries in the
length menu of the patrons search.
jQuery.unique is stupid it seems, it requires the array to be sorted (?)

let x = [1, 2, 1, 2]
jQuery.unique(x);
Array(4) [ 1, 2, 1, 2 ]

x = [1, 1, 2, 2]
jQuery.unique(x);
Array [ 1, 2 ]

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 60249a979cdf14f78c4d0a777a8f9f536272aa29)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 35987: Fix broken See highlighted items below link
Lari Strand [Fri, 13 Sep 2024 10:49:30 +0000 (13:49 +0300)]
Bug 35987: Fix broken See highlighted items below link

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Test plan with KTD:
- Issue a couple of items to a patron, and make sure one of them is
  overdue.
- Make sure "Always show checkouts automatically" is not checked
- Reload the page
- Click on the link in "Overdues: Patron has ITEMS OVERDUE See
  highlighted items below"
- Nothing happens
- Apply the patch, restart_all, reload the "Check out" page for the
  patron
- Click on the link again, and the active loans should be shown

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4716b6a43d2eaa82f966e79ab937badac7da3ec3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 22223: t::lib::QA::TemplateFilters missing built-in TT filter "safe_url" causes...
David Cook [Thu, 7 Nov 2024 01:37:14 +0000 (01:37 +0000)]
Bug 22223: t::lib::QA::TemplateFilters missing built-in TT filter "safe_url" causes false warnings

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 fe495d19dfc138fc99f7c77e41a33c77521cb738)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 22223: Add filter to make item URLs safe in template output
David Cook [Tue, 20 Aug 2024 00:12:21 +0000 (00:12 +0000)]
Bug 22223: Add filter to make item URLs safe in template output

This change adds a "safe_url" filter which takes a text input and
returns a Perl URL object which stringifies to a safe URL.

This change is only needed in the OPAC as the staff interface
handles the item URL display using Javascript not Template Toolkit.

0. Apply patch and koha-plack --restart kohadev
1. Create an item for a record using the following URL
https://koha-community.org?url=https%3A%2F%2Fkoha-community.org
2. Go to the OPAC for that record and verify that the URL is
not double-escaped
3. Create a malicious payload (talk to QA/security team for this if necessary)
4. Note that the malicious payload is escaped
5. prove t/Koha/Plugins/SafeURL.t
6. Celebrate!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.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 e8e00cfeb30391009391849c0194a0ff0603d78c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37872: Consider enable_plugins = 0 when fetching plugin backends
Pedro Amorim [Tue, 29 Oct 2024 11:12:04 +0000 (11:12 +0000)]
Bug 37872: Consider enable_plugins = 0 when fetching plugin backends

This patch builds on top of Andreas patch checking for Koha::Plugins->new() instead as the enable_plugins is already done there.
It also adds a check in reply to Joubu's observation, which is indeed an additional bug.

Test plan:
1) Apply tests patch. Run the tests. Notice it fails
2) Apply the remaining patches. Run the tests. Notice they pass.

Additional (and better) tests can be written, but for now I think this is good enough.
Additional tests should be written on top of bug 36197 (which adds a dummy ILL backend plugin for testing), at:
https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=36197&attachment=171371

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7e336006c27e6747b7c0b92b23eea95be4946e82)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37872: Add guards for enable_plugins
Andreas Jonsson [Mon, 9 Sep 2024 16:51:10 +0000 (16:51 +0000)]
Bug 37872: Add guards for enable_plugins

There are ILL-backends that are not implemented as
Koha plugins and does not require plugins to be enabled.

The 'new' method in Koha::Plugins returns undefined if
plugins are disabled.  Therefore, calls to this method
must be guarded by a check that plugins actually are enabled.

Testplan for koha-testing-docker:

- Edit /etc/koha/sites/kohadev/koha-conf.xml and disable plugins by
  setting <enable_plugins>0</enable_plugins>
- sudo koha-mysql kohadev -e "UPDATE systempreferences SET value='1' WHERE variable='ILLModule';"
- Run restart_all.
- In staff interface, go to About koha -> System information. The page
  should load normally (as opposed to returning 500 internal server
  error).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5ebffcff284d95830f9f054e916aa39a05963baa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37872: Add tests
Pedro Amorim [Tue, 29 Oct 2024 11:12:25 +0000 (11:12 +0000)]
Bug 37872: Add tests

$ prove t/db_dependent/Koha/ILL/Request.t
$ prove t/db_dependent/Koha/ILL/Request/Config.t

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6f3a55d2a36a37510950b1c4c179cabad79af301)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38020: (QA follow-up) Decapitilise 'list'
Aleisha Amohia [Thu, 31 Oct 2024 05:01:42 +0000 (05:01 +0000)]
Bug 38020: (QA follow-up) Decapitilise 'list'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a11a866871d14e120ae9f3db3b39effdefb2a362)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38020: (follow-up) Remove unused delete confirmation code
Yanjun Li [Wed, 30 Oct 2024 16:21:06 +0000 (16:21 +0000)]
Bug 38020: (follow-up) Remove unused delete confirmation code

This follow-up patch removes the unused delete list confirmation dialog in virtualshelves/shelves.tt

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e8b1e2b5b8dfa922ae95c13ab5127b2d45218ae)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38020: Change form to submit link
Yanjun Li [Thu, 24 Oct 2024 20:51:12 +0000 (20:51 +0000)]
Bug 38020: Change form to submit link

To test:

1. Create a list in the staff interface
2. Go to lists
3. View the list
4. Click the Edit dropdown
5. Notice the two dropdown options for Edit list and Delete list have different formatting and look different
6. Apply patch
7. Try steps 1 through 4 again
8. The delete list button form looks right, and delete function works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d3488291f63195ec0291009b7cb0919a5679c279)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38303: Set item's replacement price to defaultreplacecost if 0.00
Jonathan Druart [Wed, 30 Oct 2024 15:37:36 +0000 (16:37 +0100)]
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00

No idea if this is a real bug. This code is fixing the following test
failure:
t/db_dependent/Circulation/CalcFine.t .. 1/7
    #   Failed test 'Amount is calculated correctly'
    #   at t/db_dependent/Circulation/CalcFine.t line 271.
    #          got: '0'
    #     expected: '6'
    # Looks like you failed 1 test of 2.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5776f28efa094e2cdd0dd441ae58be09068cb49a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38297: Add a permissions check to the New vendor button
Matt Blenkinsop [Wed, 30 Oct 2024 11:46:05 +0000 (11:46 +0000)]
Bug 38297: Add a permissions check to the New vendor button

Test plan:
1) Choose a staff patron and make sure they have permissions to log
   into the staff interface
2) Ensure that the patron does not have the vendors_manage permission
   but give them one other acquisitions permission so that they can see
   the link on the homepage (e.g. budget_manage)
3) In an incognito browser, log in with that patron and go to the
   acquisitions homepage
4) The New vendor button will be visible
5) Click on it and fill in the required fields. Submit the form and it
   will error for lack of permissions
6) Apply patch
7) Return to the acquisitions page and the New vendor button should no
   longer be visible
8) Back in your main browser, give the patron the vendors_manage
   permission and then refresh the incognito window - the button should
   be visible

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b11b2b213e611ba759a79f58940d6d8fb8581e71)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38132: Add data-isbn to shelfbrowser
Matt Blenkinsop [Wed, 9 Oct 2024 15:00:33 +0000 (15:00 +0000)]
Bug 38132: Add data-isbn to shelfbrowser

This patch adds a data-isbn attribute to the shelfbrowser_cover container for use in plugins

Test plan
1) View the patch diff and confirm that the attribute has been correctly added

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2cca46e611c4324afbbb06fdc1bfc1e431cb478b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 33188: Remove warning from Koha::Item->hidden_in_opac
Jonathan Druart [Tue, 29 Oct 2024 13:41:19 +0000 (14:41 +0100)]
Bug 33188: Remove warning from Koha::Item->hidden_in_opac

"Use of uninitialized value in string eq"

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied the tests (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f575d4cd73567d5a0e0edc777f83bdf99959a526)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38286: Do not fetch the items if OpacHiddenItemsHidesRecord is set
Jonathan Druart [Tue, 29 Oct 2024 12:52:48 +0000 (13:52 +0100)]
Bug 38286: Do not fetch the items if OpacHiddenItemsHidesRecord is set

Koha::Biblio:hidden_in_opac does not need to fetch the items if OpacHiddenItemsHidesRecord is set

Test plan:
  prove t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Item.t t/db_dependent/api/v1/biblios.t
Should return green

Confirm the assumption above is correct.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit df429e4aba6b94bee7bc07691334475a9817c420)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38266: (bug 21083 follow-up) Increment after comparison
Nick Clemens [Thu, 24 Oct 2024 18:17:54 +0000 (18:17 +0000)]
Bug 38266: (bug 21083 follow-up) Increment after comparison

To test:
 1 - Define a patron attribute as repeatable
 2 - Add multiple values to a patron (I used borrowernumber 5)
 3 - Tools->Batch patron modification
 4 - Modify the patron from step 1, selecting the attribute you created and checking the box to clear
 5 - View the patron, they look correct
 6 - Check the DB:
    SELECT * FROM borrower_attributes WHERE borrowernumber=5;
 7 - There is one blank value
 8 - Apply patch
 9 - Repeat batch modification
10 - Check the DB, no attribute!
11 - Test with multiple attributes in the batch modification and ensure only the correct one is removed
12 - Sign off

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a62953aa9ee8c5ac80e6e5cc6dd5300725b89e5e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38158: Typo in inventory 'Items has no "not for loan" status'
Caroline Cyr La Rose [Fri, 11 Oct 2024 19:56:29 +0000 (15:56 -0400)]
Bug 38158: Typo in inventory 'Items has no "not for loan" status'

This patch corrects a typo in the inventory tool when an inventory
is done against not for loan items and an item has no not for loan
status.

To test:
1. Go to Cataloging > Inventory
2. Enter a barcode for an item that has items.notforloan = 0 in the "Or scan items one by one" text box
3. Check all the boxes EXCEPT "For loan" under "Optional filters for inventory list or comparing barcodes" > "items.notforloan"
4. Click "Submit"
   --> In the "Problems" column, it says "Items has no "not for loan" status"
5. Apply patch
6. Reload the page
   --> In the "Problems" column, "Item" should now be singular

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit baf884600d2d3d1666a13455d2db584f314fd414)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38231: Adjust CSS for search result controls in the OPAC
Owen Leonard [Tue, 22 Oct 2024 17:16:07 +0000 (17:16 +0000)]
Bug 38231: Adjust CSS for search result controls in the OPAC

This patch makes some markup and CSS changes to the OPAC so that
controls are aligned correctly in the "mobile" view's catalog search
results. The patch also removes the border from the controls... I think
the borders looks out of place.

To test apply the patch and rebuild the OPAC CSS.

- Perform a catalog search.
- Check the styling of the controls shown for each search result, e.g.
  Place hold, Add tg, Save to lists, etc.
  - Make sure the controls work well when the browser window is various
    widths, from ~600px and up.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Yanjun Li <yanjun.li@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b8e69361bd8a0021f272636c61b2be51ab10ba01)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37526: DBIC Schema updates
Lucas Gass [Thu, 5 Dec 2024 19:07:20 +0000 (19:07 +0000)]
Bug 37526: DBIC Schema updates

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: DBRev 24.05.05.007
Lucas Gass [Thu, 5 Dec 2024 19:05:46 +0000 (19:05 +0000)]
Bug 37856: DBRev 24.05.05.007

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: Add new test to test platform is correctly added to build_url
Pedro Amorim [Fri, 27 Sep 2024 18:42:58 +0000 (18:42 +0000)]
Bug 37856: Add new test to test platform is correctly added to build_url

prove t/db\_dependent/Koha/ERM/EUsage/UsageDataProvider.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e7dbd2a8b7683e78f9420d0e86e9dc651f067c2e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: Fix existing test
Pedro Amorim [Fri, 27 Sep 2024 18:42:29 +0000 (18:42 +0000)]
Bug 37856: Fix existing test

A service_platform value was being randomly to 'service_platform' as is a new attribute.
Assign undef to that to fix existing test

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b3fb2e85fe5a1e8fd8941da3cfee8a04879cebd3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: (QA follow-up) Tidy
Nick Clemens [Thu, 26 Sep 2024 19:20:15 +0000 (19:20 +0000)]
Bug 37856: (QA follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b7600e480151cc8d8762f6826d1b7da3e697c3f7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: Add tests
Pedro Amorim [Thu, 19 Sep 2024 14:03:40 +0000 (14:03 +0000)]
Bug 37856: Add tests

This is using the groundwork from bug 37963.
This is testing the specific error this bug is addressing:
Required parameter Platform is missing

It is also testing that the error message is correctly shown as a background
job report message to the user

Test plan:
prove t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit edb6056a741f6c326a1745648ebadb1dbea7fc1c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: Consider absence of 'Report_Items'
Pedro Amorim [Thu, 19 Sep 2024 14:00:41 +0000 (14:00 +0000)]
Bug 37856: Consider absence of 'Report_Items'

The SUSHI provider in question for this patchset also does not return any
Report_Items entry. This patch accounts for that.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 72b38a1dbfe12685124b9814dc97807e0d301d3f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: Consider 'Exceptions' not being part of 'Report_Header'
Pedro Amorim [Thu, 19 Sep 2024 13:55:48 +0000 (13:55 +0000)]
Bug 37856: Consider 'Exceptions' not being part of 'Report_Header'

When fixing the issue around the missing platform parameter, we
noticed this particular provider also returns 'Exceptions' as
its own thing, not part of 'Report_Header', despite documentation:
https://countermetrics.stoplight.io/docs/counter-sushi-api/7cp0h7n1hm2en-tr-j1-journal-requests-controlled

From the link above, search for 'Exceptions'. Notice it should be under 'Report_Header'.
Either way, this patch accounts for this possibility.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c175c2160e7ed59c3c67b5a7cd890a4ff0b1306)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: Add service_platform field
Pedro Amorim [Wed, 18 Sep 2024 15:56:19 +0000 (15:56 +0000)]
Bug 37856: Add service_platform field

The change from this patch itself should be self-explanatory.
Testing for this requires credentials to a specific provider.
But the parameter is only added to the URL if defined.

Test plan, ktd, apply patch, run:
$ yarn js:build
$ yarn api:bundle
$ koha-plack --restart kohadev

1) Enable ERMModule
2) Create a new provider, visit:
<staff_url>/cgi-bin/koha/erm/eusage/usage_data_providers/add
3) Ensure 'Service platform' now shows. Create the provider and put something in this field.
4) View the provider, ensure the field is shown, visit:
<staff_url>/cgi-bin/koha/erm/eusage/usage_data_providers/1

Ensure all tests are still passing:
$ cypress run --spec t/cypress/integration/ERM/DataProviders_spec.ts
$ prove t/db_dependent/api/v1/erm_usage_*

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b852c042feff417c745e2166c26f84b22456b14a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: atomicupdate
Pedro Amorim [Wed, 18 Sep 2024 15:57:43 +0000 (15:57 +0000)]
Bug 37856: atomicupdate

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e4b1ca42f7a940e8329ed860dda102deb629db0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37856: Append platform parameter to SUSHI url if defined
Pedro Amorim [Wed, 18 Sep 2024 15:55:51 +0000 (15:55 +0000)]
Bug 37856: Append platform parameter to SUSHI url if defined

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dc9a5684f438d7b676ab52ffd2e4a73179d422eb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37963: (QA follow-up) Tidy
Nick Clemens [Thu, 26 Sep 2024 18:34:35 +0000 (18:34 +0000)]
Bug 37963: (QA follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5b51ef78d4da3703c575bad32a112f0d99cd01c5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37963: Case 2 - Consider providers returning error messages lower cased
Pedro Amorim [Thu, 19 Sep 2024 13:49:10 +0000 (13:49 +0000)]
Bug 37963: Case 2 - Consider providers returning error messages lower cased

Test plan:
1) Apply only test patch for case 1. Run tests:
prove t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t
2) Verify tests fail. Apply the other patch for case 1.
3) Run tests again. Verify they now pass.
4) Repeat the test plan but using patches for case 2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 23ab84c9b6c1a2206d9495c6671d833b14bf5a0f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37963: Case 2 - Add tests for different case error message
Pedro Amorim [Thu, 19 Sep 2024 13:49:58 +0000 (13:49 +0000)]
Bug 37963: Case 2 - Add tests for different case error message

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4c76d2b565610737d9a0ec5a76d44c4cc2e347e0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37963: Case 1 - Return if sushi_errors even if response code >= 400
Pedro Amorim [Thu, 19 Sep 2024 13:39:07 +0000 (13:39 +0000)]
Bug 37963: Case 1 - Return if sushi_errors even if response code >= 400

This ensures that SUSHI errors, if present, are shown on the UI even if
response->code >= 400.
This means that if, for example, SUSHI provider returns 401 with SUSHI
error like so:
{"Code": 2020, "Severity": "Error", "Message": "API Key Invalid"}

Then, the 'API Key Invalid' will be shown to the user, without having to
check logs.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5d53bb4bffa2cc1ee2bcc0a3d84fb74cc672fa97)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37963: Case 1 - Add tests for invalid api key use case
Pedro Amorim [Thu, 19 Sep 2024 13:45:59 +0000 (13:45 +0000)]
Bug 37963: Case 1 - Add tests for invalid api key use case

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 05381ba6b18d50fdc0329dd13a364cdb4e0eca11)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37824: remove references to non-existent files in Makefile.PL
Mason James [Tue, 24 Sep 2024 00:47:26 +0000 (12:47 +1200)]
Bug 37824: remove references to non-existent files in Makefile.PL

to test...

0/ install debhelper tool

1/ run 'DEB_BUILD_OPTIONS=nocheck dh build', observe failure
    make: *** No rule to make target 'koha-tmpl/intranet-tmpl/prog/js/vue/dist/erm.js.LICENSE.txt', needed by 'pm_to_blib'.  Stop.
    dh_auto_build: error: make -j1 returned exit code 2

2/ apply patch

3/ run 'DEB_BUILD_OPTIONS=nocheck dh build', observe success

Signed-off-by: Blou <blou@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c8869aea1c4b3cbfa043a3c5b466cb3b5a3a5c98)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37824: (QA follow-up) Fix improper handling of jQuery and DataTables libraries...
Paul Derscheid [Mon, 16 Sep 2024 16:25:36 +0000 (16:25 +0000)]
Bug 37824: (QA follow-up) Fix improper handling of jQuery and DataTables libraries by marking them as externals

This commit addresses an issue where jQuery and DataTables libraries (datatables.net and related extensions) were not functioning correctly when bundled with rspack. These libraries expect to be loaded in the global scope rather than as bundled modules, leading to initialization issues.

To resolve this, jQuery and all related DataTables libraries (datatables.net, datatables.net-buttons, datatables.net-buttons/js/buttons.html5, etc.) are marked as externals in the rspack configuration. This ensures they are treated as global dependencies, preventing conflicts and allowing proper initialization.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit db4f151be5546e3b3319e248e3d71a8c0ad03558)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37824: (follow-up) Add rspack.config.js to Makefile.PL
Katrin Fischer [Mon, 16 Sep 2024 14:39:29 +0000 (14:39 +0000)]
Bug 37824: (follow-up) Add rspack.config.js to Makefile.PL

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 562a240933d3e5b28ed64f10c5f498afabaaa19e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37824: Replace webpack with rspack for fun and profit
Paul Derscheid [Tue, 3 Sep 2024 15:35:16 +0000 (17:35 +0200)]
Bug 37824: Replace webpack with rspack for fun and profit

I left the webpack.config.js as well as the devDependencies in place for now.
We can remove them in a follow-up patch on this bug after testing it out.

To test:
1) Run js:build and js:build:prod
2) Note the build time
3) Apply patch
4) Run yarn install
5) Run js:build and js:build:prod again
6) Note the much faster build time
7) Extra credit: take a look at the ERM or preservations module and make sure everything works as expected.
8) Extra credit: run the cypress tests.
9) Sign off or give your opinion

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks faster to me. Where webpack failed for me (Killed, error 137), this passed.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 28b6294461c58ea515e0479b7a1f1346795064ed)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37209: (QA follow-up) Add default op value to form
Jan Kissig [Tue, 29 Oct 2024 18:59:13 +0000 (18:59 +0000)]
Bug 37209: (QA follow-up) Add default op value to form

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 10687f7c6e13932c808f5860f1518a7fd61278fc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37209: improve Record overlay rules validation and styling
Jan Kissig [Wed, 3 Jul 2024 12:48:17 +0000 (14:48 +0200)]
Bug 37209: improve Record overlay rules validation and styling

This patch adds jquery form validation to the input named tag. It also changes the behavior for save and edit actions which now both can be triggered by pressing enter. Batch deletion will be only possible if no edit is taking place.

Test plan:
1)
 a) open http://localhost:8081/cgi-bin/koha/admin/marc-overlay-rules.pl
 b) just click + Add rule
 c) the input 'tag' gets highlighted and the form won't submit

2)
 a) edit an existing rule
 b) empty input value for tag
 c) notice the checkboxes for batch deletion on other rules if existing
 d) click Save and check the input 'tag' gets highlighted and the form won't submit

apply patch
1) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required.

2) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required. Also checkboxes for batchremove actions are gone.

Signed-off-by: Olivier Vezina <olivier.vezina@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a7fb0c431e281ce0075ce051c144bf29a5fd043c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37965: (QA follow-up) fix WYSIWYG in sysprefs
David Cook [Tue, 29 Oct 2024 22:45:23 +0000 (22:45 +0000)]
Bug 37965: (QA follow-up) fix WYSIWYG in sysprefs

Test plan:
1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?
op=search&searchfield=UseWYSIWYGinSystemPreferences
2. Enable the system preference to show WYSIWYG in HTML system preferences
3. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?
op=search&searchfield=OPACSearchForTitleIn
4. Add a link for "http://localhost:8081/cool.pl"
5. Note in the source code that the URL gets mangled

6. Apply the patch

7. Repeat the above test plan
8. Note that the URL has NOT been mangled and remains
http://localhost:8081/cool.pl

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a22ae84fb90125976eb0a574c3dde1516e8bdb2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37965: Restore Bug 12032 - TinyMCE rewrites urls in a very annoying and unexpecte...
Lari Taskula [Thu, 19 Sep 2024 17:37:09 +0000 (17:37 +0000)]
Bug 37965: Restore Bug 12032 - TinyMCE rewrites urls in a very annoying and unexpected way

To test:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12032#c3

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7b38dd9a0840a888212c3126257175b85faade1c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38234: Remove unused jszip.min.js file
Jonathan Druart [Wed, 23 Oct 2024 10:12:13 +0000 (12:12 +0200)]
Bug 38234: Remove unused jszip.min.js file

This specific file is not used since Bug 23013 ("Upgrade DataTables in the staff client")

This version is vulnerable and should not be used in the future anyway.

There is a version embedded in our DataTables bundle, which is jszip-3.10.1.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a006258701fb80cbdacdd3b5b8c8a4c5e7451cf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38131: ILS-DI doc must show renewals_count
Fridolin Somers [Wed, 9 Oct 2024 12:35:11 +0000 (14:35 +0200)]
Bug 38131: ILS-DI doc must show renewals_count

Since Bug 30275 renamed issues.renewals to issues.renewals_count, the ILS-DI doc needs to be updated in :
koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt
Note that service 'RenewLoan' returns 'renewals' this has not changed.

Test plan :
1) Enable ILS-DI webservice
2) Go to opac : /cgi-bin/koha/ilsdi.pl
3) Click on 'GetRecords'
4) Check you see 'renewals_count' in 'Example response'
5) Click on 'GetPatronInfo'
6) Check you see 'renewals_count' in 'Example response'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 37bd87c6feb9cc3c5659504c99cf606550640a50)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38233: Add regression tests
Pedro Amorim [Tue, 29 Oct 2024 10:20:04 +0000 (10:20 +0000)]
Bug 38233: Add regression tests

prove t/db_dependent/ILSDI_Services.t

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9ee7673c7ea3e4990c116647d6c077a05e31cc93)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38233: respect OPAC visibility for ILS-DI GetRecords
David Cook [Tue, 22 Oct 2024 23:57:57 +0000 (23:57 +0000)]
Bug 38233: respect OPAC visibility for ILS-DI GetRecords

This change makes the ILS-DI GetRecords service use the OPAC
version of the MARCXML and filters items based on their OPAC visibility

Test plan:
1. Apply the patch
2. koha-plack --restart kohadev
3. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI
and enable syspref
4. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems
and add the following:
withdrawn: [1]
5. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=hidelostitems
Change syspref to "Don't show"
6. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
7. Add a withdrawn item and a lost item with barcodes of "test1" and "test2" respectively
8. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29
9. Note the items with barcodes test1 and test2 do not appear in the "items" tree and they don't
appear in the "marcxml" tree.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 369e5ab93a10cd587be557fcb43de628e49f5dfa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoRevert "Bug 38066: Pop-up window footers can block page content"
Lucas Gass [Thu, 5 Dec 2024 17:07:39 +0000 (17:07 +0000)]
Revert "Bug 38066: Pop-up window footers can block page content"

This reverts commit 4427257af730be11ab3d3f737e46b80fe42dfed7.

2 months agoRevert "Bug 38231: Adjust CSS for search result controls in the OPAC"
Lucas Gass [Thu, 5 Dec 2024 17:05:53 +0000 (17:05 +0000)]
Revert "Bug 38231: Adjust CSS for search result controls in the OPAC"

This reverts commit b8e69361bd8a0021f272636c61b2be51ab10ba01.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38231: Adjust CSS for search result controls in the OPAC
Owen Leonard [Tue, 22 Oct 2024 17:16:07 +0000 (17:16 +0000)]
Bug 38231: Adjust CSS for search result controls in the OPAC

This patch makes some markup and CSS changes to the OPAC so that
controls are aligned correctly in the "mobile" view's catalog search
results. The patch also removes the border from the controls... I think
the borders looks out of place.

To test apply the patch and rebuild the OPAC CSS.

- Perform a catalog search.
- Check the styling of the controls shown for each search result, e.g.
  Place hold, Add tg, Save to lists, etc.
  - Make sure the controls work well when the browser window is various
    widths, from ~600px and up.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Yanjun Li <yanjun.li@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b8e69361bd8a0021f272636c61b2be51ab10ba01)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 37184: Special character encoding problem when importing MARC file from the Acqui...
Hammat Wele [Mon, 26 Aug 2024 21:21:50 +0000 (21:21 +0000)]
Bug 37184: Special character encoding problem when importing MARC file from the Acquisitions module

1. Go to Cataloging > "Stage records for import".
2. Upload the file "ExportMemento2024061010532869Marc8.mrc" or a MARC8 encoded file.
3. In the form, select the options :
   - Record type: Bibliographic
   - Character encoding: MARC8
   - Format: MARC
4. Click "Stage for import".
5. Find or create an open basket in the Acquisitions module.
6. Click "add to basket".
7. Select "From a staged file" and select the previous staged file.
9. Click "Select all" to check all records.
10. In the item information tab, choose the Document type.
11. Verify the titles of the records in the basket:
 --> Koha replaces accents with symbols �

12. Apply the patch.
13. Do the same from step 1 and notice there is no more encoding issues.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e8c8b68672af08b446d1b2d9f8fae76cac22f9ef)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: deleted_biblio_id can be null
Jonathan Druart [Tue, 29 Oct 2024 10:34:14 +0000 (11:34 +0100)]
Bug 30648: deleted_biblio_id can be null

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 63c3b6833821c8dd955e371ee4f54b49efe936ec)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 38066: Pop-up window footers can block page content
Owen Leonard [Mon, 21 Oct 2024 18:19:07 +0000 (18:19 +0000)]
Bug 38066: Pop-up window footers can block page content

The staff interface's default <body> padding is enough to accommmodate
the langugage-selection footer but not the taller fixed footer on pop-up
window pages. This patch adds some CSS to increase the padding on those
pages to prevent page content from being obscured by the footer
navigation.

The patch also adjusts the CSS of the "Back to top" arrow so that it
isn't hidden by fixed footer.

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

- In the staff client, go to Cataloging -> New record.
- In tab one, click the plugin button on tag 100 subfield a.
- Perform an authority search which will return results.
- Scroll down to the bottom of the window and confirm that the last
  lines of the search results are not obscured by the footer.

This change should apply to all pop-up windows which include the same
fixed footer markup, e.g. any cataloging plugin; the transfer order
window; vendor search when adding a subscription, etc.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b09f3a88205b007a21107747aeaf816462abbaa5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: (QA follow-up) Terminology: reserve => hold
Katrin Fischer [Mon, 28 Oct 2024 18:56:08 +0000 (18:56 +0000)]
Bug 30648: (QA follow-up) Terminology: reserve => hold

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c2ec5798b9f1062b15433554c33e9089460c2cf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: DBIC Schema updates
Lucas Gass [Thu, 5 Dec 2024 16:46:55 +0000 (16:46 +0000)]
Bug 30648: DBIC Schema updates

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: DBRev 24.05.05.006
Lucas Gass [Thu, 5 Dec 2024 16:44:51 +0000 (16:44 +0000)]
Bug 30648: DBRev 24.05.05.006

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: Tidy
Nick Clemens [Fri, 11 Oct 2024 13:11:10 +0000 (13:11 +0000)]
Bug 30648: Tidy

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e5b86bb23a2941ebf9dce50accfd214f7c610058)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: Add new field to REST API
Nick Clemens [Fri, 11 Oct 2024 12:51:52 +0000 (12:51 +0000)]
Bug 30648: Add new field to REST API

Maybe we just undef it since ti will always be null except for old_hold obecjts
and we don't have that route yet

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a7ead95c146106781a5e62807bb713fb7ba59b26)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: Unit tests
Nick Clemens [Fri, 11 Oct 2024 12:49:23 +0000 (12:49 +0000)]
Bug 30648: Unit tests

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 69c2abf14bb64fd0a925b01087227b772b7942b4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: Record deleted_biblionumber in holds
Nick Clemens [Fri, 11 Oct 2024 12:28:48 +0000 (12:28 +0000)]
Bug 30648: Record deleted_biblionumber in holds

This patch ensures the deleted biblionumber is recorded in current and previous holds
before the record is deleted

To test:
1 - Place and fill a few holds on a biblio, completing checkout to patron
2 - Place a few holds on the biblio and do not fulfill them
3 - Delete the items from the biblio via the DB (otherwise you cannot delete last item when there are holds)
    DELETE FROM items WHERE biblionumber={biblionumber}
4 - Delete the biblio
5 - Check the DB and confirm the deleted_biblionumber column has been filled
    SELECT reserve_id,deleted_biblionumber,biblionumber FROM old_reserves WHERE deleted_biblionumber = {biblionumber};
6 - Sign off!

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7cf1280beec7c9e20e10ed972123790986864420)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoBug 30648: Add deleted_biblionumber column for reserves
Nick Clemens [Fri, 11 Oct 2024 12:05:11 +0000 (12:05 +0000)]
Bug 30648: Add deleted_biblionumber column for reserves

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e289a8711147b82391ad24598f82080f0ce621b2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoRevert "Bug 37870: Fix sort order of class sources"
Lucas Gass [Thu, 5 Dec 2024 16:33:22 +0000 (16:33 +0000)]
Revert "Bug 37870: Fix sort order of class sources"

This reverts commit 6cbe190092290918f6164df610210762773f4555.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoRevert "Bug 37870: Remove warning if biblionumber is not passed"
Lucas Gass [Thu, 5 Dec 2024 16:33:14 +0000 (16:33 +0000)]
Revert "Bug 37870: Remove warning if biblionumber is not passed"

This reverts commit 1946bdde6e0cfd507b9fe3c0390051f5cbed03e7.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoRevert "Bug 37593: Removed all instances of 'this this' in the codebase"
Lucas Gass [Thu, 5 Dec 2024 16:20:02 +0000 (16:20 +0000)]
Revert "Bug 37593: Removed all instances of 'this this' in the codebase"

This reverts commit 8297471b3b41e00d19134453ba5721ad3f85877b.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 months agoRevert "Bug 38066: Pop-up window footers can block page content"
Lucas Gass [Wed, 4 Dec 2024 22:41:27 +0000 (22:41 +0000)]
Revert "Bug 38066: Pop-up window footers can block page content"

This reverts commit f10bd3db289f369853bc367374fb7a01c7fd4dcd.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38275: Fix patron card creator image delete
David Cook [Sun, 27 Oct 2024 23:19:45 +0000 (23:19 +0000)]
Bug 38275: Fix patron card creator image delete

This change changes the patron card creator image delete from a
GET to a POST, and supports single delete and multi-delete.

Test plan:
1. Apply the patch (and refresh browser JS cache)
2. Go to http://localhost:8081/cgi-bin/koha/patroncards/image-manage.pl
3. Upload multiple images
4. Select all the images using the checkboxes
5. Delete one image using the "Delete" button in the row
6. Note that only the image selected using the "Delete" button is
deleted and the other images are de-selected
7. Delete multiple images using the "Delete selected" button
8. Note that the correct images are noted in the confirm message,
and the correct images are deleted

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f4a25897b0ecbfd883115f3c79c8bdd44e3eb0f0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38274: DBRev 24.05.05.005
Lucas Gass [Fri, 22 Nov 2024 21:32:57 +0000 (21:32 +0000)]
Bug 38274: DBRev 24.05.05.005

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38274: Fix typo in arabic language description
Fridolin Somers [Fri, 25 Oct 2024 14:25:10 +0000 (16:25 +0200)]
Bug 38274: Fix typo in arabic language description

In installer/data/mysql/mandatory/subtag_registry.sql we see a missing
char in arabic language description.

Wee see this was correct before Bug 12250 :
&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;

Test plan :
1) Install a fresh Koha with this patch
2) Look in database :
   SELECT * FROM language_descriptions WHERE subtag='ar' AND type='language' AND lang='ar'
=> Check description is correct
3) On a old existing Koha
4) Install patch and run update database
=> Look in database and check description is correct

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4e1dc5e8b79bcca755610ca9628bd9dc5ae8defd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38271: (QA follow-up) Fix testcritic
Matt Blenkinsop [Mon, 28 Oct 2024 09:35:04 +0000 (09:35 +0000)]
Bug 38271: (QA follow-up) Fix testcritic

testcritic was failing due to a 'return undef' so this commit amends that

Test plan:
1) prove t/00-testcritic.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 640ce0bc6bff99845d019500fa0a69db35545a2a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38271: (QA follow-up) Tidy code
Kyle M Hall [Fri, 25 Oct 2024 13:06:11 +0000 (09:06 -0400)]
Bug 38271: (QA follow-up) Tidy code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f68688b5810836dede3625c65f6a71e5520989b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38271: Handle missing 008 fields in EDI
Matt Blenkinsop [Fri, 25 Oct 2024 11:19:24 +0000 (11:19 +0000)]
Bug 38271: Handle missing 008 fields in EDI

This patch adds handling to create a default 008 field on MARC records that are missing one when created through EDI.

Test plan:
1) prove t/db_dependent/Koha/EDI.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b00fb3d55755220557127100ccd6d348792f0dfa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38251: Make 'Remove selected items' button work when there is one item
Phil Ringnalda [Thu, 24 Oct 2024 21:16:45 +0000 (14:16 -0700)]
Bug 38251: Make 'Remove selected items' button work when there is one item

There are two ways to remove items from a list: you can remove a single item
by clicking a 'Remove from this list' button below the item, or you can
remove one or more items by checking the checkboxes for them and clicking the
'Remove selected items' button.

Bug 37150 needed to fix 'Remove from this list' for CSRF, because in the wild
old days it just triggered a GET to delete, and instead it needed to POST.
The first patch to do that defined the JS var single_bib, checked the
checkbox for that bib and submitted the form, as though you had used the
checkbox yourself. But if you cancelled the confirmation prompt, it would
need to uncheck the checkbox it checked, so it added a function to do that
if (single_bib). That patch didn't land.

What landed instead was a patch with a separate hidden form that could be
populated with the single biblionumber from 'Remove from this list', but
without single_bib to define that state, it used selected_titles.size() == 1
as the condition to use the hidden form, forgetting that when the user checks
a single checkbox, selected_titles.size() is also 1. The right condition is
the same one used to tell where to get the titles for the confirmation dialog:
if the click event passed along a biblionumber, it's 'Remove from this list.'
Since checking that sets var biblionumber, we can just use that being truthy
as the condition.

Test plan:
 1. Without the patch, open the OPAC and log in
 2. Add any two biblios to a new list
 3. Lists - {your list name}
 4. Click the checkbox for one of the items, click 'Remove selected items'
    and click 'Yes, remove from list' in the confirmation dialog
 5. Note that it wasn't removed
 6. Click the checkboxes for both items, click 'Remove selected items' and
    click 'Yes, remove from list' in the confirmation dialog
 7. Note that both were removed
 8. Apply patch, restart_all
 9. Add any four items to your list
10. Lists - {your list name}
11. For the first item, click the 'Remove from this list' button below the
    details for the item, confirm, make sure it was deleted
12. Click the checkbox for what's now the first item, click 'Remove from
    this list,' confirm, make sure it was deleted
13. Click the checkboxes for what are now the first two items, click 'Remove
    from this list,' confirm, make sure both were deleted

Sponsored-by: Chetco Community Public Library
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f82d8dae0f871aaa8adfd5bcdb9cda1aa9efdacd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38188: fix populating the borrowenumberlist from patron_search_selections
Johanna Räisä [Thu, 17 Oct 2024 06:15:32 +0000 (09:15 +0300)]
Bug 38188: fix populating the borrowenumberlist from patron_search_selections

This patch fixes the issue of populating the borrowernumberlist from patron_search_selections.
Adding borrowernumbers to the textarea randomly fails because the textarea is populated with the html() function.

To test:
1) Go to the patron search
2) Select a few patrons
3) Click on the "Batch patron modification" button
4) Use browsers back button to go back to the patron search
5) Find patron_batchmod_form from browser inspector, open it.
6) Check that between the <textarea> tags, there are the borrowernumbers of the selected patrons.
7) Apply the patch
8) Repeat steps 1-6
9) Check that <textarea> tags are not populated with the borrowernumbers of the selected patrons.
10) Remove the display:none from the textarea and check that the borrowernumbers are populated there.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Michelle Spinney <mspinney@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f44a0adb5dc4ccdff4f5435dda1cce51b7a393a5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38138: (bug 33398 follow-up) Don't display code for primary contact method
Jonathan Druart [Wed, 16 Oct 2024 08:28:47 +0000 (10:28 +0200)]
Bug 38138: (bug 33398 follow-up) Don't display code for primary contact method

We have several choices for "primary_contact_method", we don't want to
display the code but the label
phone => Primary phone
phonepro => Secondary phone
mobile => Other phone
email => Primary email
emailpro => Secondary email
fax => Fax

Bonus: it will make it translatable.

Test plan:
1. Edit a patron record to add a Main contact method
2. Place a hold for this patron
3. Check the item in
   --> Pop up says "Main contact method:" followed by the choice.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 49e09672b53b024882cc0c363d39b399ef1859d9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38128: Fix cypress test
Jonathan Druart [Thu, 7 Nov 2024 10:58:40 +0000 (11:58 +0100)]
Bug 38128: Fix cypress test

We were mocking the wrong route.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 89b22cc278b1cc65bf4d3c473c9e5a9fcdce5ac0)

3 months agoBug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission
Jonathan Druart [Wed, 9 Oct 2024 07:29:47 +0000 (09:29 +0200)]
Bug 38128: (Bug 35329 follow-up) Filter ERM users to users with erm permission

There was a silly mistake, we passed the TT var erm_users instead of the
string "erm_users".
It should also be passed to patron_search_modal to display the note.

Test plan:
Confirm that with this patch a patron search in the ERM module returns
only patrons with the erm permission.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0627c092c2aea76fd03f784185d17e93f4f1ba41)

3 months agoBug 38066: Pop-up window footers can block page content
Owen Leonard [Mon, 21 Oct 2024 18:19:07 +0000 (18:19 +0000)]
Bug 38066: Pop-up window footers can block page content

The staff interface's default <body> padding is enough to accommmodate
the langugage-selection footer but not the taller fixed footer on pop-up
window pages. This patch adds some CSS to increase the padding on those
pages to prevent page content from being obscured by the footer
navigation.

The patch also adjusts the CSS of the "Back to top" arrow so that it
isn't hidden by fixed footer.

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

- In the staff client, go to Cataloging -> New record.
- In tab one, click the plugin button on tag 100 subfield a.
- Perform an authority search which will return results.
- Scroll down to the bottom of the window and confirm that the last
  lines of the search results are not obscured by the footer.

This change should apply to all pop-up windows which include the same
fixed footer markup, e.g. any cataloging plugin; the transfer order
window; vendor search when adding a subscription, etc.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b09f3a88205b007a21107747aeaf816462abbaa5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38041: Pass hide_main for all needsconfirm warnings in SCO
Lucas Gass [Mon, 30 Sep 2024 19:54:30 +0000 (19:54 +0000)]
Bug 38041: Pass hide_main for all needsconfirm warnings in SCO

To test:
1. APPLY PATCH and restart_all
2. Make sure the following errors when issuing in SCO show just the error, no other info. on screen:
DEBT
RENEW_ISSUE
ISSUED_TO_ANOTHER
RESERVED
TRANSFERRED
INVALID_DATE ( cant test in SCO )
TOO_MANY
RECALLED

Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f606e90deb76fe436470fc7dcee25d700322ab54)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 37582: Add unit test
Kyle M Hall [Wed, 30 Oct 2024 11:53:35 +0000 (11:53 +0000)]
Bug 37582: Add unit test

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4d1b0303ffdb58f3e4c59ea53cbd55ac3a74ae79)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 37582: Tidy write_msg
Kyle M Hall [Tue, 17 Sep 2024 18:52:22 +0000 (14:52 -0400)]
Bug 37582: Tidy write_msg

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 768a5d197c5d020c5d30fc219272524add02f2ac)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 37582: Add ability to for SIP to convert control and separator characters to...
Kyle M Hall [Tue, 17 Sep 2024 18:28:11 +0000 (18:28 +0000)]
Bug 37582: Add ability to for SIP to convert control and separator characters to spaces

This came up with a SIP vendor recently - when reading responses they were only getting part of a patron's information.
It seemed to have been caused by patrons with multiple restrictions and a new line in the response

This patch also does minor refactoring to write_msg to pass the server variable that contains
all the previously passed parameters, and removes the never used "file" parameter.

Test Plan:
1) Add multiple debarments to a patron
2) Run a sip patron information response, note the presence of newlines
3) Apply this patch
4) Add the new option convert_control_characters to your SIP account,
   set the value to " -- "
5) Restart all the things!
7) Run a sip patron information response, note the newlines have been replaced!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a20ac7f99dc636ca598163f6ca675e09d736339)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 36317: Koha::Biblio->host_items must use me.itemnumber
Fridolin Somers [Thu, 14 Mar 2024 10:24:54 +0000 (11:24 +0100)]
Bug 36317: Koha::Biblio->host_items must use me.itemnumber

Koha::Biblio->host_items fails with search_ordered() because of ambiguous column 'itemnumber' in where clause.
It must use me.itemnumber like in Koha::Biblio->items

Test plan :
prove t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a9964bc8a9f89d8da00e5056ceb3f06cf551ce72)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 36317: Add unit test
Fridolin Somers [Mon, 18 Mar 2024 14:18:27 +0000 (15:18 +0100)]
Bug 36317: Add unit test

If fails it shows :
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'itemnumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 399

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d193455ec20e75721179c80c9d00c6163d2aef24)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38030: (QA follow-up) Move csrf_token to POST body from URL
David Cook [Tue, 22 Oct 2024 00:42:22 +0000 (00:42 +0000)]
Bug 38030: (QA follow-up) Move csrf_token to POST body from URL

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit aec1ad5bab8919cdee097ff2d7a52f85d661e905)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 months agoBug 38030: stocknumberAV.pl fails with CSRF protection
Janusz Kaczmarek [Mon, 30 Sep 2024 09:22:03 +0000 (09:22 +0000)]
Bug 38030: stocknumberAV.pl fails with CSRF protection

The value builder stocknumberAV.pl does not work after applying the CSRF
protection. In console, it generates entries like:

POST
http://localhost:8081/cgi-bin/koha/cataloguing/plugin_launcher.pl
[HTTP/1.1 403 Forbidden 188ms]

Test plan:
==========
1. Modify the MARC bibliographic framework for the default framework by
   choosing stocknumberAV.pl as plugin for subfield 952 $i.
2. In Authorized values, add a new category 'INVENTORY'.  Add a new
   entry there, e.g. 'ABC', with any number in Description (eg. 123).
3. Find any bibliographic record, make sure it uses the default framework.
   If not set the framework accordingly.
4. Edit an item linked to this record.  Go to the 'i - Inventory number'
   subfield.  You should see three dots on the right.  In the input field
   put ABC and click the three dots.
5. Nothing happens.  You can check in the browser console--there should
   be a message like:
   POST http://FQDN:8081/cgi-bin/koha/cataloguing/plugin_launcher.pl
   [HTTP/1.1 403 Forbidden 188ms]
6. Apply the patch; restart_all.  Refresh the browser window.
7. Repeat p. 4.  You should now get the next sequence number next to
   the 'ABC' (i.e. ABC 0000000124 or similar).

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bba164856c1c4dfd1ec8e346c9b9d32955fdcad9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>