koha.git
3 weeks agoBug 36511: Some scripts missing a dependency following Bug 24879 23.05.x v23.05.10-02
Owen Leonard [Tue, 9 Apr 2024 15:55:57 +0000 (15:55 +0000)]
Bug 36511: Some scripts missing a dependency following Bug 24879

These files needed the addition of 'use C4::Auth qw( check_cookie_auth
);'.

To test, apply the patch and restart services.

- If necessary, enable the LocalCoverImages system preference.
- Open the browser console and then the "Network" tab. You can click
  "Images" to filter for the correct kind of request.
- Perform a catalog search. After the search has loaded, check that
  there are no 500 errors in the Network tab.

- Go to Cataloging -> Label creator.
- If necessary, create a label batch and add some items.
- Export your batch and test both the "Download as CSV" and "Download as
  XML" links. Both should trigger the correct download.

- Go to Serials -> Claims, and select a vendor with late issues.
- Select all late issues and click "Download selected claims" at the
  bottom of the page.
- Your CSV file should download correctly.

The file acqui/check_uniqueness.pl has been corrected as well but I'm
not sure how to test it!

Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz>
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 747f5132311ea51ea6babbfc92a775ac0c67f93a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 01b22fb71d30f56d3102837b5c9b4cfdacbc9e76)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoUpdate release notes for the 23.05.10 release v23.05.10
Lucas Gass [Wed, 27 Mar 2024 16:38:47 +0000 (16:38 +0000)]
Update release notes for the 23.05.10 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoIncrement version for the 23.05.10 release
Lucas Gass [Wed, 27 Mar 2024 15:50:29 +0000 (15:50 +0000)]
Increment version for the 23.05.10 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: (Rmaint follow-up) Fix text suite
Lucas Gass [Wed, 27 Mar 2024 13:52:50 +0000 (13:52 +0000)]
Bug 24879: (Rmaint follow-up) Fix text suite

6 weeks agoBug 36176: Exclude misc/releases_notes/*
Lucas Gass [Tue, 26 Mar 2024 20:32:15 +0000 (20:32 +0000)]
Bug 36176: Exclude misc/releases_notes/*

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: (follow-up) Fix test suite
Fridolin Somers [Wed, 27 Mar 2024 09:20:03 +0000 (10:20 +0100)]
Bug 24879: (follow-up) Fix test suite

Running cataloguing pluings (in cataloguing/value_builder) now requires
authentification.

This patch adds in failing unit tests a mock of C4::Auth::check_cookie_auth

Test with:
prove t/db_dependent/FrameworkPlugin.t t/db_dependent/Koha/UI/Form/Builder/Biblio.t t/db_dependent/Koha/UI/Form/Builder/Item.t t/db_dependent/Serials.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
6 weeks ago(Rmaint follow-up) Fix bad tests in t/db_dependent/Serials.t
Lucas Gass [Tue, 26 Mar 2024 20:05:14 +0000 (20:05 +0000)]
(Rmaint follow-up) Fix bad tests in t/db_dependent/Serials.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36323: Move koha_perl_deps.pl to misc/devel
Fridolin Somers [Mon, 18 Mar 2024 15:32:57 +0000 (16:32 +0100)]
Bug 36323: Move koha_perl_deps.pl to misc/devel

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: Exclude koha_perl_deps.pl
Jonathan Druart [Fri, 15 Mar 2024 09:19:16 +0000 (10:19 +0100)]
Bug 24879: Exclude koha_perl_deps.pl

And tidy.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: Use perl shebang to list the exec
Jonathan Druart [Thu, 14 Mar 2024 15:53:35 +0000 (16:53 +0100)]
Bug 24879: Use perl shebang to list the exec

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: Add check_cookie_auth when missing
Jonathan Druart [Thu, 14 Mar 2024 15:19:06 +0000 (16:19 +0100)]
Bug 24879: Add check_cookie_auth when missing

This can certainly be improved to adjust the permissions, but at least
they are no longer opened to the world..

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: Adjust tests
Jonathan Druart [Thu, 14 Mar 2024 15:17:55 +0000 (16:17 +0100)]
Bug 24879: Adjust tests

Installer scripts cannot be run from the UI:
debian/templates/apache-shared-intranet.conf:RewriteRule ^/cgi-bin/koha/(C4|debian|etc|installer/data|install_misc|Koha|misc|selenium|t|test|tmp|xt)/|\.PL$ /notfound [PT]

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: Remove installer/externalmodules.pl
Jonathan Druart [Thu, 14 Mar 2024 15:14:17 +0000 (16:14 +0100)]
Bug 24879: Remove installer/externalmodules.pl

It is not used, if we need it back it must be moved to misc.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 24879: Add new test to catch missing auth statement
Jonathan Druart [Tue, 17 Mar 2020 10:54:12 +0000 (11:54 +0100)]
Bug 24879: Add new test to catch missing auth statement

in intranet scripts

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36322: Redirect docs dir to 404
Jonathan Druart [Thu, 14 Mar 2024 15:42:08 +0000 (16:42 +0100)]
Bug 36322: Redirect docs dir to 404

http://localhost:8081/cgi-bin/koha/docs/CAS/CASProxy/examples/proxy_cas.pl

Test plan:
Hit the link
=> Erk
Copy the apache config to /etc/koha/apache-shared-intranet-git.conf
restart_all
Hit the link
=> 404

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 31988: Remove reports/itemtypes.plugin
Jonathan Druart [Fri, 15 Mar 2024 09:12:41 +0000 (10:12 +0100)]
Bug 31988: Remove reports/itemtypes.plugin

This "plugin system" is only used for the itemtypes report. We can
simply remove the reports/manager.pl script and this plugin in favor of
a dedicated report.

Test plan:
Same behaviour expected before and after this patch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36244: DBRev 23.05.09.001 part 2
Lucas Gass [Tue, 26 Mar 2024 15:45:52 +0000 (15:45 +0000)]
Bug 36244: DBRev 23.05.09.001 part 2

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36244: DBRev 23.05.09.001
Lucas Gass [Tue, 26 Mar 2024 15:43:35 +0000 (15:43 +0000)]
Bug 36244: DBRev 23.05.09.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36244: Add atomic update to check for affected notices
Kyle M Hall [Thu, 7 Mar 2024 16:10:35 +0000 (11:10 -0500)]
Bug 36244: Add atomic update to check for affected notices

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Fixed some typos in bug numbers and text.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36244: Do template toolkit processing first
Andreas Jonsson [Thu, 7 Mar 2024 09:12:25 +0000 (09:12 +0000)]
Bug 36244: Do template toolkit processing first

To avoid injection of template toolkit code
from database fields that are controlled by
untrusted sources.

Test plan:

* review subtest 'Template toolkit syntax in
  parameters' in t/db_dependent/Letters.t
* Run the unit test:
  prove t/db_dependent/Letters.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 36244: Unit test for tt syntax in parameters
Andreas Jonsson [Thu, 7 Mar 2024 09:07:49 +0000 (09:07 +0000)]
Bug 36244: Unit test for tt syntax in parameters

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 35960: Use .val() instead of string concat to prevent potential XSS
Julian Maurice [Thu, 1 Feb 2024 08:15:23 +0000 (09:15 +0100)]
Bug 35960: Use .val() instead of string concat to prevent potential XSS

Test plan:
1. Log out
2. Go to /cgi-bin/koha/mainpage.pl#somestring"with<html>char
3. Open the brower's inspector and find "auth_forwarded_hash" input
4. Make sure the value attribute is there and corresponds to the URL's
   fragment. It should be URI-encoded.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
6 weeks agoBug 34755: (Rmaint follow-up) Fix tests
Lucas Gass [Thu, 21 Mar 2024 13:42:03 +0000 (13:42 +0000)]
Bug 34755: (Rmaint follow-up) Fix tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35800: Remove item.can.be.edited check
Lucas Gass [Tue, 23 Jan 2024 17:53:39 +0000 (17:53 +0000)]
Bug 35800: Remove item.can.be.edited check

To test:
APPLY PATCH
1. Check out an item to a patron from library A
2. Give permissions to a patron from library B
   (example of a circulation staff account)
     - circulate
     - catalogue
     - borrowers ( including view_borrower_infos_from_any_libraries )
     - reserveforothers
     - updatecharges
     - suggestions
     - lists
     - clubs -> enroll
3. If necessary, change the username and password of that staff member in order to be able to log in
4. In a private browser window, log in as the staff member
5. View the record with the checked out item
6. You should see the name/cardnumber of the patron the item is checked out ot.
7. Turn off the view_borrower_infos_from_any_libraries for this patron.
8. Now on the record detail page you should see text like `Checked out to A patron from library Midway : due 01/28/2024`.

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: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e8c0438d87468d7a5638a3463817aff5c9d75e85)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4c38b7140aa7b33d170ee84be17c890b811b6ca1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 29522: Unit test
Nick Clemens [Fri, 26 Jan 2024 13:15:12 +0000 (13:15 +0000)]
Bug 29522: Unit test

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3954808ac5052a53d5fa40502a4f7bd991be80ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 284ff2d52c1afb481cd918221f5bdd2de9f861e9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 29522: [alternate] Skip relinking bibliographic records when merging authorities
Nick Clemens [Wed, 6 Sep 2023 15:48:12 +0000 (15:48 +0000)]
Bug 29522: [alternate] Skip relinking bibliographic records when merging authorities

If autolinking is enabled, there are scenarios where the authorities merge process
updates the record, then sends it to ModBiblio which then AutoLinks the record, undoing
the changes in the record (as the 'from' authority is not removed until the process is complete)

This patch simply disables the autolinking process when merging authorities

To test:

Set system preferences
    AutoCreateAuthorities = don't generate
    RequireChoosingExistingAuthority = don't require
    AutoLinkBiblios = Do
    CatalogModuleRelink = Do
    LinkerKeepStale = Don't
    LinkerModule = first match
    LinkerRelink = Do

1. Create an authority record
   1.1. Go to Authorities
   1.2. Click on "New authority" and choose an authority type (I chose Corporate name)*
   1.3. Fill in the mandatory fields (000, 003, 005, 008, 040)
   1.4. In tab 1, click on the label of the main heading (110 for Corporate name)
   1.5. Fill in subfield
   1.6. Copy content of subfield
   1.7. Click on "Save"
   1.8. Note the authority record number

2. Duplicate the authority record
   2.1. Click on "Edit" and choose "Edit as new (duplicate)"
   2.2. Click on "Save"
   2.3. Click on "No: Save as new authority"
   2.4. Note the authority record number (should be the number from step 1.8 +1)

3. Link one of the authority records to a bibliographic record
   3.1 In another tab, do a catalog search
   3.2. Click on "Edit record" under one of the search results
   3.3. Go to the relevant tab (for corporate name, I used field 710 in tab 7)
        3.3.a. If there are no empty fields for that tag, click the "Repeat this tag" button (two rectangles)
   3.4. Paste the text previously copied in subfield
   3.5. Click on "Link authorities automatically" at the top of the page
   3.6. Note the authority record number in subfield
        --> The linked authority record should be the first authority record (step 1.8)
   3.7. Click on "Save"

4. Merge the two authority records, keep the one that is not linked to the bibliographic record
   4.1. Go back to the tab with the authorities
   4.1. Go to Authorities
   4.2. Search for the aurhorities previous created
   4.2. Click on "Actions" and choose "Merge" for both records
   4.3. Select the record number that is NOT linked to the bibliographic record
   4.4. Click on "Next"
   4.5. Click on "Merge"

5. Check the bibliographic record
   5.1. Go back to the tab with the bibliographic record and refresh the page (Ctrl+F5)
   5.2. Hover the mouse cursor over the name or term, without clicking
   5.3. Note the record number that appears at the bottom of the screen
        --> The record number was not changed
6. Apply the patch
    6.1. Run prove t/AuthoritiesMarc_MARC21.t
    6.2. Repeat Previous steps 1, 2, 3, 4, 5
        --> The record number is change

Signed-off-by: Barbara Petritsch <barbara.petritsch@wienmuseum.at>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1b9371beb33dae4b661768609dca9930a91bfb56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 10661f70ff3462ffac73afa6a6aa44d1d0a8f123)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36277: Avoid useless warnings
Tomas Cohen Arazi [Fri, 15 Mar 2024 12:05:55 +0000 (09:05 -0300)]
Bug 36277: Avoid useless warnings

As mentioned on bug 36329, this endpoint is only used with one of this
parameters:

* item_type
* collection_code

The other will be NULL both on the DB and the (deserialized) request
body. For the data from the DB, the author added `|| q{}` but missed to
do so on the incoming parameters when generates the hash key.

This generates the following warnings when using from the UI:

[2024/03/15 11:42:51] [WARN] Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/REST/V1/TransferLimits.pm line 146.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 03b0f31b9e63ce314c333ac6ffd68587a609e587)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa2e164f240a9e040c0e044c39dac6c613cb7b27)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36277: Improve algorithmic complexity of batch_add
Jonathan Druart [Thu, 14 Mar 2024 13:39:56 +0000 (14:39 +0100)]
Bug 36277: Improve algorithmic complexity of batch_add

The 2 nested loops are terrible in term of algorithmic complexity.
Especially if we are fetching from there.

The goal of this patch is to fetch all the limits outside of the loop.

If you have 100 libraries, it will remove 100^2 - 1 fetches!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 202628342ab9397e8b15aa5e62c0aaa041d3c8a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 372adf555d579c290355ff33f891cd205dc0bfac)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36277: Do not fetch the whole library list
Jonathan Druart [Thu, 14 Mar 2024 13:06:28 +0000 (14:06 +0100)]
Bug 36277: Do not fetch the whole library list

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 14388b6478858e298a9f0de104d5e839bc8cb430)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4c56374272bb458ee0497f9efd42c3db54723fcf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35934: Correct missed case of switching items.transfer to transfer in detail.tt
Emily Lamancusa [Mon, 29 Jan 2024 20:25:19 +0000 (15:25 -0500)]
Bug 35934: Correct missed case of switching items.transfer to transfer in detail.tt

To test:
1. Put an item with no holds/recalls in transit (manually or by checking
  it in at a branch other than its homebranch to trigger a ReturnToHome)
2. Go to the item's bib record
--> Note that the item's status will display as something like,
    "In transit from X to Y since 01/29/2024 Available"
3. Apply patch and refresh the page
--> Note that item now shows only the transit status, but not "Available"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 687963b016bb9e3f74abebc64c830e53ab4d1e50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f726c7ebfe0102ffaad49ffd73297971cb1a5248)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36224: Remove unused spsuggest from templates
Lucas Gass [Tue, 5 Mar 2024 16:00:39 +0000 (16:00 +0000)]
Bug 36224: Remove unused spsuggest from templates

To test:
-APPLY PATCH
-Review the OPAC results and staff interface results pages.
-Nothing should change, it would be impossible to end up inside of the [% IF koha_spsuggest %] condition because there is nothing like that in the scripts!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e07c6d072977b9e52dc2153fd36f03601e161c1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e0bab0bb927d20b60679ebf1606859d78495d04)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36292: Fixed 'See all charges' hyperlink for guarantees/guarantor linked charges
Laura Escamilla [Mon, 11 Mar 2024 14:43:26 +0000 (14:43 +0000)]
Bug 36292: Fixed 'See all charges' hyperlink for guarantees/guarantor linked charges

To test:
1. Add a guarantee / guarantor relationship for two patrons.
2. Add a manual fee to the guarantees' account.
3. Go to the guarantor's account and view the 'Details' tab. Under contact information there should be a Guarantees section. There you will see the charges for your guarantee. Click on ‘See all charges’. The link leads you no where.
4. Apply the patch and restart_all
5. Refresh the guarantor’s page and click on ‘See all charges’ again. This time it will take you down to the ‘Guarantees’ Charges’ panel.
6. Sign off and have a great day! :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e2d54b1279b65507596ca3a08d6b44d1b15fe2b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c8d97a97a10983f44b697bbb4c03e4707999388d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36298: In patrons search fix road type with authorized value
Fridolin Somers [Tue, 12 Mar 2024 10:18:18 +0000 (11:18 +0100)]
Bug 36298: In patrons search fix road type with authorized value

In new patrons search via API, the road type code is displayed in patron address instead of authorized value description.

Also road type is missing a space separator in DE and FR format.

Test plan :
1) Create two entries in authorized value category "ROADTYPE" :
   R1 "Road"
   R2 "Street"
2) Edit a patron (ie Delgado, Floyd) to set road type to "Road"
3) Perform a search on patrons (click on letter D)
4) Check you see in address "Road" and not "R1"
5) Edit authorized value category "ROADTYPE" to delete entry "R1"
6) Perform a search on patrons (click on letter D)
7) Check you see in address "R1"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3c0ac4cb9a4290c770aa8e4837b6d639b49c97e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 72e78f72a3e701b574db13f7ad0ff161e00029ef)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36332: Add missing semicolon in moremember.tt
Jonathan Druart [Fri, 15 Mar 2024 13:56:26 +0000 (14:56 +0100)]
Bug 36332: Add missing semicolon in moremember.tt

It's fixing a JS error
Uncaught ReferenceError: script is not defined

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 23b05e812aa40ba452a951002d036b2d6c67441d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5710afb1cd91ac67791df438833f155f84c2d767)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35796: Properly set patron_expiration value
Lucas Gass [Fri, 8 Mar 2024 21:32:21 +0000 (21:32 +0000)]
Bug 35796: Properly set patron_expiration value

To test:
1) Set an expiration on the password in a patron account and save.
2) Go to patron details (moremember.pl) and confirm the password has an expiration.
3) Edit the patron account without touching anything and save the account.
4) Go back to patron details (moremember.pl) and note that the expiration on the password has been removed.
5) APPLY PATCH
6) Try 1 - 4 again except this time password expiration is not removed.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 60dcb2b0775ba4d47502e68af5d4aa3c127f0f81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e5cdf2bbc17e30d563187a4948518fdb2056191e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36233: Set select2 width to 100%
Nick Clemens [Thu, 14 Mar 2024 10:58:48 +0000 (10:58 +0000)]
Bug 36233: Set select2 width to 100%

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 638b5ef1b4a02b97c14b6166b1db7c4701fb741b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1a2c3ce39be20d14e78606550076d3f4450fa903)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36233: (follow-up) Fix width and enable clear option
Nick Clemens [Wed, 6 Mar 2024 19:24:30 +0000 (19:24 +0000)]
Bug 36233: (follow-up) Fix width and enable clear option

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c29390736f7c49d7276733ea96abfffb24ebcda7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e6e927fa9d8c11447e02d6f169a2b498f5ac319b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36233: Use select2 to load vendors on invoice search
Nick Clemens [Tue, 5 Mar 2024 14:52:16 +0000 (14:52 +0000)]
Bug 36233: Use select2 to load vendors on invoice search

This patch moves the dropdown to use select2 and avoids loading all
vendors at page load.

To test:
 1 - Create some extra vendors in your system, ideally over 20
 2 - Search for a vendor in acquisitions
 3 - Click 'Invoices'
 4 - Note the dropdown of all vendors 'Vendor:' in search bar on left
 5 - The vendor you came from shoudl eb selected
 6 - Apply patch
 7 - Repeat
 8 - Note only a partial list of vendors is loaded, confirm current vendor still selected
 9 - Search in the dropdown and confirm vendors are returned
10 - Select a vendor and search
11 - confirm selection is retained

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6b1b3718889f3674ac00eccbe3e0636a66f2c1a5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bb5fd20c6804fbb3e479dca113971d507e021ca3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 33898: Implement reaping for database polling
Kyle M Hall [Fri, 8 Mar 2024 11:07:52 +0000 (06:07 -0500)]
Bug 33898: Implement reaping for database polling

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e29e058851c1ffec5bcadab8bba357cd53142a2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit da258a31950d53831292fdbcc54948ba3237c18c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 33898: Alternative approach with receive frame timeout
Marcel de Rooy [Fri, 8 Mar 2024 07:37:19 +0000 (07:37 +0000)]
Bug 33898: Alternative approach with receive frame timeout

See bug 33898 comment6.

Test plan:
Based on comment12: Stage MARC import and manage. Look at the same
time to the results of ps aux|grep Z. Verify that the lines with
[background_jobs] <defunct> disappear within 10 seconds.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bc42006019acf17e0c9b7284070e2f776dc77335)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7aa97b161ce585cd41972e4fb253c31030a9689c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 32671: Prevent selenium/basic_workflow.t to fail if run on slow servers
Jonathan Druart [Mon, 11 Mar 2024 15:41:12 +0000 (16:41 +0100)]
Bug 32671: Prevent selenium/basic_workflow.t to fail if run on slow servers

When submitting the form to create a new patron we are doing a POST
memberentry.pl that is redirecting to moremember.pl

The selenium test is expecting for the end of the request to test the
page's title against "Patron details for ".

But it's only waiting for the POST response (302), not the GET
moremember that will display the patron's details.

You can simulate a slow server using cpulimit: `cpulimit -b -p $PID -l 1`
replacing $PID with the pid of the starman process.

Note that other tests are failing using 1%, but... baby steps.

The current failre:
 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 122
 Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125
 #                   'Add patron (test cat description) › Patrons › Koha'
 #     doesn't match '(?^u:Patron details for test_patron_surname)'

The next one (NOT fixed by this patch):

 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 256.
 #                   '
 #
 #             Checkouts (0)#         #         '#     doesn't match '(?^u:Checkouts \(1\))'
 t/db_dependent/selenium/basic_workflow.t .. 14/22 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 256.
 #                   '
 #
 #             Checkouts (1)
 #
 #         '
 #     doesn't match '(?^u:Checkouts \(2\))'
 t/db_dependent/selenium/basic_workflow.t .. 16/22 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 256.
 #                   '
 #
 #             Checkouts (2)
 #
 #         '
 #     doesn't match '(?^u:Checkouts \(3\))'

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4e166e07c15a5726319e20bfef21dc543f0b58a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5d73ff2da11a3e8b3e40be637c1d5750c56a7e04)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34755: Backport Koha::Token change from bug 34478
David Cook [Mon, 4 Mar 2024 04:19:38 +0000 (04:19 +0000)]
Bug 34755: Backport Koha::Token change from bug 34478

This change includes the Koha::Token changes which uses
Koha::Session for generating and checking CSRF tokens.

0. Apply the patch and koha-plack --restart kohadev
1. Setup Keycloak OIDC SSO according to "Testing SSO"
wiki guide
2. In a regular window go to http://localhost:8080
3. In a private window go to http://localhost:8080 and click
the SSO "Log in with..." button, but don't log into Keycloak
4. In the regular window, login locally, and navigate to 5-6 pages
5. In the private window, log into Keycloak
6. Note that you are redirected back to Koha and logged in
successfully (no wrong_csrf_token error).

Signed-off-by: Olivier Hubert <olivier.hubert@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 46c0419a11d56b078f1f8528e51bf1a78bd284e6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35955: Add tests
Jonathan Druart [Tue, 27 Feb 2024 07:56:24 +0000 (08:56 +0100)]
Bug 35955: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0631153f06278d6acda3042a9243b5fb7bb9c5a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 97026a069d4fa51a4cf05c516a3250c9be8b6658)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35955: Cache CSRF token in template plugin
David Cook [Tue, 27 Feb 2024 06:05:24 +0000 (06:05 +0000)]
Bug 35955: Cache CSRF token in template plugin

This change uses the Koha::Cache::Memory::Lite cache to
cache the CSRF token, so that it is only generated once,
and is re-used by the Koha::Template::Plugin::Koha object
throughout the entire template processing for the HTTP request.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 108c955eac02707ccaa35081fbece1054a5dcda3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 222777ba98962b2fcd3433af78bd13bfd90c0620)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36066: (follow-up) Move 403 to 409 when status ne cancelled
Marcel de Rooy [Tue, 5 Mar 2024 14:54:02 +0000 (14:54 +0000)]
Bug 36066: (follow-up) Move 403 to 409 when status ne cancelled

Test plan:
Run t/db_dependent/api/v1/acquisitions_orders.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4032da3f964f438e913ed19d40b0b73aa4bd2533)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e0f35d65e240590a02a46f9dcee3684716254e33)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36066: Only allow cancelled order deletion in API
Marcel de Rooy [Mon, 12 Feb 2024 09:54:04 +0000 (09:54 +0000)]
Bug 36066: Only allow cancelled order deletion in API

Note: I had trouble with listing orders in API without
status, although formally not required according specs.

Test plan:
Run t/db_dependent/api/v1/acquisitions_orders.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dcbda39c0a77a35b2bc4684a286bf26254046877)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1c556d6ed1ab6d0512ec3317ca5963205fca716b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36066: Add tests
Marcel de Rooy [Mon, 12 Feb 2024 09:54:04 +0000 (09:54 +0000)]
Bug 36066: Add tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] As Victor discovered, the test with status new in subtest
'delete' needed the authorised user now.

Test plan:
Run t/db_dependent/api/v1/acquisitions_orders.t
Without the follow-up patch this should FAIL.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8bb61c4f8835a7b36d32c580e12fe40381a5f22b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1bc64dcef4fe3b411c7fda3f6acd33cc72e97b3c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35983: Remove extra selected=selected from dropdown menu
Lucas Gass [Fri, 2 Feb 2024 00:04:33 +0000 (00:04 +0000)]
Bug 35983: Remove extra selected=selected from dropdown menu

To test:
1. Admin > Circ & fine rules
2. Select a library at the top of the forms ( #selectlibrary )
3. Try to change the 'Refund lost item replacement fee' to "Refund lost item charge (only if unpaid)".
4. Press save and let the page reload.
5. Look at the dropdown again, the value is now set to "Refund lost item charge and restore overdue fine".
6. APPLY PATCH
7. Try steps 2 - 5 again but this time the value in the dropdown should not change.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit af5453bbd28089acfb99d5877eac939b7a87f2ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fdc2bbb76f753384c51cca03e2ff16ba6c18e716)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35916: Purchase suggestions bibliographic filter should be a "contains" search
Shi Yao Wang [Fri, 23 Feb 2024 19:16:27 +0000 (14:16 -0500)]
Bug 35916: Purchase suggestions bibliographic filter should be a "contains" search

Make all bibliographic information fields filter do a contain match
rather than an exact match

Test plan:
1. Create a purchase suggestion with a multi-word title (e.g. one day in december)
   1.1. Go to Acquisitions > Suggestions > New purchase suggestion
   1.2. Enter a title (e.g. one day in december)
   1.3. Click on Submit your suggestion

2. Search for one of the words in the title
   2.1. In the "Filter by" section, click on Bibliographic information
   2.2. In the title field, enter one of the words of the title (e.g. december)
   2.3. Click Go
   --> No results

3. Apply the patch
4. Redo step 2 and notice there is now a valid result

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3d7ea3bd99a0b6c68d7bcd763559d43910c4c9e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8644a1165f19a18e2e2010f51a7f32597e08a6ee)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36103: Remove the "Cancel hold" link for item level holds
Kyle M Hall [Tue, 27 Feb 2024 13:40:53 +0000 (08:40 -0500)]
Bug 36103: Remove the "Cancel hold" link for item level holds

This link is broken and doesn't make sense from a UI/UX perspective
and thus should be removed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c91a43ca1f1cbc9b4174ac435428086fc3ed03db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit de4f54b3fa6ca3dd30dc23e10f1f42630028216e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35911: Make archived suggestions not show in patron's account
Shi Yao Wang [Fri, 23 Feb 2024 20:01:43 +0000 (15:01 -0500)]
Bug 35911: Make archived suggestions not show in patron's account

Remove archived suggestions in patron's account page

Test plan:
1. Go to a patron's account in the staff interface
2. Go to the Suggestions tab
3. Click New purchase suggestion and create a suggestion
4. In another browser tab, go to Acquisitions > Suggestions
5. Click the small arrow next to the edit button to the right of the suggestion, and choose Archive (alternatively, check the suggestion's box and click Archive selected)
   --> Suggestion disappears from the suggestions management page (OK)
6. Go back to the tab with the patron's account and refresh
   --> Suggestion is still visible
7. Apply the patch
8. Redo step 6 and notice the suggestion is not visible anymore
9. Redo step 4 and 5 but this time, unarchiving the suggestion
10. Redo step 6 and notice the suggestion is back

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ac71adbd23e2d3a6c599ac963b042576dca635f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d35481b1abb0f9fe30acefd14070f74d1265c50b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36004: Fixed typo in successfully
Laura Escamilla [Tue, 6 Feb 2024 16:13:32 +0000 (16:13 +0000)]
Bug 36004: Fixed typo in successfully

To test:

1. Turn on the syspref 'OpacCatalogConcerns'

2. Go to view a record in the OPAC and click on "Report a concern" in
   the column located on the right-hand side.

3. Fill out the title on the form and leave everything else the same.
   Click on submit and notice that the message on the screen says "Your
   concern was sucessfully submitted."

4. Apply the patch.

5. Submit a new concern. Notice that the text now has "successfully"
   spelled correctly.

6. Sign off and have a great day! :D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6bf839d89244e316d7ec936c439fa0d770f3665e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17ba879fec1794cd7633c21f1211c089ab9f0367)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36005: Fixed typo in "Your concern was successfully submitted." text
Laura Escamilla [Tue, 6 Feb 2024 16:28:41 +0000 (16:28 +0000)]
Bug 36005: Fixed typo in "Your concern was successfully submitted." text

To test:

1. Turn on the syspref 'CatalogConcerns'

2. Go to view a record in the staff intranet and click on "New catalog concern" which is located in the "+New" dropdown.

3. Fill out the title on the form and leave everything else the same. Click on submit and notice that the message on the screen says "Your concern was sucessfully submitted."

4. Apply the patch.

5. Refresh the page and submit a new concern. Notice that the message now has "successfully" spelled correctly.

6. Sign off and have a wonderful day! :D

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0fcf48c55f858d19f1b78337b4b83f61831564fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 72dd84251ee96fcf66518ceac3203bafbaa3c4df)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36032: Use a single angle in the "Next" button
Raphael Straub [Thu, 8 Feb 2024 09:00:13 +0000 (09:00 +0000)]
Bug 36032: Use a single angle in the "Next" button

The "Next" pagination button in the OPAC result list has a double angle
whereas the "Previous" button only has a single angle. This patch fixes
that error.

To test:
1) Do a search in the OPAC with more than one page of results.
2) Observe that the "Next" button has a double angle whereas the
   "Previous" button has only a single angle.
3) Apply the patch.
4) Repeat steps 1 and 2.
5) Verify that the "Next" button now has a single angle.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c1ce64593718143c94c3b666f4f468e55a7fe92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0e511dffcf09c43c4cffcb6a1a61fed772502ec5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35538: Sort OPAC self registration library list by library name
Owen Leonard [Mon, 18 Dec 2023 19:05:10 +0000 (19:05 +0000)]
Bug 35538: Sort OPAC self registration library list by library name

This patch modifies opac-memberentry.pl so that the list of libraries is
sorted by library name instead of library code.

To test, apply the patch and restart services.

- If using the default testing data you'll have to go to Administration
  -> Libraries and edit one or more libraries so that the library name
  is alphabetically different than the library code. e.g. Centerville ->
  Zanzibar.
- Go the OPAC and click "Create an account" (requires the
  PatronSelfRegistration system preference).
- Under "Home library," the dropdown of libraries should be ordered by
  library name.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5998fe93f5a7fe5fa2b55fc18b94e68e99f2a879)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e37c7d27e1d9af49023cc763509235d78e37ecb0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36056: Clarify subpermissions AND behavior
Tomas Cohen Arazi [Thu, 8 Feb 2024 21:29:54 +0000 (21:29 +0000)]
Bug 36056: Clarify subpermissions AND behavior

Working on bug 31791, I found myself wondering if our current recursive
code in C4::Auth::haspermission() would allow checking AND on
subpermissions.

As it is not documented in the POD or tested, I decided to write some
unit tests for it.

It turned out it was well supported, so I decided to submit the tests,
and a small tweak in the POD to reflect that.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Auth/haspermission.t
=> SUCCESS: Tests pass! The code supports AND on subpermissions!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit aa1049fdd37d87b73c434dfdea11ba691e7095da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26ba5fba8be7eee3d931c2d6ef774860145780f0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36134: Read complete Elasticsearch configuration in about.pl
Lari Taskula [Tue, 20 Feb 2024 01:47:53 +0000 (01:47 +0000)]
Bug 36134: Read complete Elasticsearch configuration in about.pl

When enabling Elasticsearch authentication in Koha using userinfo
parameter of Search::Elasticsearch, about.pl breaks and gives an
internal server error.

This patch reads the complete Elasticsearch configuration for
about.pl including userinfo causing about.pl to recover.

To test:
1. In Elasticsearch 7 settings, set "xpack.security.enabled: true"
2. Add <userinfo>elastic:password</userinfo> to KOHA_CONF elasticsearch
   settings
3. Restart plack and navigate to about.pl
4. Observe internal server error
5. Apply patch
6. Refresh about.pl
7. Observe it working again

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5511482951f812140f134b0ddfc5f3cab2807c77)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e70bc2d20feabd3c52ae9017f66818d36e573cdc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36212: Add check on barcode before searching items
Marcel de Rooy [Fri, 1 Mar 2024 09:39:35 +0000 (09:39 +0000)]
Bug 36212: Add check on barcode before searching items

Test plan:
Add an item to your database that has no barcode.
Run t/db_dependent/Circulation.t
It will fail without this patch, pass with this patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8413b376798097725cfd2ca3eb7a12427ad08163)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 246566b7d1bc275e946860e950692216fbafc871)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029
Fridolin Somers [Thu, 8 Feb 2024 11:23:30 +0000 (12:23 +0100)]
Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029

UT is failing in jenkins.
Change to use biblio.copyrightdate instead of bilio.medium

Run prove t/db_dependent/Items/AutomaticItemModificationByAge.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e6a2c3b5b6d0464215189e29954d06e5f6e236b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0660d11f52bb310a2b39da0a42dda60da87a2ad)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 32029: Automatic item modifications by age add biblio table
Fridolin Somers [Fri, 28 Oct 2022 07:59:26 +0000 (21:59 -1000)]
Bug 32029: Automatic item modifications by age add biblio table

In automatic item modifications by age missing,
conditions can be on columns of tables items or biblioitems.
Table biblio is missing.

Test plan :
1) Create an automatic item modifications by age with a condition on a column of biblio table
2) Create a record and item matching the rule
3) Run misc/cronjobs/automatic_item_modification_by_age.pl -c -v
=> Check only matching items are impacted

Signed-off-by: Philip Orr <philip.orr@lmscloud.de>
Bug 32029: (follow-up) unit test

Signed-off-by: matthias le gac <matthias.le-gac@inlibro.com>
Bug 32029: (follow-up) tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4e480d48f67c2eb942be4c8516533a327c7e2ba5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit badba61f0091a2c4f04173976d6df154e4542b84)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36170: Wrong error variable in memberentry
Jonathan Druart [Wed, 21 Feb 2024 12:46:29 +0000 (13:46 +0100)]
Bug 36170: Wrong error variable in memberentry

It is hidding an important error.

$@ is never set here, we need $_ (inside a try-catch)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cd9de702e2bb9aff991e92b04d2889c91a3dcd58)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f49a9e1a4db9710c776c6d917e9cd456c609ef0f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34234: Respect display_order in additem.tt and detail.tt
Lucas Gass [Fri, 12 Jan 2024 17:35:24 +0000 (17:35 +0000)]
Bug 34234: Respect display_order in additem.tt and detail.tt

1. APPLY PATCH
2. EnableItemGroups
3. Find a record and add some new item groups with display orders that are different from the order in which the groups were added
4. Check the checkbox next to one or more items and click the link to "Add/move to item group"
5. Ensure display order is correct
6. Now add a new item to the record and scroll down to the dropdown underneath "+ Add to item group"
7. Display order should be correct.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bcfc786f17fad8b7c866ee6063d2953d7b5d925d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9308e3d5190a496e1c1bd603de3a8b2a8392d1df)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35892: Populate order price using GetMarcPrice if no price specified
Nick Clemens [Thu, 25 Jan 2024 19:03:00 +0000 (19:03 +0000)]
Bug 35892: Populate order price using GetMarcPrice if no price specified

Previously this happened after the fact, automagically, if no price was included in the order record. We should
rather load the Marc price into the order form if we don't have a price form the '...ToOrder' system preferences

To test:

Setup -- Set systempreferences below

MarcFieldsToOrder:
price: 949$g
quantity: 949$k
budget_code: 949$l
discount: 949$m
sort1: 949$n
sort2: 949$q

MarcItemFieldsToOrder:
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l

Stage the attached bib-303.marcxml file
Add to basket from the staged file
Note that item prices are populated as '6.50' from 949$g
Cancel
Update MarcFieldsToOrder and map price to "020$c"
Add to basket from the staged file
Note the price is not populated, because 020$c contains a dollar sign
Cancel
Apply patch, restart all
Add to basket from the staged file
Note the price is now correctly populated from fallback to GetMarcPrice

Note: GetMarcPrice does some automatic munging, that's why 020$c on it's own doesn't work - this could be done to fields in MarcFieldsToOrder/MarcItemFieldsToOrder but this would be an enhancement.
This bug simply restores the previous behavious, but does it on the front end and is more obvious to the user

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3035f7e1b469acaebfc6e388d60a9684f744ba5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 781f34e504eb5d5cd84e7e9840e06006fd703977)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36047: Remove jQuery selector from conditional
Julian Maurice [Thu, 22 Feb 2024 15:42:27 +0000 (15:42 +0000)]
Bug 36047: Remove jQuery selector from conditional

This prevents the jQuery from breaking if the reason contains an
apostrophe character.

1. Create a suggestion
   1.1. Go to Acquisitions > Suggestions
   1.2. Click New purchase suggestion
   1.3. Enter a title
   1.4. Click Submit your suggestion

2. Update the suggestion to accepted and add a reason with an apostrophe
   2.1. In the suggestions list, check the box next to the suggestion
   2.2. At the bottom of the screen, choose Mark selected as: Accepted
   2.3. In With this reason, choose Others...
   2.4. Enter a reason with an apostrophe (my case was in French :
        Disponible en impression à la demande (POD). S'attendre à un
        long temps d'attente)
   2.5. Click Submit

3. Order the suggestion
   3.1. Go to Acquisitions
   3.2. Search for a vendor
   3.3. Click New > Basket
   3.4. Enter a basket name
        (Optional: for testing I like to change Create items when:
        cataloging the record)
   3.5. Click Save
   3.6. Click Add to basket
   3.7. Click From a suggestion
   3.8. Click Order next to the suggestion
   3.9. Enter order details
   3.10. Click Save
   3.11. Click Close basket
   3.12. Click Yes, close

4. Receive the order
   4.1. Click Receive shipments
   4.2. Enter a Vendor invoice number
   4.3. Click Next
   4.4. Click Receive next to the order
        --> Page stays In processing forever

Apply patch. Repeat. Notice the page now renders correctly.
Extra: Add an entry containg an apostrophe to the SUGGEST authorized
values category and repeat test plan. Confirm everything works as
expected.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4515581effb9ff17e5a74c5b624805d330082c27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 16d3402cfec7a9a689c52a9d9fb48b601dc32ef4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35922: Fix www/batch.t
Tomas Cohen Arazi [Mon, 29 Jan 2024 13:04:50 +0000 (10:04 -0300)]
Bug 35922: Fix www/batch.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit baa7c050d1dbdd28c634f00d0360a5f4b1bdb35a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 82fa40b61859cb6573160435db1ddb6750499621)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Fix perlcritic for VirtualShelves.pm
Jonathan Druart [Mon, 29 Jan 2024 09:41:56 +0000 (10:41 +0100)]
Bug 34913: Fix perlcritic for VirtualShelves.pm

C4/Utils/DataTables/VirtualShelves.pm: "@order_by" is declared but not used at line 86, column 9.  Unused variables clutter code and make it harder to read.  (Severity: 3)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0c96e57b0c6986f5bffc7530bd2eaf25ea7e994e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5ae6890b8579673f5ac0458e0466cbbd75cba927)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Fix Activate/Deactive filters with table_filters.js
David Cook [Thu, 2 Nov 2023 01:37:35 +0000 (01:37 +0000)]
Bug 34913: Fix Activate/Deactive filters with table_filters.js

This change prevents columnFilter from being called twice. If it's
called twice, it compromises the formatting of the filters.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5804de2463e924dd660b4dc84caaa394f111a139)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e63c57c3d081da668f0cbde8082019c3b0aea3b4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Adjust item search
Jonathan Druart [Tue, 24 Oct 2023 09:12:56 +0000 (11:12 +0200)]
Bug 34913: Adjust item search

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 25f4a5070aef0f3c3ca9d32ee93fc1ba36f36e64)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e4c94482074c5dddaf1acdd07701b042fb990825)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Upgrade dataTables.columFilters.js
Jonathan Druart [Thu, 26 Oct 2023 05:31:05 +0000 (07:31 +0200)]
Bug 34913: Upgrade dataTables.columFilters.js

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5cb31b58a52143b41967f369bdd8ab2fb06183bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 95eed58d591965e966274da84757b2a1cc5076cd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Adjust "Manage staged MARC records"
Jonathan Druart [Tue, 24 Oct 2023 08:32:07 +0000 (10:32 +0200)]
Bug 34913: Adjust "Manage staged MARC records"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3f0715ef0a73eea69258b807590419a9091619ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 24936a656db7d6a5f447a4c65ce67b42e299c103)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Adjust C4::Utils::DataTables::VirtualShelves
Jonathan Druart [Tue, 24 Oct 2023 08:20:39 +0000 (10:20 +0200)]
Bug 34913: Adjust C4::Utils::DataTables::VirtualShelves

And remove C4::Utils::DataTables, which should no longer be reused
anyway.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4a65c417f8bfeefe9299981b415f3fbfca5cb5a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 47943a23a79043ce986b18dcd9d8e72e51861b5f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: (follow-up) Make sure default DataTables sorting style is always overridden
Owen Leonard [Fri, 20 Oct 2023 17:15:25 +0000 (17:15 +0000)]
Bug 34913: (follow-up) Make sure default DataTables sorting style is always overridden

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dbe91a59e8e884b12599ab381513bac8c3751283)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b0a52b07408f51a87c1d08d3d5c1d92c003cf15)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Move item groups table to kohaTable
Jonathan Druart [Fri, 20 Oct 2023 12:53:13 +0000 (14:53 +0200)]
Bug 34913: Move item groups table to kohaTable

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f9687f28c018075758364ffb3d859d2477defdae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a8018d568cd9757ba245c94477d2c9d410bee56c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Fix a selenium test
Jonathan Druart [Tue, 3 Oct 2023 07:21:35 +0000 (09:21 +0200)]
Bug 34913: Fix a selenium test

t/db_dependent/selenium/administration_tasks.t ....... 3/3 Cannot show all entries from table //div[@id="libraries_wrapper"] at /kohadevbox/koha/t/lib/Selenium.pm line 247.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 204a840a4d71c677d49378588f4ed529cdc83fea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ad1c38b58911e0ae72f9cf33feada0be317598b2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: DataTables upgrade: Update CSS and option names
Owen Leonard [Thu, 28 Sep 2023 17:43:32 +0000 (17:43 +0000)]
Bug 34913: DataTables upgrade: Update CSS and option names

This patch makes two categories of changes:

1. CSS changes to accommodate changes in DataTables default CSS and
   markup structure. I've tried to make sure all of our Koha-specific
   styles are still applying.

   This change necessitates a rebuild of staff interface CSS.

2. DataTables option names: In this version of DataTables you can't
   override a default which uses CamelCase (e.g. "pagingType") with one
   in "Hungarian" notation, e.g. "sPaginationType." Since we define many
   default options in prog/js/datatables.js in camel case, any template
   which previously used a Hungarian notation option to override the
   default has now been updated to use the CamelCase version.

   See https://datatables.net/upgrade/1.10-convert#Options for a summary
   of the different option name changes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 60e3f1024ba485573e53488575afd605a364a8bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 01d85cfd0baa511354f39b2074463abc3394d121)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 34913: Upgrade staff interface DataTables from 1.10.18 to 1.13.6
Owen Leonard [Thu, 28 Sep 2023 13:46:34 +0000 (13:46 +0000)]
Bug 34913: Upgrade staff interface DataTables from 1.10.18 to 1.13.6

This patch replaces 1.10.18 DataTables assets in the staff interface
with 1.13.6 versions.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7e6221209cb83a2ad9d0c86e6a3b26a83b667ab0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 33db767d4f0c8d9cf12c6c27c61590e9a4838310)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36359: [23.05.x] Fix bad rebase of opac-main.tt
Lucas Gass [Tue, 19 Mar 2024 16:12:49 +0000 (16:12 +0000)]
Bug 36359: [23.05.x] Fix bad rebase of opac-main.tt

To test:
1. Add a OPAC news item
2. Go to the OPAC home page, view source, and copy that into an HTML validator. See errors.
3. APPLY PATCH
4. Try step 2 again, errors should be fixed.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35819: (QA follow-up) Prevent warning on uninitialized retries count
Marcel de Rooy [Mon, 5 Feb 2024 11:13:15 +0000 (11:13 +0000)]
Bug 35819: (QA follow-up) Prevent warning on uninitialized retries count

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c86e6ee82d27640c5c66c534d1e93ddbbbc2c4fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17032f89a35715f143529ea128580c33ac952350)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35819: Adjust es_indexer_daemon
Jonathan Druart [Tue, 30 Jan 2024 08:30:38 +0000 (09:30 +0100)]
Bug 35819: Adjust es_indexer_daemon

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Add forgotten module
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c1d4716beba5aa0d2c77ad460b4e6982cfee236)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit febc2570de8feea490bd53c1f4434eafb3b5d960)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35819: Improve logging
Jonathan Druart [Fri, 26 Jan 2024 13:25:56 +0000 (14:25 +0100)]
Bug 35819: Improve logging

Log (warn) if the job will be processed later, but add a debug however.

Have a specific log for bad status

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 30e69ebc5644f8b3d0a79c5c36aeb5038b632a30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f8af6d50280137dfa94a1a04bccaf3139fb3a519)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35819: nack and not requeue if frame is invalid
Jonathan Druart [Tue, 23 Jan 2024 09:14:21 +0000 (10:14 +0100)]
Bug 35819: nack and not requeue if frame is invalid

If a frame cannot be correctly processed (most probably because the body
is not valid JSON) then we are not acking or nacking the frame and the
worker is stuck.

In this specific case we should nack without requeuing the frame.

NOTE that requeue must be 'true' or 'false', not 1 or 0, or the default
'true' will be used.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 83940925685af338be659ef7baa04a40bed9d97d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 87e3d35e84dbfe4f2bc3b7b8d67bd54e38cdc64b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35819: Add simple delay
Marcel de Rooy [Fri, 19 Jan 2024 07:10:02 +0000 (07:10 +0000)]
Bug 35819: Add simple delay

Here I add 500 ms. In my testing with the 1s sleep from the test
plan, I might see one or two 'not found' lines. Obviously things
depend on the time needed before the txn commits. But it will
reduce a flood of these messages.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0feb10df7f9473c8ccd14bea947c0957a839e059)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b1efcf3d15680493828894b7c1c0cb9557be1cb8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35819: Notify NACK and requeue when Job ID not found
Tomas Cohen Arazi [Tue, 16 Jan 2024 17:46:20 +0000 (14:46 -0300)]
Bug 35819: Notify NACK and requeue when Job ID not found

This patch makes the worker reject the incoming frame for putting the
message back in the queue, in the event the job id doesn't exist yet.
Which is the case when some actions are being triggered inside a
transaction which hasn't been commited to the DB yet.

To test you will need 3 KTD shells
(a) mysql:
   $ ktd --shell
  k$ sudo koha-mysql kohadev

(b) logs:
   $ ktd --shell
   # for restarting the worker and looking at the logs
  k$ sudo koha-worker --restart kohadev  ; tail -f /var/log/koha/kohadev/worker-*.log
(c) running the test:
   $ ktd --shell

1. Have (a), (b) and (c) terminals ready
2. On (c), run:
   $ perl -MKoha::Database -MKoha::BackgroundJob::BatchUpdateBiblioHoldsQueue -e 'Koha::Database->schema->txn_do( sub { Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue({ biblio_ids => [ 1 ] }); sleep 1;  } );'
=> FAIL:
   * (b) shows (once) an error about a job not existing
3. On (a) run:
   > SELECT * FROM background_jobs;
=> FAIL: Notice the job ID mentioned on 2 stands as 'new'.
4. Apply this patch
5. Ctrl+c on (b), and re-run to launch the worker with the patch applied
6. Repeat 2
=> SUCCESS (partial): The error about the job not existing is displayed
many times
7. Repeat 3
=> SUCCESS: The job ID mentioned on 6 stands as 'finished'.
8. Sign off :-D

Discussion:

* The `requeue` header I added is correct, but it is the default
  behavior anyway. I prefered to make it explicit, though.

* To avoid that bunch of retries, we should requeue with some delay. I
  didn't manage to make it work (yet) but there's a 'delay' plugin for
  rabbit [1]. We already install the 'stomp' plugin in
  koha-common.postinst. But this plugin requires downloading it. Which
  would require further investigation.

* As Nick and Marcel pointed, we need to revisit the whole architecture,
  the need of a MQ (DB polling wouldn't have this problem), etc. But
  that's for another place.

[1] https://hevodata.com/learn/rabbitmq-delayed-message/#:~:text=To%20delay%20a%20message%2C%20the,to%20queues%20or%20other%20exchanges.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1a51c2e973a1b6ce1116bbc243853112be96f0ea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 83fb050b2f18e0f279df505c3ef5eb7942ecc992)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36140: Correct label for attribute invoice.tt
Lucas Gass [Tue, 20 Feb 2024 23:19:01 +0000 (23:19 +0000)]
Bug 36140: Correct label for attribute invoice.tt

To test:
1. Go to /cgi-bin/koha/acqui/invoice.pl?invoiceid=X  where X is the invoice number.
2. Look at the Invoice number with your dev tools, the for attribute is wrong. ( shippingdate )
3. Apply patch and look again, the attribute should correctly be invoicenumber.

Alternatively, just look at the diff of this trivial change. :)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 214fc675cf8f3d7962aa02c03ee9cfc6f18e7973)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d6bdada36dd0dad4682a09869c21dd630c36ddea)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36076: paycollect.tt add permission checks for manual credit and invoice
Fridolin Somers [Tue, 13 Feb 2024 09:49:17 +0000 (10:49 +0100)]
Bug 36076: paycollect.tt add permission checks for manual credit and invoice

In members/pay.tt one can see permission checks for manual credit and invoice :
CAN_user_updatecharges_manual_invoice
CAN_user_updatecharges_manual_credit

This is missing from members/paycollect.tt.
HTML is also missing classes manualcredit and manualinvoice.

Test plan :
1) Create a user with permissions to manage accounting
   (remaining_permissions under updatecharges) but without
   manual_invoice and manual_credit
2) Go to a patron account with an invoice
3) Click on "Make a payment", you dont see tabs manual credit/invoice
4) Click on "Pay" in "Actions" column
=> Without patch you see tabs manual credit/invoice
=> With patch you do not see them

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 52e7c8acf450e1b010c384619eca77a0f8846bfa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3a12820e3c2cb4f676955921a72c3650dc32f5d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35963: (QA follow-up): tidy up code and fix exec permission
Victor Grousset/tuxayo [Wed, 28 Feb 2024 04:52:41 +0000 (05:52 +0100)]
Bug 35963: (QA follow-up): tidy up code and fix exec permission

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9b8cbf5c83a8f76f3b5eba5065aa5cb7aa26e1d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0126eeda7866d4cfa8321c7b36c20da4742934a8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35963: Fix bundled items table ordering and filtering
Julian Maurice [Wed, 7 Feb 2024 13:36:01 +0000 (14:36 +0100)]
Bug 35963: Fix bundled items table ordering and filtering

Using the many-to-many relationship results in the table alias `me` to
be used for table `item_bundles` instead of the expected table `items`.
This causes ordering and filtering to fail for columns Callnumber and
Barcode.
Using Koha::Items->search does not have this problem.

This patch also disables ordering by status because it does not work
(error message is: "Cannot find Koha::Object class for return_claim'")

Test plan:
1. Create an item bundle
   https://koha-community.org/manual/23.11/en/html/circulation.html#circulating-bundles
2. Add at least 2 items to this bundle
3. Verify that ordering/filtering by callnumber or barcode works
4. Run `prove t/db_dependent/api/v1/items/bundled_items.t`

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2753eec1ce8ce57afc10162936967d1f39c2b0b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 05742ec900076e546a282fc7d7cd48f584fccf79)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35963: Add tests
Julian Maurice [Wed, 7 Feb 2024 13:36:01 +0000 (14:36 +0100)]
Bug 35963: Add tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9344f4317083e9d70c3ff9e923447e80282ef01c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c23838f24f9b40d188cd662401960d4659b78560)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35952: Remove unnecessary line for OpacSuppressionMessage
Lucas Gass [Tue, 30 Jan 2024 20:38:15 +0000 (20:38 +0000)]
Bug 35952: Remove unnecessary line for OpacSuppressionMessage

To test:
1. Apply patch and restart all
2. Add an additional contetn entry for `OpacSuppressionMessage`, make
   sure it has a publication date in the past.
3. Make sure  OpacSuppression is set to 'hide'.
4. Suppress a record in the OPAC, ( 942$n )
5. Visit the detail page for that record and make sure you
   OpacSuppressionMessage customization displays.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c9f6a4981a69095029cf53a14fc799ed8581b196)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5e0a2d4eea7e72c1fad5bf256c330d57e5475469)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35554: Authority search popup width 800px
Fridolin Somers [Tue, 12 Dec 2023 19:57:36 +0000 (09:57 -1000)]
Bug 35554: Authority search popup width 800px

Authority search popup is only 700 pixels width.
Most popups use 800 pixels, like the z3950 one.

Test plan :
1) Edit a biblio record
2) Click on value builder in a field linked to authority (ie 700)
3) Check popup is 800 pixels wide
4) Same with advanced editor

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 112a76650cd8d84e41364fbdbc7610ac9badd511)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b4ffdfd2690dc01933bc6a2f90845c72b738460)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36009: Document background_jobs_worker.pl --queue elastic_index
Julian Maurice [Fri, 23 Feb 2024 09:59:45 +0000 (10:59 +0100)]
Bug 36009: Document background_jobs_worker.pl --queue elastic_index

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 972efe8b5c8d22796437af87bfdf880d2fd659bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit af3a850160dad9803c21682727c9a643410242bc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36009: Document koha-worker --queue elastic_index
Magnus Enger [Wed, 7 Feb 2024 07:51:36 +0000 (07:51 +0000)]
Bug 36009: Document koha-worker --queue elastic_index

To test:
- Copy the koha-worker script to the standard location:
  $ sudo cp debian/scripts/koha-worker /usr/sbin/koha-worker
- Check "sudo koha-worker --help" and verify elastic_index is
  mentioned in the list of "current queues"
- See https://wiki.koha-community.org/wiki/Testing_man_pages for
  how to check the "man" page. There should be a new paragraph
  about "Current queues" under "--queue"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3eff8d02b7ec4435a46972710786630518814cb0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1a6c28d9c610897acf3fb193ca8356097f9ada42)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35398: (QA follow-up) Tidy code
Kyle M Hall [Tue, 2 Jan 2024 13:58:04 +0000 (08:58 -0500)]
Bug 35398: (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 ab7a8db43dbb240f111e3ea7eef5b9e0a1a62652)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 07a5a2ca59733e95cc0fc4b3adacd26bad74dabb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35398: Fix LRP support for EDI orders with single items
Martin Renvoize [Fri, 24 Nov 2023 13:06:37 +0000 (13:06 +0000)]
Bug 35398: Fix LRP support for EDI orders with single items

This patch corrects a mistake in the original implementaiton of bug
20595 where we introduced support for the LRP segments being used to
automatically assign items ordered via EDI to stock rotation plans.

Signed-off-by: Sophie Halden <sophie.halden@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 783a58a9d3f26622450c7785182b175c71f50d5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d96168e38f6ed8cb74967376d8f761f3bfe47900)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35398: Unit test
Martin Renvoize [Wed, 28 Feb 2024 16:40:39 +0000 (16:40 +0000)]
Bug 35398: Unit test

This patch adds the begginings of unit tests for Koha::EDI.  Right now
we only test that a simple QUOTE message creates a basket, adds the item
to said basket and assigns that single item to a corresponding stock
rotation rota as defined by the LRP segment in the QUOTE message.

It lays the foundations for much more rigorous tests to be written to
cover the whole of EDI.pm however.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit de79e957ce82d53d9978551f1d7ef593884daa29)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4bd1aca6a7e4e616cea6a9bb3822922720bc9ee1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35398: Add unit test for extraction of library_rotation_plan
Martin Renvoize [Tue, 27 Feb 2024 13:45:53 +0000 (13:45 +0000)]
Bug 35398: Add unit test for extraction of library_rotation_plan

This unit test addition adds an LRP segment to the test EDI message file
and adds the corresponding test to confirm is it extracted into the
field as expected.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6744b9979a5b7029f9d35d19e680f8a03fcd8a75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 425bc1240b8786caaa2b414d2f884922b3b1511f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 35351: Adjust basket details template to avoid showing empty page-section
Owen Leonard [Thu, 16 Nov 2023 14:12:17 +0000 (14:12 +0000)]
Bug 35351: Adjust basket details template to avoid showing empty page-section

This patch makes a minor change to the markup of the basket details page
so that we don't display an empty div.page-section when there are no
orders.

Note: This patch includes whitespace changes, so please ignore
whitespace when viewing the diff.

To test, apply the patch and go to Acquisitions.

- Search for a vendor and add a basket if necessary.
- View the details of an empty basket.
- Under the "General information" or "Settings" sections there should be
  no empty white box.
- View the details of a basket which has orders (using the "Add to
  basket" process if necessary).
  - Orders should be displayed correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dde374e2ad1fa69deaebf21c2a569ecdb4c12594)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1b11a323f5df01ef78a03fa8918ca0c8a4455732)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36000: Fix CGI::param warning in catalogue search
Marcel de Rooy [Tue, 6 Feb 2024 12:31:28 +0000 (12:31 +0000)]
Bug 36000: Fix CGI::param warning in catalogue search

Speaks for itself.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3cf72dee6b52bbfadbb46b40d6d8fec5f3e2bf48)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a0492b210b38fb9e946e14ada50cc368d54db4d2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36088: Remove useless code form opac-account-pay.pl
Kyle M Hall [Tue, 13 Feb 2024 20:04:53 +0000 (15:04 -0500)]
Bug 36088: Remove useless code form opac-account-pay.pl

The script opac-account-pay.pl sums the selected accountlines, formats the amount, pulls the currently active currency, and does nothing with any of this data.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Note there is no change in behavior

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
PA amended title (missing 'Bug ####:'

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dd7ac62d3f184b7c76296389a16192a45fdadae0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ebf8d687cc78da22c6bbb5b2bdf49845e3c2f089)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
7 weeks agoBug 36099: count and holdcount template vars into JS vars should default to 0 if...
Pedro Amorim [Mon, 26 Feb 2024 10:03:22 +0000 (10:03 +0000)]
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty

Visit:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4321
Notice you have 2 console errors:
1) Uncaught SyntaxError: Unexpected token ';'
2) Uncaught ReferenceError: biblionumber is not defined

Apply patch. Repeat. Notice no error shows.
Visit an existing biblionumber. Confirm all is well.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 f94d763b6a5d671c4860db76263f72d0643b7555)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d4e1ea5d71fd339c800215f95369cfae51c5ade7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>