]> git.koha-community.org Git - koha.git/log
koha.git
12 months agoBug 34725: Remove use of onclick for OPAC cart
David Cook [Wed, 6 Sep 2023 06:57:15 +0000 (06:57 +0000)]
Bug 34725: Remove use of onclick for OPAC cart

This patch moves the click handler in the OPAC cart from the inline HTML
and out to an existing <script> element.

Test plan:
0. Apply the patch
1. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
2. Add the results to the cart
3. Click on the "Cart"
4. One by one click on the title of each row
5. Notice how the parent window changes to the detail record for that title

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9e39d2d67135186b2202d42004b31f9fcfa9eb58)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8af48bc9f727d5067d2108dd4565a79c7c72813e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34789: DBRev 22.11.10.001
Tomas Cohen Arazi [Mon, 18 Sep 2023 14:56:35 +0000 (11:56 -0300)]
Bug 34789: DBRev 22.11.10.001

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b952d2eb9922ed1afc5c52a2706290f94bb83e03)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bd47ab5bcbc21eb29b85373b142832a6e1b92ea4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34789: (QA follow-up) Improve output of database update
Katrin Fischer [Sun, 17 Sep 2023 13:18:49 +0000 (13:18 +0000)]
Bug 34789: (QA follow-up) Improve output of database update

* Adds description
* Adds column names to success messages

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c1b344b002b3ff2471c72f18a9746f71f7900978)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ab85941b5f8dc9dbd4084031c5388e58f78d7da0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34789: Update unit tests
Matt Blenkinsop [Thu, 14 Sep 2023 12:27:20 +0000 (12:27 +0000)]
Bug 34789: Update unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ec7c6a62ec12abe1ea092e0fbbdcc6e7ecee110)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bac14ffe0876f077e04ab825df56143db3af121d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34789: Update usage throughout Koha modules and Vue components
Matt Blenkinsop [Thu, 14 Sep 2023 12:26:53 +0000 (12:26 +0000)]
Bug 34789: Update usage throughout Koha modules and Vue components

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d2ce611f71958d31b6b3592e305bea415e50ef5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9ea9a7156b27e0235c4014a81bd289cd20f45745)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34789: DBIC file
Matt Blenkinsop [Thu, 14 Sep 2023 12:25:21 +0000 (12:25 +0000)]
Bug 34789: DBIC file

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6989d25df7dcb1bc1f4a9b2897b107c38a583053)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a286990983bfc94fa8afb9e2776dec018a9bc9f5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34789: Database and API update
Matt Blenkinsop [Thu, 14 Sep 2023 12:23:49 +0000 (12:23 +0000)]
Bug 34789: Database and API update

Currently the erm_eholdings_titles table has a field called preceeding_publication_title_id. This should be preceding_publication_title_id

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cf94eae1ff89d1c99604dd68429c77f7247aa9a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5a01b6dddcab0e86032a17e0ecb392ed25d6db2b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 33406: (follow-up) Mock SearchEngine to ensure using ES
Nick Clemens [Mon, 18 Sep 2023 13:24:53 +0000 (13:24 +0000)]
Bug 33406: (follow-up) Mock SearchEngine to ensure using ES

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 766bdd638acbf8870c3f6eb21d03d8195040e54f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff544893a1e07725b0f64071de43ab762bfaa15b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34719: Add middle_name to patron autocomplete
Lucas Gass [Thu, 7 Sep 2023 21:19:26 +0000 (21:19 +0000)]
Bug 34719: Add middle_name to patron autocomplete

To test:
1. Apply patch and clear browser cache.
2. Find some patrons with middle_name populated or add new patrons with a middle_name.
3. Make sure PatronAutoComplete is on
4. Try searching for a part of one of the patron's names who has a middle_name.
5. It should appear in the autocomplete dropdown

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a6c77f664c6b21b3d7c9ee4590a8b8b21a18a9b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 92cb17716931ff68e963acf04361be29dff3b80e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 33406: (QA follow-up) Adjust tests and tidy
Nick Clemens [Thu, 14 Sep 2023 13:21:44 +0000 (13:21 +0000)]
Bug 33406: (QA follow-up) Adjust tests and tidy

Rather than test that nothing is returned, we want to test that the terms are filtered as expected. This also avoids the possibility of the tests failing in a db where there is a record for Donald Duck

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3d7b60dc90142b171b6aaa268bdf2abf917b3739)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4cc41203223e5e43b1289e819682f2b1b38efde6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 33406: Filter out some known isolated trouble makers
Janusz Kaczmarek [Tue, 8 Aug 2023 08:41:53 +0000 (08:41 +0000)]
Bug 33406: Filter out some known isolated trouble makers

Test plan:
1) Launch k-t-d with ES:
-- ktd --es7 pull
-- ktd --es7 up
2) Visit /cgi-bin/koha/authorities/authorities-home.pl and search for 'tim'
3) Edit that, add a dash '-' to 100$a, like 'Bunce, Tim - name'"
4) Do a authority search for 'tim - name', notice it errors out
5) Apply patch
6) Perform the same search, notice it doesn't error and returns the correct record

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 27c6171222bf3abb5ed91e399bb2663579e8e367)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 14487cd5e06cc8e5da133194f8d31e60b03fab9b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 33406: Handle ES search errors for authorities
Jonathan Druart [Thu, 11 May 2023 10:38:53 +0000 (12:38 +0200)]
Bug 33406: Handle ES search errors for authorities

We are dealing ok with ES exceptions for biblio records search,
catching them and raising them to the end user. But we don't for
authorities, where we explode with an ugly 500.

Test plan:
Search for "(term_1*) AND (-) AND (term_2*)" in the authority search and
notice that you don't get a 500 but an error instead saying that you
should try again

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 09b29d06da5fac2bd1315d849f1b9bf924576700)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b4187cf2abb7007d528585f59b723c10dc3b4480)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 33406: Add tests
Pedro Amorim [Mon, 4 Sep 2023 12:28:29 +0000 (12:28 +0000)]
Bug 33406: Add tests

Test plan:
1) Apply this tests patch only
2) Run: prove t/Koha/SearchEngine/ElasticSearch/Search.t
3) Notice it fails with nasty ES "Failed to parse query" error
4) Apply the other patches
5) Repeat 2) - notice theres no nasty error

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fbd62562e0d67d22738435e44adf9f03900a147e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f36647c32a7224146ff2a8420b4c3243562f094c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34787: Fix typo gorup
Marcel de Rooy [Thu, 14 Sep 2023 09:31:00 +0000 (09:31 +0000)]
Bug 34787: Fix typo gorup

No test plan (fixing comment).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5797079fc5e5b1e9a4d883f0ceb5a344b8cdbd36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b8b21c6d11cc2065a475b36bf1214fd03d7ebe05)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34743: Fix POD description
Matt Blenkinsop [Fri, 8 Sep 2023 11:04:56 +0000 (11:04 +0000)]
Bug 34743: Fix POD description

Currently --expiration-from-today has the same definition as --update-expiration. The description has now been updated to reflect the fact that it will set the date from today, and not the patron's enrollment date

Test plan:
Look at the patch file and confirm that the POD now mentions today's date rather than the patron's enrollment date

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 91dd8dd16f11f721d109f240eb9928b7383f9b15)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 636c601995db0e8b86c75a304b9e27dfb00a5245)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34656: (QA follow-up) perltidy
Emily Lamancusa [Thu, 31 Aug 2023 14:52:52 +0000 (10:52 -0400)]
Bug 34656: (QA follow-up) perltidy

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4988bcdb93008b44e2ce0517c0441f08c61958b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 66726cca42ec17097862b12610bf0a672b16bce6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34656: Do not update real Time Holds Queue when moving from cart to shelf
Nick Clemens [Wed, 30 Aug 2023 13:46:52 +0000 (13:46 +0000)]
Bug 34656: Do not update real Time Holds Queue when moving from cart to shelf

To test:
1 - Enable RealTimeHoldsQueue system preference
2 - Set UpdateItemLocationOnCheckin to _ALL_: CART
3 - Check in an item
4 - Check the background jobs - the RTHQ is updated
5 - perl -e 'use C4::Items; C4::Items::CartToShelf(##);' -- substitute the itemnumber from above
6 - Check the background jobs - no new update to RTHQ
7 - Confirm item was set back to correct permanent_location

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 84521918d93878ffa314decc4eb3b67afe46dca3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1779dddfe8ec84d4f654b4a65190fb8ede7e4cbe)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34656: Unit test
Nick Clemens [Wed, 30 Aug 2023 13:46:17 +0000 (13:46 +0000)]
Bug 34656: Unit test

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aff84104127552fe5f5e4394f84b501dafcbc497)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1af30926423cde9f09e6b4bc5df21ca781611161)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34767: Pass fee_ack into ::Transaction::Renew(All)
Martin Renvoize [Tue, 12 Sep 2023 15:24:19 +0000 (16:24 +0100)]
Bug 34767: Pass fee_ack into ::Transaction::Renew(All)

This patch copies the $fee_ack field into the generated
::Transaction::Renew|All objects such that the fee acknowldegement flag
is respected for renewals.

Test plan
To test:
1) Add a rental charge to an itemtype
2) Checkout an item of that itemtype to a user
3) Attempt a renewal of that item via SIP2 and note that it fails
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m renew
4) Pass the fee_acknowledgement bit in renewal and note the renewal
   still fails.
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m renew
5) Apply patch and note the above now succeeds
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m renew

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3a2dcf0733733a92ddbf46fb863434a46060e279)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 11c73ed5b83402495ece7ffe5601f291e5c4247b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34768: Remove checkbox column from relatives fines on OPAC
Nick Clemens [Tue, 12 Sep 2023 15:28:34 +0000 (15:28 +0000)]
Bug 34768: Remove checkbox column from relatives fines on OPAC

When a patron has a guarantee and can see their fines on the opac and
an opac payment plugin is enabled there is an error on the 'Charges'
tab.

The table uses a 'COLSPAN' variable which is set to 5 or 6 depending on
if OPAC payments are enabled. The guarantees table has one less column
than the patron's however, so it is going out of range and causing a JS
error. Additionally, we are adding a column to the child's table which
is not used as their fines cannot be selected for payment at this time.

This patch removes the checkbox column and sets the colspan directly to
4

I also fix an issue where the table is not being set as we need to
reference the patron object in the guarantor info to obtain the id.

To test:
1 - Set system preference: AllowStaffToSetFinesVisibilityForGuarantor to
    allow
2 - Find a patron
3 - Add some fines to their account
4 - Install and enable an opac payment plugin
    (https://github.com/bywatersolutions/koha-plugin-pay-via-govolution
    for example)
5 - Sign in to OPAC as borrower
6 - Go to 'Charges' tab
7 - Select a fee
8 - Confirm 'Make payment' button enabled and 'amount to pay' is
    updated
9 - Add a guarantee to patron in staff interface
10 - Set 'Show charges to guarantors' to 'Yes'
11 - Add and pay a fine for the child
12 - View guarantor account on the OPAC
13 - Confirm you now see child's charges
14 - Confirm selecting your own fees does not enable the button or
     update amount to pay
15 - Note JS error in console
16 - Apply patch
17 - Reload patrons page
18 - Confirm the table loads correctly (no JS error)
19 - Confirm selecting a fine updates the total and enables button
20 - Disable the payment plugin
21 - Confirm the display is still correct, no errors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3e40408ea6792186e87e95a7de1dff515981432)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c61c182fda90cf2349be55a1c090a95daa42aa42)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34764: Set fee_acknowledged to expect a string
Martin Renvoize [Tue, 12 Sep 2023 13:18:37 +0000 (14:18 +0100)]
Bug 34764: Set fee_acknowledged to expect a string

For consistency with other options I opted to have the fee acknowledged
parameter to expect a string and as it's an optional parameter I've
dropped the default value of 'N' too.

Test plan
1) Prior to this patch
1a) Attempt a checkout without passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will be '|BON', the default
1b) Attempt a checkout passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will still be '|BON', failure
1c) Attempt a checkout passing a string for fee_acknoewledeged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will still be '|BON', failure
2) Apply the patch
2a) Attempt a checkout without passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m checkout`
    The optional `|BO` element should not be present
2b) Attempt a checkout passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged N --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will now be '|BON', success
2c) Attempt a checkout passing a string for fee_acknoewledeged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will now be '|BOY', success

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0e9603bb49436e4bb74e893f74a63ef31065f798)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7c07d7b6a6a6ccdd73bab0f5199fdaf408c085e6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34532: Silence warns in Patroncard.pm
Lucas Gass [Mon, 14 Aug 2023 21:11:52 +0000 (21:11 +0000)]
Bug 34532: Silence warns in Patroncard.pm

To test:

1. Go to patron card creator and make a patron card batch, card layout, and card template.
2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate.
3. Now go create a card batch while tailing the plack-intranet-error log/
4. Notice in the logs:

[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109.
[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248.
[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249.

5. Apply patch, restart_all
6. Try again and notice the WARNS should be gone from the logs now.
7. Make sure you can still create patron cards and the PDF's the generate look right.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1164402b49bfb775a7aafab55b629ae443bddf1c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fb988b42c4a61676609aded9e85f9b42e1e66cac)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoUpdate release notes for 22.11.10 release v22.11.10
Matt Blenkinsop [Thu, 28 Sep 2023 11:34:01 +0000 (11:34 +0000)]
Update release notes for 22.11.10 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoIncrement version for 22.11.10 release
Matt Blenkinsop [Thu, 28 Sep 2023 11:26:12 +0000 (11:26 +0000)]
Increment version for 22.11.10 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoFix translations for Koha 22.11.10
Matt Blenkinsop [Thu, 28 Sep 2023 10:59:51 +0000 (10:59 +0000)]
Fix translations for Koha 22.11.10

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoTranslation updates for Koha 22.11.10
Koha translators [Thu, 28 Sep 2023 09:49:40 +0000 (06:49 -0300)]
Translation updates for Koha 22.11.10

(cherry picked from commit f4af2f3f8d6184f10051aea7e0788573c81799a0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34369: Fix 'Did you mean'
Jonathan Druart [Thu, 3 Aug 2023 08:01:32 +0000 (10:01 +0200)]
Bug 34369: Fix 'Did you mean'

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: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34369: Pass csrf token from syspref API client (for Vue app)
Jonathan Druart [Tue, 1 Aug 2023 07:12:10 +0000 (09:12 +0200)]
Bug 34369: Pass csrf token from syspref API client (for Vue app)

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: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34369: Require CSRF token for updating system preferences
David Cook [Tue, 1 Aug 2023 06:56:23 +0000 (06:56 +0000)]
Bug 34369: Require CSRF token for updating system preferences

This patch adds the requirements that updating a system preference
requires a CSRF token. (Also, adding and deleting local system preferences.)

0. Apply patch
1. koha-plack --reload kohadev
2. Add local system preference
3. Update local system preference
4. Delete local system preference
5. Update normal system preference
6. Note no errors

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: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34761: Prevent XSS for searches and saved search filters
David Cook [Wed, 13 Sep 2023 01:33:43 +0000 (01:33 +0000)]
Bug 34761: Prevent XSS for searches and saved search filters

</script> tags are interpreted in JSON strings as HTML, which can
lead to XSS attacks.

This patch puts HTML escaped JSON in the value of a hidden HTML element.
The Javascript then takes the value as a string, parses it as JSON,
and is able to use it to save search filters without triggering a
XSS attack.

This patch also adds DataTable's built-in HTML escaping for the query
and limits on the admin UI for the search filters.

Test plan:
0. Apply patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=SavedSearchFilters
2. Enable the system preference
3. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e
4. Click "Save search as filter"
5. Checkbox "Show in staff interface?"
6. Type "E-TEST" into box and click 'Save'
7. Go to
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e
8. Click "E-TEST" under "Custom search filters"
9. Note that you see search results
10. Go to
http://localhost:8081/cgi-bin/koha/admin/search_filters.pl
11. Note that for "E-TEST" you see a "Query" like
{"operators":[],"operands":["e"],"indexes":[]}
12. Note that for "E-TEST" you see a "Limits" like
{"limits":[]}

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4e32b761986f5de28df4f1125b5d16c6c2f24306)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34349: Validate/escape inputs for task scheduler
David Cook [Mon, 24 Jul 2023 04:31:15 +0000 (04:31 +0000)]
Bug 34349: Validate/escape inputs for task scheduler

This change validates and escapes inputs for task scheduler.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. Go to http://localhost:8081/cgi-bin/koha/tools/scheduler.pl
3. Input a time a minute in the future and leave the date blank
4. Choose an existing report and output format
5. Type a malicious string which is also a valid email address
into the Email field
6. Click "Save"
7. Note that the job is added but the Email is wrapped in single
quotes
8. Try using a non-malicious email address with a single quote.
9. Note that the single quote is escaped, so that it will still
be used by runreport.pl

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed pars for $email =~ regex, removed old commented lines.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dcd698a4b4ed7f3a714ef35fe83c007fce9d52ae)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34513: (QA follow-up) Tidy
Nick Clemens [Thu, 24 Aug 2023 18:19:37 +0000 (18:19 +0000)]
Bug 34513: (QA follow-up) Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 332b95b2507184e20cd70ddfb16c6f5a260d6dc0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34513: Add checkauth unit test for resetting auth state when changing users
David Cook [Wed, 16 Aug 2023 02:51:43 +0000 (02:51 +0000)]
Bug 34513: Add checkauth unit test for resetting auth state when changing users

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit abbbc5924de287a73c7d91c0f8ab70f8d7461508)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34513: Add end-to-end test for authorization check after first failed authorization
David Cook [Wed, 16 Aug 2023 02:21:40 +0000 (02:21 +0000)]
Bug 34513: Add end-to-end test for authorization check after first failed authorization

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bb581fe78be9dacb9215366f3a54ab9b640f783f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34513: Set auth state correctly when changing auth sessions
David Cook [Fri, 11 Aug 2023 03:03:01 +0000 (03:03 +0000)]
Bug 34513: Set auth state correctly when changing auth sessions

This patch sets the $auth_state to failed when changing auth sessions,
so that the new login attempt gets processed correctly (instead
of skipping the authorization step).

Test plan:
0. Apply the patch
1. koha-plack --reload kohadev
2. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=baseurl
3. Log in as an OPAC user with 0 permissions
4. Note the auth screen "Error: You do not have permission to access this page"
5. Click "Log in"
6. Note that you're still shown a login screen (and that you've been logged out of
your previous authenticated session)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 16da12cbbc200d9ef07a87ee7f9bdf8e61ae06f3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34552: Don't exclude payments with no status
Nick Clemens [Fri, 25 Aug 2023 15:51:12 +0000 (15:51 +0000)]
Bug 34552: Don't exclude payments with no status

Bug 29664 removed payments with a void status, however, the query also
removed any payments with no status set

Test Plan:
1 - Set up your cash registers and enable POS and add a debit type that is able to be sold
2 - Take 2 payments via POS
3 - Void one payment
4 - Go to Reports->Statistics wizards->Cash register
4) Verify neither shows for the "All payments to the library" and
   "Payment" transaction type filters
5) Apply this patch
6) Restart all the things!
7) Verify the non-voided fee shows for the "All payments to the library" and
   "Payment" transaction type filters and the voided fee does not

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6ee6bea6bfee301146dc2f631480b227d237e43a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7d977be3e9431ee7f7e7c58a2889189ef648966b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34219: (rmaint fix) Remove embed from vendors getAll request
Matt Blenkinsop [Tue, 26 Sep 2023 15:32:03 +0000 (15:32 +0000)]
Bug 34219: (rmaint fix) Remove embed from vendors getAll request

An embed that is not supported in 22.11 was added as part of a refactoring patch. This commit removes that embed to allow the ERM module to function properly

13 months agoBug 34666: (Rmaint follow-up) Fix unit test
Matt Blenkinsop [Fri, 15 Sep 2023 14:01:17 +0000 (14:01 +0000)]
Bug 34666: (Rmaint follow-up) Fix unit test

Unit tests were failing as 22.11.x does not have bug 31375 backported. An undef parameter needed passing to the function to simulate this

13 months agoBug 34502: Remove useless SEARCH_RESULT.localimage
David Cook [Wed, 9 Aug 2023 01:06:05 +0000 (01:06 +0000)]
Bug 34502: Remove useless SEARCH_RESULT.localimage

This patch removes a useless Template Toolkit tag.

To test:
0. Apply the patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=LocalCoverImages
2. Change to "Show"
3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
4. Upload an image
5. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test
6. Note that the local cover image appears even without the TT tag

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9da5895d79163a518825fbb102526aef119a93fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2af5c36bbc71a8521b38002f7840f7492c902618)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 32765: Retry transfer after cancelling hold
Julian Maurice [Tue, 31 Jan 2023 08:20:15 +0000 (09:20 +0100)]
Bug 32765: Retry transfer after cancelling hold

When trying to manually transfer an item that is on hold, we have the
choice to cancel the hold and try the transfer again. When choosing
this option, the hold is correctly cancelled but the transfer is not
tried again.
This patch fixes that

Test plan:
1. Place a hold on a specific item
2. Try to transfer it manually (Circulation » Transfer)
3. Choose the option to "Cancel hold and then attempt transfer"
4. See that the hold was cancelled, but no transfer was made
5. Apply the patch
6. Repeat step 1-3
7. See that the hold was cancelled, and the transfer was made

Signed-off-by: Nicolas Giraud <nicolas.giraud@inlibro.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 68b97cc7e4c60e6b84b9a7554e29c1c32453f685)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4352e97a282ce89708af61970e89ca80daf87bc2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34223: (follow-up) Ensure consistent ordering of statuses
Martin Renvoize [Mon, 11 Sep 2023 13:50:43 +0000 (14:50 +0100)]
Bug 34223: (follow-up) Ensure consistent ordering of statuses

This patch adds an order_by clause to ensure consistent ordering of the
returned status and status_alias statuses from the database between
MySQL 8 and other DB engines.

This fixes the failing tests introducd in bug 34223.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7f9ff906d9c2800fc5bf3d38db23a77e1f3745ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9b1ff4d540e38c984d785ae10b56639163fe9633)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34572: Simplify template logic around check-in input form
Owen Leonard [Fri, 18 Aug 2023 07:40:16 +0000 (07:40 +0000)]
Bug 34572: Simplify template logic around check-in input form

This patch makes a minor simplifying change to the check-in template
around how to style the barcode input field in dropbox or fine-exempt
mode.

To test, apply the patch and go to Circulation.

- If necessary, check some items out to patrons so that you have items
  to check in.
- Go to the check-in page and click the icon inside the barcode field to
  expand the panel of options.
- Check the "book drop mode" checkbox. The barcode field should now be
  highlighted yellow.
- Check in an item. When the page redisplays, the barcode field should
  have the same highlighted style.

- If necessary, enable the finesMode system preference.
- On the check-in page, in the panel of options, check the "Forgive
  overdue fines" checkbox. Test checking in again, confirming the same
  style consistency in the barcode field.

Signed-off-by: Inkeri <inkeri.hakulinen@helsinki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit edb9787fc85752c636e0d982871c4b715a2e57d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit edf7c6766128067ec8e28109f575c932e7707d48)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34723: Show thumbnails on opac-imageviewer.pl when imagenumber not provided
David Cook [Wed, 6 Sep 2023 06:28:45 +0000 (06:28 +0000)]
Bug 34723: Show thumbnails on opac-imageviewer.pl when imagenumber not provided

This patch fixes a method call in the opac-imageviewer.pl so that thumbnails
correctly appear.

Test plan:
0. Apply the patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=localcover
2. Change both *LocalCoverImages sysprefs to "Show"
3. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=AllowMultipleCovers
4. Change "AllowMultipleCovers" to "Allow"
5. Go to
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Click "Images (0)" tab
7. Download or make two JPEG images
8. Upload the images
9. Go to http://localhost:8080/cgi-bin/koha/opac-imageviewer.pl?biblionumber=29
10. See one large image in the centre and two smaller thumbnails on the right side

PA amended patch: Added missing test plan step

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 00edf9a541c6d512682f19db7120c808d60a4bf2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eba9d58734553cd3e4051475407d56e2cc9164e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34079: The phrase "Displaying [all|approved|pending|rejected] terms" was separated
Caroline Cyr La Rose [Wed, 21 Jun 2023 14:59:47 +0000 (10:59 -0400)]
Bug 34079: The phrase "Displaying [all|approved|pending|rejected] terms" was separated

This patch reunites the words for the sentence "Displaying
[all|approved|pending|rejected] terms" in order to facilitate
translating in languages that have a different syntax.

To test:
1. Install a new language

   ./misc/translator/translate install xx-XX

2. Check the xx-XX-staff-prog.po file for the sentence
   --> All the words are individual strings

3. Apply patch

4. Update the po files

   ./misc/translator/translate update xx-XX

5. Check the xx-XX-staff-prog.po file again
   --> The sentence is reunited for each status (Displaying all terms,
       Displaying approved terms, etc.)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 272a080cb35fe83e9f11ab8401effb7223f5d94c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 48282124fac08d26382c77b491bdf75828360b33)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34081: Contextualization of "Approved" (one term) vs "Approved" (more than one...
Caroline Cyr La Rose [Wed, 21 Jun 2023 16:27:12 +0000 (12:27 -0400)]
Bug 34081: Contextualization of "Approved" (one term) vs "Approved" (more than one term), and other tag statuses

To test:

1. Apply patch

2. Install language

   ./misc/translator/translate install xx-XX

3. Update po files

   ./misc/translator/translate update xx-XX

4. View the xx-XX-messages.po file

   --> Strings for tag statuses for one tag should be separated from
       strings for statuses for multiple tags, with context Tags
       (single) or Tags (multiple)

5. Change the strings so you know which is which

   For example, in French, the approved status for a single tag would
   be "Approuvé" and for multiple tags would be "Approuvés" (with the
   plural s at the end)

6. Apply translations

   ./misc/translator/translate install xx-XX

7. Add tags through the OPAC
   7.1. In another tab, go to the OPAC
   7.2. Log in
   7.3. Search for a record
   7.4. From the detailed record, click Add tags
   7.5. Enter a tag and click Add

8. In the staff interface, go to Tools > Tags

9. Approve/Reject the tag
   --> The status in the table and on the button should be the singular
       status, the status in the summary on the right should be plural

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d23be933f958bf4b3343c41802530088afc0b1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff89574592f7a387cc1c2cc5bdb168cd2b1f9361)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34257: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Sun, 3 Sep 2023 23:06:23 +0000 (01:06 +0200)]
Bug 34257: (QA follow-up): tidy up code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9254af7b41349d563d526a0eeac946464dfef7b4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 70ffc2c6fa71f321552176b8998382b1a1f74dc4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34257: Limit item types by branch in batchMod.pl
Lucas Gass [Fri, 18 Aug 2023 14:45:14 +0000 (14:45 +0000)]
Bug 34257: Limit item types by branch in batchMod.pl

To test:
1. Go to Item types administration.
2. Set some items types to be limited to a branch you are not logged in as.
3. Find some items from the branch you are logged in at and go to Batch item modification.
4. Add the barcodes and attempt to edit the item type to the one you limited in step 2.
5. You can change these item types to ones that your branch should not be able to.
6. Apply patch
7. Try steps 4 -5 again but this time you should not see item types in the dropdown that are limited to other branches.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 13d5ff94248df32623853ed2d87258f81edc0a8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b7e93600614770f16cc26da7c6ee50dd8ebc5e0f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34163: Handle both anonymous userenv when generating CSRF tokens
David Cook [Fri, 30 Jun 2023 02:50:17 +0000 (02:50 +0000)]
Bug 34163: Handle both anonymous userenv when generating CSRF tokens

An anonymous session might have a userenv which is undef or which is
a hashref of undef/empty values.

This patch generates the "anonymous" prefix for undef/empty 'id'
values, which prevents CSRF errors when logging in via OAuth2/OIDC
following a Koha logout.

Test plan:
Before applying patch:
1. Go to https://wiki.koha-community.org/wiki/Testing_SSO
2. Set up OpenID Connect realm, user, client, and Koha
integration to Keycloak for koha-testing-docker as noted in the wiki

3. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl?logout.x=1
4. Click on OIDC "Log in with XXXX" button and log into IDP
5. Note that you're not logged in and you instead see an error message like:
"There was an error authenticating to external identity provider wrong_csrf_token"

6. Apply patch
7. Go to "Sessions" section of the test realm in Keycloak
e.g. http://sso:8082/auth/admin/master/console/#/test/sessions
8. Click "Action" on the far right side of the screen
9. Choose "Sign out all active sessions"

After applying patch:
10. koha-plack --restart kohadev
11. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl?logout.x=1
12. Click on OIDC "Log in with XXXX" button and log into IDP
13. Note that you're logged in

14. prove t/Token.t
15. Note all tests pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f965db69f1b1aaa0afaf7a3a48723f7e87c5b32c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bde32f49272fe74f89e785cdc68c9b362d54bc24)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34448: Update the way we handle response in http-client.js
Pedro Amorim [Mon, 31 Jul 2023 14:57:06 +0000 (14:57 +0000)]
Bug 34448: Update the way we handle response in http-client.js

Test plan:
Before patch:
- Visit a non-existent ID i.e. /cgi-bin/koha/erm/agreements/999
- Visit a char ID i.e. /cgi-bin/koha/erm/agreements/abc

Apply patch:
Repeat above steps.

Run cypress tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a0fcd9ddacf7bce25912778746f9994c06cdabe)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34448: Update cypress tests
Pedro Amorim [Mon, 31 Jul 2023 15:04:09 +0000 (15:04 +0000)]
Bug 34448: Update cypress tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 767a004f03863bd93febd2260cb236d505f21ef5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34310: Input prompt in datatables column search boxes untranslatable
Owen Leonard [Thu, 20 Jul 2023 11:24:23 +0000 (11:24 +0000)]
Bug 34310: Input prompt in datatables column search boxes untranslatable

This patch corrects the internationalization function wrapped around the
"% search" string in datatables.js. It should be the double-underscore
function instead of the single-underscore.

To test, apply the patch and test that the placeholder string is
translatable. In this example I'm testing fr-FR:

- Update a translation:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
  - Locate strings pulled from prog/js/datatables.js for
    translation, e.g.:

    \#: koha-tmpl/intranet-tmpl/prog/js/datatables.js:894
    \#, javascript-format
    msgid "%s search"
    msgstr "%s recherche"

  - Install the updated translation:

    > perl translate install fr-FR

In the staff interface, test a page that has column header filters, e.g.
patron search. Confirm that the table of search results shows the
translated string in the column header placeholders.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c23f36b81218032ed2aa3f2f476fd880e2d1b704)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d1d9a3353502101e6d86411eafe0988bdf2e9185)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34666: Tidy
Nick Clemens [Tue, 5 Sep 2023 14:38:38 +0000 (14:38 +0000)]
Bug 34666: Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fcf0ba17b55be93c4b63b1683ca2960e5edda0cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63434d59e8e4db3e918371b2ff814925bfca6ad4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34666: Combine queries in _Findgroupreserve
Nick Clemens [Wed, 30 Aug 2023 18:56:59 +0000 (18:56 +0000)]
Bug 34666: Combine queries in _Findgroupreserve

The queries here are the same except for 2 differences:
1 - They check if the hold was on a particular item
2 - The latter confirms that the reserve item group matches the item's item group

For 1, it doesn't matter - only 1 item can be mapped ot a reserve, itemnumber is the primary key
for hold_fill_targets - so we are either matching it in the first query or the second, either way we get the same
reserve - the returns are the same so we don't care which query it came from

For 2, this has already been checked when the queue was built. We don't need to verify the match because
it wouldn't be in the targets if they didn't match

To test:
1 - Apply second unit test patch
2 - prove t/db_dependent/Reserves.t
3 - It should pass
4 - Apply this patch
5 - prove t/db_dependent/Reserves.t
6 - It continues to pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72bfb416d3725bd11dc4595ac429d4c510d6d3ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7aa6464c239873cb52dee11fd079280eea944b62)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34666: Add a second unit test for item level
Nick Clemens [Wed, 30 Aug 2023 18:54:15 +0000 (18:54 +0000)]
Bug 34666: Add a second unit test for item level

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f7ccdf6c3d4916ac19b7ace58068ff862a5ee24)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 91d9a154850a7a2fa9a1d233c555262a01ecef18)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34666: Allow item_group to be null and still match
Nick Clemens [Wed, 30 Aug 2023 18:38:56 +0000 (18:38 +0000)]
Bug 34666: Allow item_group to be null and still match

The current logic requires that the grop ids match, but this eliminates null matches
from the group.

The fallout essentially is that the queue won't be checked to fill holds in cases of title level matches
where holds don't have an item group id. The queue checks the transport cost matrix while the check reserves
check does not, so this may have an impact on holds costs and delivery times

To test:
0 - Apply unit test patch
1 - prove -v t/db_dependent/Reserves.t
2 - It fails
3 - Apply this patch
4 - prove -v t/db_dependent/Reserves.t
5 - It passes!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fe3872f62885b4b0ee483e446c0b2b85e74970f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f4641ea97228966cc5b7a54e1bfda2778b4d1a3b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34666: Unit test
Nick Clemens [Wed, 30 Aug 2023 18:29:27 +0000 (18:29 +0000)]
Bug 34666: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 99d7e55be67332fea1ced61ddf8105b4261923d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0cad18658a2b04513349b7c4c9740b77261f02a5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34038: Fix incorrect use of __() in .tt and .inc files
Owen Leonard [Fri, 16 Jun 2023 14:29:42 +0000 (14:29 +0000)]
Bug 34038: Fix incorrect use of __() in .tt and .inc files

This patch corrects instances of the double-underscore function being
used in .tt and .inc files where the single-underscore function should
be used instead.

To test, apply the patch and update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the strings are now in the .po file for translation. You
  should find these lines:

- koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc: "No
  title."
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt:
  "Check in and add to bundle"
  "Ignore holds and add to bundle"
- koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt:
  "Please enter only a barcode, or only a biblionumber."
- koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt:
  "Please enter only barcodes, or only biblionumbers."
- koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt:
  "Please specify a content for 'Default'"

- Check fr-FR-opac-bootstrap.po for these lines:

- koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc:
  "Please enter a valid date (should match %s)."
- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt:
  "No item was selected"
- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt,
  koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt,
  koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt:
  "No item was selected"

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d1d9f4698eb2f959964d83d22b2079f07286a7c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f558474af319b4d95898f3046ac646c9fdeaaae3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34223: (QA follow-up) Fix file permissions
Tomas Cohen Arazi [Wed, 6 Sep 2023 19:47:09 +0000 (16:47 -0300)]
Bug 34223: (QA follow-up) Fix file permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93dd749ecaf229a8860ba078668190e5bbfd61c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f4a9dbd1063477ccc7d5190071285fa7d639d5b6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34223: (follow-up) Mock backend in tests
Pedro Amorim [Thu, 27 Jul 2023 14:20:11 +0000 (14:20 +0000)]
Bug 34223: (follow-up) Mock backend in tests

Add a new request with a backend specific status

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b00806774d3353086fc7c7e3def22f4de570c795)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6151e6ee8cfb309412727c5bf3383eb2d9464fbe)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34223: Add unit test for existing_statuses
Martin Renvoize [Thu, 27 Jul 2023 12:20:13 +0000 (13:20 +0100)]
Bug 34223: Add unit test for existing_statuses

This patch adds a unit test for the 'existing_statuses' method.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cda13a73284ce049535f782dad794c6593e55ba9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4bec5acad4ab6bcd560e10b764c4ce4112d55946)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34223: (follow-up) Restore status_alias handling
Pedro Amorim [Thu, 27 Jul 2023 11:25:20 +0000 (12:25 +0100)]
Bug 34223: (follow-up) Restore status_alias handling

By reducing the original call to all distinct 'status' we also removed
the status_alias combinations. This patch adds an additional distinct
query to fetch all 'status_alias' and add them to the returned data
structure.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b67a4f8549d03a43ca771acc205779a78708240d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cec8ef7ae9e36893431cf5ef527ce012551f4bc6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34223: Work around ONLY_FULL_GROUP_BY in Illbackend
Martin Renvoize [Mon, 10 Jul 2023 17:03:34 +0000 (17:03 +0000)]
Bug 34223: Work around ONLY_FULL_GROUP_BY in Illbackend

This patch re-works the query in the existing_statuses method to remove
the FIXME and improve performance.  We pass an SQL literal into the
query to make it explicit which illrequest_id we're looking for (which
dampens the SQL warning) even though we really don't mind which request
is returned here.

Test plan:

The following command will (hopefully) reset your ILL data and create 10k fake ILL requests (run this in DEV KTD only).

1) On an empty k-t-d, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev-data.sh)
2) Pet a cat
3) Visit /cgi-bin/koha/ill/ill-requests.pl and select a backend on the left side filters
4) Notice how the status filter takes a while (3-5 secs) to load
5) Apply patch and koha-plack --restart kohadev
6) Repeat 3, notice how the status filter now loads fast

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 87d1b1fdb61ea27effbac654d55923bf6abbe1ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c145f874eb5695433dd3297400f9bc784932892a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34685: Make updatedatabase.pl propagate the error
Jonathan Druart [Fri, 1 Sep 2023 07:10:52 +0000 (09:10 +0200)]
Bug 34685: Make updatedatabase.pl propagate the error

updatedatabase.pl already return 0 even if an error occurred during the upgrade.

Test plan:
Adjust a db rev to make it fail and modify the value of the syspref 'version' in DB to
make the db rev run.

Run updatedabase.pl and `echo $?`

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 531fb2c9fd2e8b38ac1c6ef21be047bbb0358d7a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 706e1ed0925acc1a50816065594104deaba37b44)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34684: Prevent 220600007.pl to fail if run twice
Jonathan Druart [Thu, 31 Aug 2023 15:05:57 +0000 (17:05 +0200)]
Bug 34684: Prevent 220600007.pl to fail if run twice

The error is
  ERROR 1292 (22007): Truncated incorrect DECIMAL value: 'no'

Happens on MariaDB 10.5.22, not MySQL 8

Test plan:
update systempreferences set value="0" where variable="DisplayClearScreenButton";
play installer/data/mysql/db_revs/220600007.pl
select value from systempreferences where variable="DisplayClearScreenButton";
=> "no"

update systempreferences set value="1" where variable="DisplayClearScreenButton";
play installer/data/mysql/db_revs/220600007.pl
select value from systempreferences where variable="DisplayClearScreenButton";
=> "issueslip"

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 027e1e18620e3c790e85ea49b3870f9ee7785871)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f73ed6655d41c9a518ead7a9c42b4e882d33b186)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 30451: DBIC schema
Tomas Cohen Arazi [Wed, 6 Sep 2023 17:58:28 +0000 (14:58 -0300)]
Bug 30451: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9bb23b7d5e3606dad6e9b3976c3a1fad1cc2087a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0ef950ce269d1f1d25893c0f7ce1a44ad62864f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 23548: (QA follow-up) tidy up code
Victor Grousset/tuxayo [Thu, 31 Aug 2023 21:00:46 +0000 (23:00 +0200)]
Bug 23548: (QA follow-up) tidy up code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c6971d50cefa376df3a760519d1d9a8da1f5d71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9212e7580e80c6624d6fb76e4e999994d186843c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 23548: Set AQ to empty when item not exist
Per Larsson [Wed, 18 Sep 2019 08:50:37 +0000 (10:50 +0200)]
Bug 23548: Set AQ to empty when item not exist

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2256a8532335f763346f13698cb840dd97ecafa3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43022c87985f0d90f75e0a2d180e1011fc14b030)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 23548: Unit test - Set AQ to empty when item not exist
Matthias Meusburger [Thu, 17 Aug 2023 12:26:39 +0000 (12:26 +0000)]
Bug 23548: Unit test - Set AQ to empty when item not exist

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1cd82e29b5ceec08cf77f8c24497b1def1ee3c7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e362982884e2f9daa6e805e5629d0de321b5544e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34641: Fix Novelist display when NovelistSelectView is set to below
Lucas Gass [Tue, 29 Aug 2023 15:45:39 +0000 (15:45 +0000)]
Bug 34641: Fix Novelist display when NovelistSelectView is set to below

To test:
1. Have Novelist credentials:  NovelistSelectProfile,  NovelistSelectPassword.
2. Enable  NovelistSelectEnabled
3. Set  NovelistSelectView to 'below holdings table'.
4. Find a record on the OPAC that would have Novelist content. It does
   not display.
5. Set  NovelistSelectView to any except 'below holdings table'. Notice it displays the content.
6. APPLY PATCH
7. Try steps 1 -5 again, this time when NovelistSelectView is set to
   'below' the content should properly display.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0663e692cf022611a0be2c3e5ef5beb7eac10e5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 708cc3bccf84eaab2754b32974c80b326754d0f0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 22135: Display 'shelved out of order' error in inventory CSV export
Katrin Fischer [Mon, 29 May 2023 15:41:44 +0000 (15:41 +0000)]
Bug 22135: Display 'shelved out of order' error in inventory CSV export

When using the inventory tool with an uploaded barcode file
and checking the "Compare barcodes list to results",
"Check barcodes list for items shelved out of order" and
"Export to CSV file" checkboxes, the resulting CSV file showed
a blank in the "problem" column for items with out of order
callnumbers. With this patch, you'll see "Shelved out of order".

To test:
* Create 3 items with callnumbers and barcodes a, b, and c
* Go to Cataloguing > Inventory
* Enter a c b (each on its own line) into the barcode field
* Check "Compare barcodes list to results"
* Check "Check barcodes list for items shelved out of order"
* Check "Export to CSV file" (at the bottom)
* Verify the file has empty lines in the problem column
* Apply patch
* Repeat test, the empty lines should now read: "Shelved out of order"

Note: Also fixes "problem" to "Problem" to make capitalization
consistent. All those strings are currently not translatable,
this will be filed separately.

Co-authored-by: Mark Alexander <marka@pobox.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d35c3596da488b61f49fd605872de02f0f31fe4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b185fd3fe3801784186d9a35125f49d92960aa18)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34620: Do not throw expection if payment type is writeoff
Lucas Gass [Fri, 25 Aug 2023 15:49:09 +0000 (15:49 +0000)]
Bug 34620: Do not throw expection if payment type is writeoff

To test:
1. Turn on RequirePaymentType
2. Create a manual invoice and then attempt to write it off.
3. 500 error
4. Turn of RequirePaymentType, no error.
5. Apply patch, restart_all
6. Try step 2 again, you should not get an error
7. prove t/db_dependent/Koha/Account.t
8. Make sure tests pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d77aa887e4b9df61493837b9d88a80537c525471)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5cc97ab746463f9a48b54a6b5f9a81a83dc80d25)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34625: Fix search engine configuration tables header problem
Owen Leonard [Mon, 28 Aug 2023 12:26:51 +0000 (12:26 +0000)]
Bug 34625: Fix search engine configuration tables header problem

This patch corrects the JavaScript which allows DataTables to be created
and destroyed based on which tab is clicked on the search engine
configuration page. When you click from one tab to the other, the
original tab's DataTable should be destroyed and the new tab's DataTable
initialized.

To test, apply the patch and go to Administration -> Search engine
configuration (Elasticsearch)

- The page should load with the "Search fields" tab enabled and the
  DataTable initialized: Sorting and filtering should work. If you
  scroll down the page the floating table header should be correct.
- Switch to the "Bibliographic records" tab. This table should have
  filtering enabled, and the floating table header should work when you
  scroll down the page.
- The same should be true for the "Authorities" tab.
- Return to the "Search fields" tab to confirm that the DataTable is
  still working as expected.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cac122b6117d10f58fefa437a67b9f23ed9ab947)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 702356084a3e4726e27f3f03d468b628f87bf23b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34569: (QA follow-up) Tidy block
Tomas Cohen Arazi [Fri, 1 Sep 2023 15:04:23 +0000 (12:04 -0300)]
Bug 34569: (QA follow-up) Tidy block

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a707d10d8017cad5333a2eb5c0be784004874cd6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 99ac8d1ecb2bd73304cf3232ba8fb18270cd4dd1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34569: Fix misc/cronjobs/holds/holds_reminder.pl trigger arg
Fridolin Somers [Thu, 17 Aug 2023 20:42:31 +0000 (10:42 -1000)]
Bug 34569: Fix misc/cronjobs/holds/holds_reminder.pl trigger arg

misc/cronjobs/holds/holds_reminder.pl help says one can use arge -t for --triggered
But not implemented in code.
Should be like in misc/cronjobs/overdue_notices.pl :
  't|triggered'    => \$triggered,

Test plan :
Play with misc/cronjobs/holds/holds_reminder.pl with arg -t and
--trigger

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f4f4feb50b3d2b58b9212b692daf2c4e3e000b7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d019a68079ccaf2948561e73fee619d1a9892251)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34634: Show expirationdate of expired holds on reserve/request.pl
Lucas Gass [Mon, 28 Aug 2023 22:24:24 +0000 (22:24 +0000)]
Bug 34634: Show expirationdate of expired holds on reserve/request.pl

To test:
1. Place some holds and go to /reserve/request.pl for that bib.
2. If the reserves.expirationdate is set to today or some date in the past the date does not display in the Flatpickr instance.
3. Change the reserves.expirationdate to sometime in the future, the date displays.
4. Aply patch, restart_all
5. Try steps 2-3 again.
6. This time if the expiration date is in the past you should see it displayed. However it will be uneditable.
7. Make sure holds with a expiration date in the future can still be properly edited.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Christine <chlee@pascolibraries.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0710ccb606faba126acb7b7e62b2868b6a28cbb5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0594b63baebe2f8c0ff1acf605aa32da6f3e2a39)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34583: Overdue notice - wrong coding in outlook in czech e-mail in “print” mode
Petr Svoboda [Tue, 22 Aug 2023 13:13:18 +0000 (15:13 +0200)]
Bug 34583: Overdue notice - wrong coding in outlook in czech e-mail in “print” mode

Koha overdue notice “print” email in Outlook is incorrectly encoded in czech language.
Tested in KohaTestingDocker - https://gitlab.com/koha-community/koha-testing-docker
This patch fixes that error.

Test plan:
Overdue notice, set print in UI, https://snipboard.io/FLkIxf.jpg.

Message body:
<table style="padding:0; margin: 0; border-collapse: collapse; font-family: 'Trebuchet MS', Helvetica, sans-serif; width: 100%; "><tr><td style="vertical-align: top; padding: 0"> </td><td style="width: 75mm; vertical-align: top;"><table style="margin-top: 2.5cm; font-size: 11pt;"><tr><td><<borrowers.cardnumber>></td></tr><tr><td><<borrowers.firstname>> <<borrowers.surname>></td></tr><tr><td><<borrowers.address>> <<borrowers.streetnumber>></td></tr><tr><td><<borrowers.city>></td></tr><tr><td><<borrowers.zipcode>></td></tr></table></td></tr><tr><td colspan="2" style="padding: 0;"><table style="width: 100%; margin: 3cm 0 0 0;"><tr><td style="width: 5mm; height: 5mm; border-bottom: 1px dotted #000;"> </td><td style="height: 1mm;"></td><td style="width: 5mm; height: 1mm; border-bottom: 1px dotted #000;"> </td></tr></table></td></tr><tr><td colspan="2"><table><tr><td style="padding: 0.5cm 0.3cm">V Chrudimi dne <<today>></td></tr><tr><td style="padding: 0 0.3cm">Upozorňujeme Vás, že byla již o 30 dnů překročena doba, na kterou jsme Vám půjčili dokumenty (celkem<<count>>). Žádáme Vás o brzké vrácení těchto výpůjček:</td></tr><tr><td style="padding: 0.5cm 0.3cm;"><table><tr><th>Od</th><th>Do</th><th>Název</th><th>Autor</th><th>Částka</th></tr><item><tr><td><<issues.issuedate>></td><td><strong><<issues.date_due>></strong></td><td><<biblio.title>></td><td><<biblio.author>></td><td><<items.fine>> Kč</td></tr></item></table></td></tr><tr><td style="padding: 0 0.3cm">Zpozdné je účtováno dle ceníku knihovny.</td></tr><tr><td style="padding: 0 0.3cm">Dokumenty můžete vrátit na jakémkoli oddělení knihovny a pobočce v jejich provozní době.</td></tr><tr><td style="padding: 0 0.3cm">Nesplní-li čtenář svou povinnost vyrovnat závazky s knihovou, má knihovna právo postupovat podle příslušných ustanovení občanského zákoníku.</td></tr></table></td></tr></table>

Set delay 1 day, https://snipboard.io/boAd3F.jpg.

Checkout any book.

Set in database issues->date_due = today() - 1
for checkouted book, https://snipboard.io/PrylGB.jpg.

Run this scripts:

koha-shell kohadev -c "/kohadevbox/koha/misc/cronjobs/overdue_notices.pl -v -t"

You must have KOHA set up for sending e-mails (SMTP server). Replace xxx@email.cz to your e-mail and run this script:

koha-shell kohadev -c "/kohadevbox/koha/misc/cronjobs/gather_print_notices.pl /var/spool/koha/kohadev/ --email xxx@email.cz"

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c3a0b9131f3a0df92d1aba4b2548ab3ffbc9980)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 77a5baf94fc76cc7df598032c8d26a29442d4874)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34266: Add unit tests
Julian Maurice [Thu, 13 Jul 2023 08:58:42 +0000 (10:58 +0200)]
Bug 34266: Add unit tests

Signed-off-by: joubu <xxx@example.org>
Signed-off-by: tuxayo <victor@tuxayo.net>
Took the opportunity to perltidy this file as I was signing off

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added a rollback. Shouldnt harm :)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3d0e443ce7a90687077c73b5d5a7116d4401d71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d3f6681c5d100ac40a706b4196e1f65dea227be)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34266: Default to biblioitems.itemtype only if it's a valid itemtype
Julian Maurice [Thu, 13 Jul 2023 07:22:44 +0000 (09:22 +0200)]
Bug 34266: Default to biblioitems.itemtype only if it's a valid itemtype

biblioitems.itemtype can contain values that are not itemtypes (for
instance if the MARC field mapped to it uses another authorised value
category)
This patch checks that before using it as a default value for the
'itemtypes' item subfield.

Test plan:
0. Do not apply the patch yet
1. Change your MARC framework so that the field linked to
   biblioitems.itemtype uses an authorised value category different from
   'itemtypes'
2. Make sure that you have an item subfield linked to the authorised
   value 'itemtypes' in your MARC framework
3. Create a biblio with an itemtype (using a value that is NOT an item
   type, but a value from the authorised value category you selected in
   step 1)
4. Create a new item for this biblio. Notice that the biblio itemtype is
   automatically selected for the 'itemtypes' subfield
5. Apply the patch
6. Create a new item for the same biblio. Now the 'itemtypes' subfield
   should be empty.
7. Revert the change at step 1 so that your biblioitems.itemtype MARC
   field uses the 'itemtypes' AV category
8. Modify your biblio to use a valid item type.
9. Create a new item. The biblio itemtype should be used as a default
   value

Signed-off-by: joubu <xxx@example.org>
Signed-off-by: tuxayo <victor@tuxayo.net>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 807c58d28d7be4fa1a9606cd6cf2f59f661249ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 27fa85423e87be084b22a974f80984493641272d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34617: Preserve calculated expiration dates if set to update on import whether...
Nick Clemens [Fri, 25 Aug 2023 14:51:28 +0000 (14:51 +0000)]
Bug 34617: Preserve calculated expiration dates if set to update on import whether column included or not

To test:
1 - Setup a csv with column headers:
    surname firstname branchcode categorycode cardnumber dateenrolled
2 - add values
    Acosta Edna CPL PT 23529001000463 02/01/2013
3 - Set PT catgeory enrollement period to a specific date in the future
4 - Import the file and overwrite patrons and update dateexpiration
5 - Check Edna, note her date is not correct
6 - Apply patch
7 - Repeat
8 - Expiration date is now set as expected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ed2b395a1084d9c064e1631f3f68215ce9df7702)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0cdabc65f0494252cfb391f88888ae732a2bfd4c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34617: Unit tests
Nick Clemens [Fri, 25 Aug 2023 14:51:23 +0000 (14:51 +0000)]
Bug 34617: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b38780f6cb0ec0cddc0fdbf8cc2c1a3c6dcecfb6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6a9c3eeeb4166fa267853100f278d2027a202a22)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34646: Fix two attributes class in OPAC masthead-langmenu.inc
Fridolin Somers [Tue, 29 Aug 2023 17:59:05 +0000 (07:59 -1000)]
Bug 34646: Fix two attributes class in OPAC masthead-langmenu.inc

In OPAC template masthead-langmenu.inc a link as two class attributes :
  <a class="dropdown-item" href="#" tabindex="-1" class="menu-inactive" role="menuitem">

Test plan :
1) Go to OPAC with at least one translation
2) Look at HTML source code
=> Without patch you see a link with 2 class attributes
=> With patch you see the 2 classes in same class attribute

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8c63a4bb049b663bb94769b5f5e78ba85ca9918f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e61fd088d32f568efacc528acadf8c9e3f5dbc0e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 33316: (QA follow-up) Add link to record, fix typo and heading
Katrin Fischer [Mon, 10 Apr 2023 16:38:14 +0000 (16:38 +0000)]
Bug 33316: (QA follow-up) Add link to record, fix typo and heading

* h2 h2 directly following each other make no sense. Changed to h2 h3
* ids changed to IDs
* Linked the record ID to the catalog entry
  Note: We also have this link in the batch record mod job details

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a80de2dc8379efa2a8fef761738779aaf4396647)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 33316: Improve display of ES indexer jobs
Nick Clemens [Wed, 22 Mar 2023 19:54:48 +0000 (19:54 +0000)]
Bug 33316: Improve display of ES indexer jobs

We don't do a lot of processing to the data, but we can still
make the display a bit nicer, to show how many records were
done, and show the record ids.

To test:
1 - Do some batch modifications on a system running ES
2 - Check background jobs to see ES jobs
3 - Note display
4 - Apply patch
5 - Confirm display is improved

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dad9430b7b062d25aec0cdeb86dd412133621d5f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002
Jonathan Druart [Wed, 30 Aug 2023 14:21:37 +0000 (16:21 +0200)]
Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 352a2afd0bf1b67c4c579d299c088604d131ae1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 10324fd58718e48b8caffbd73573842affdc4ad8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 33744: Fix cloning (sub)fields with framework plugins
Matt Blenkinsop [Tue, 16 May 2023 11:14:01 +0000 (11:14 +0000)]
Bug 33744: Fix cloning (sub)fields with framework plugins

This patch is meant as a temporary measure for fixing the problem.
Bug 30975 may resolve it further, but this is good for now.

Note: The original commit message referred to removing a deprecated internal
structure. But this patch actually still uses the structure which has been
moved to _data in jQuery now.

Test plan:
1) Apply patch
2) Repeat steps in the original bug description
3) This time clicking on the Upload button for a cloned field should launch the uploads pop up.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2fa6105779d02e9b7fa81bc0ea47bff51e9f3170)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e486548409e44becb9f3db660871345ddd134a6e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34650: Convert list toolbar delete into form POST
David Cook [Wed, 30 Aug 2023 00:28:53 +0000 (00:28 +0000)]
Bug 34650: Convert list toolbar delete into form POST

This patch adds a HTML form with a CSRF token to POST the list delete,
which is triggered by a click handler on the A element. The A element
is still needed for existing style reasons.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. In the staff interface, add a list
3. Go into that list (e.g. virtualshelves/shelves.pl?op=view&shelfnumber=X)
4. From the toolbar click the "Edit" dropdown
5. From the dropdown try either "Edit list" or "Delete list"
6. Note no CSRF error and operation completes as expected

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d3b7cf08949d5776b732f24cefcbe377260c281)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0c4fe03c2331e2fc255e955312fcd4c5c9606225)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34650: Remove unnecessary CSRF check on edit_form
David Cook [Wed, 30 Aug 2023 00:07:23 +0000 (00:07 +0000)]
Bug 34650: Remove unnecessary CSRF check on edit_form

The op "edit_form" doesn't change state. It just renders the edit
form. Therefore, it doesn't need a CSRF token/check.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit caf962fbaa4f52bfea12acfa02671cd6920f7a53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e81e765d7da1b3e34ba4976c2fa6264e658d0044)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34609: Add missing test for Koha::Hold->biblio
Jonathan Druart [Thu, 31 Aug 2023 07:03:31 +0000 (09:03 +0200)]
Bug 34609: Add missing test for Koha::Hold->biblio

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cab415f0b3d363761e773c728e976470c81337a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d23e46f8c8fa517f2ec6066bcf5b7b270c161ba)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34609: Add biblio method to Old::Hold
Pedro Amorim [Wed, 30 Aug 2023 13:12:31 +0000 (13:12 +0000)]
Bug 34609: Add biblio method to Old::Hold

Test plan, clean k-t-d:

1) Add a reserve to koha/koha user, mysql run:
insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber)
VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76);

2) Add an old_reserve to koha/koha user, mysql run:
insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id)
VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1);

3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF
STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1
OPAC//cgi-bin/koha/opac-holdshistory.pl

4) Notice it blows up with a 500 error
5) Repeat step 3

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7b57163ef32e08179acd76b245b1b4f49aa93875)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7ea252ffa010e6dba469e939eab3b1f900dc9637)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34609: Add tests
Pedro Amorim [Wed, 30 Aug 2023 13:13:04 +0000 (13:13 +0000)]
Bug 34609: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eaa1a1d7e29d1421bf58f8215994e9ddfe8cdefa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 315927af8bcc461693a5fe22b8f5cc44fc9f0e90)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34466: Add listener to enable or disable clear filter button on KohaTable.vue
Pedro Amorim [Thu, 31 Aug 2023 16:18:56 +0000 (16:18 +0000)]
Bug 34466: Add listener to enable or disable clear filter button on KohaTable.vue

Test plan:
Apply only the cypress test patch
Run KohaTable_spec.ts
Notice it fails

Apply this patch, repeat

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5316b4c9cc1138c21a8ff05d2599784e2f6139ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0645519fafbcbecc3a347d97abda20a1485e62a4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 34466: Cypress tests
Pedro Amorim [Thu, 31 Aug 2023 16:14:45 +0000 (16:14 +0000)]
Bug 34466: Cypress tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 68baf8a7c13e77dc8fa5208665044498fa3f936c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e4ddce3f98f391be0f7059d2e9effe0382d91545)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
13 months agoBug 31964: add a man page for koha-z3950-responder
Andreas Roussos [Sun, 27 Aug 2023 23:42:49 +0000 (23:42 +0000)]
Bug 31964: add a man page for koha-z3950-responder

The koha-z3950-responder command does not have a man page.

This patch fixes that.

Test plan:

1) Apply this patch.

2) Run the following command to generate the new man page:

   xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/manpages/docbook.xsl debian/docs/koha-z3950-responder.xml

3) View the generated man page with `man -l koha-z3950-responder.8`

   (KTD users may need to `apt-get install man-db` first as
   that package provides tools for reading manual pages)

4) Make sure this unit test passes:

   prove -v xt/verify-debian-docbook.t

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb902d7a92b2e435890cff78c9c118a2a8280fa7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 306ec5c3e786960bf54f1bde20416a948a6813d4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 30362: (Rmaint fix) Fix failing test
Matt Blenkinsop [Fri, 1 Sep 2023 10:35:19 +0000 (10:35 +0000)]
Bug 30362: (Rmaint fix) Fix failing test

A change was introduced in bug 31375 which is not in 22.11.x. This patch rebases the test to remove that change and fix the failing test

14 months agoBug 30362: Fix unit test
David Cook [Thu, 20 Jul 2023 02:39:18 +0000 (02:39 +0000)]
Bug 30362: Fix unit test

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 95aa1c3da584c06ce439cc2d065e838790e7f6f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0fa0150b8a348c8b1ebab1308819e1ca1453675)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 30362: Unit test
Nick Clemens [Fri, 25 Mar 2022 15:18:27 +0000 (15:18 +0000)]
Bug 30362: Unit test

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 145788398ab6ef606bb9cb86a4783577b6f2d234)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a41958999886cd72899a432809adf45a104986e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 30362: Fix GetSoonestRenewDate to really return soonest renew date
David Cook [Thu, 20 Jul 2023 02:39:27 +0000 (02:39 +0000)]
Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date

This change fixes GetSoonestRenewDate so that it returns the soonest
renew date as calculated using "No Renewal Before" and "NoRenewalBeforePrecision".
In the past, it would only return the soonest renew date if "$now" was
lesser than it, which would typically only happen when using an "exact"
precision rather than a "date" precision.

Test plan:
0. Apply the patch
1. prove t/db_dependent/Circulation.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f8c474019d74c9fd608206daf3074a79c5737f12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8fc3531e079d076a3212b2aa76525b5ca6e874bd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoRevert "Bug 30362: Unit test"
Matt Blenkinsop [Thu, 31 Aug 2023 11:36:58 +0000 (12:36 +0100)]
Revert "Bug 30362: Unit test"

This reverts commit 038e88a4bd14ff4727e90f7d4a1db05be4755361.

14 months agoRevert "Bug 30362: Fix unit test"
Matt Blenkinsop [Thu, 31 Aug 2023 11:36:44 +0000 (12:36 +0100)]
Revert "Bug 30362: Fix unit test"

This reverts commit 4e90014d79130b7e9460dea4765f86960dabfa11.

14 months agoRevert "Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date"
Matt Blenkinsop [Thu, 31 Aug 2023 11:36:25 +0000 (12:36 +0100)]
Revert "Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date"

This reverts commit c31d9761740a51a7485b7592ae2c7110b32aed1f.