Commit graph

6527 commits

Author SHA1 Message Date
Matthias Meusburger
3205ac9a38 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 1cd82e29b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e362982884)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-09-15 09:50:31 +00:00
6c72cc1f21 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 d77aa887e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5cc97ab746)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-09-15 09:33:08 +00:00
Julian Maurice
1fb00fede2 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 a3d0e443ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d3f6681c5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-09-15 09:33:05 +00:00
609a553932 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 b38780f6cb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6a9c3eeeb4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-09-15 09:33:03 +00:00
cd7aece422 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 7cab415f0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d23e46f8c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-09-08 09:47:27 +00:00
1ffc2d4501 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 eaa1a1d7e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 315927af8b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-09-08 09:47:26 +00:00
17a013b72a 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 68baf8a7c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e4ddce3f98)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-09-08 09:47:26 +00:00
2b2f2aa8a3 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
2023-09-01 10:35:19 +00:00
a101c7da1a 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 95aa1c3da5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0fa0150b8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-08-31 13:34:29 +00:00
8bd50acd17 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 145788398a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a419589998)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-08-31 13:34:29 +00:00
0723661c87 Revert "Bug 30362: Unit test"
This reverts commit 038e88a4bd.
2023-08-31 12:36:58 +01:00
62246c041b Revert "Bug 30362: Fix unit test"
This reverts commit 4e90014d79.
2023-08-31 12:36:44 +01:00
91af482f49 Revert "Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date"
This reverts commit c31d976174.
2023-08-31 12:36:25 +01:00
9d8648eb4e Bug 34313: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eeef7839fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit edda7a23cb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-08-31 10:49:58 +00:00
c31d976174 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 f8c474019d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8fc3531e07)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-08-31 10:36:51 +00:00
4e90014d79 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 95aa1c3da5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0fa0150b8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-08-31 10:36:51 +00:00
038e88a4bd 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 145788398a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a419589998)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-08-31 10:36:50 +00:00
Katrin Fischer
8c0c469215 Bug 34345: (QA follow-up) Fix some more occurrences
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 19f9240759)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 876e970f4e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-08-31 09:46:41 +00:00
0f05cc4395 Bug 34024: (QA follow-up) Allow pickup location changing for in transit holds
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a05dff84eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7293368dfe)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-28 10:21:17 +00:00
c1a0603de1 Bug 34024: Unit tests
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3870b5a068)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 918c6ddb05)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-28 10:21:10 +00:00
Hammat Wele
9184e2e734 Bug 30846: (follow-up) Unit tests
Signed-off-by: Sam Lau <samalau@gmail.com>

Bug 30846: (Fix) Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 13d3e87503)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f5f4f80977)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-28 10:18:24 +00:00
803f435196 Bug 32739: Allow other patron identifier on pwd validation
This patch takes a step forward on the password validation endpoint, by
adding  the `identifier` parameter and making it be allowed
to be the patron's `cardnumber` or the `userid`.

The current `userid` only validation option is kept as-is.

The implementation relies on `C4::Auth::checkpw` to query for the
patron.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/password_validation.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 69653a281d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-28 10:07:15 +00:00
b7cc42789d Bug 32739: Unit tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 419d1d4fe9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-28 10:07:15 +00:00
Emily Lamancusa
77f55baa51 Bug 34435: Add unit test
To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.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 4203632582)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ef24af8da3)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
f940a14331 Bug 34365: Unit tests
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a8c43f975)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ffe0f84568)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:32:13 +00:00
Emily Lamancusa
04e8a6e8de Bug 34117: Add unit tests
To test:
prove t/db_dependent/Koha/Patron/Categories.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ff1430bb4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 33e046f41c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:30:46 +00:00
7cb0a706cc Bug 34279: Don't enforce overduefinescap unless it is greater than 0
When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine.

Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is.

Test Plan:
1) Apply the first patch ( unit tests )
2) prove t/db_dependent/Circulation/CalcFine.t
3) Note the test fails
4) Apply the second patch as well
5) prove t/db_dependent/Circulation/CalcFine.t
6) Note the test passes

Test Plan 2:
1) Create an all/all/all rule with an overduefinescap of 0.00, with a
   daily fine. Enable CalculateFinesOnReturn
2) Backdate a checkout so it is overdue
3) Return this item, note the lack of a fine
4) Apply this patch set
5) Backdate a checkout and return it again
6) Note the fine is generated!

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1763b136d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 662da18be2)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:37:11 +00:00
0860515897 Bug 34279: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8096ec9fff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e360c5637)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:37:04 +00:00
b3b62a5e1e Bug 32271: Unit test
Add a unit test for the allow blank option added to the monetary check
in CirculationRules.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 41274ef751)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d02637bec)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:36:06 +00:00
a72448805e Bug 33028: Unit tests
Add unit tests for is_monetary functionality introduced in the
CirculationRules module.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 88ccaaf3ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0d56eb1dc)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 16:02:03 +00:00
38725ed0af Bug 30524: (QA follow-up) Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 158edb411b32253fae4f068ce416d6ad4d1a67d3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 15:00:29 +00:00
26ab7e0b20 Bug 30524: (QA follow-up) Unit tests for GenerateCSRF()
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60d11ae7251a227fab3977ecd61cb01d0f062f79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d4187c77eb3b39977b759af7df7641e70cd96358)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:15:14 +00:00
0d245c936c Bug 30524: Unit tests
Test plan:
Run t/Output.t
Run t/db_dependent/Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2918f6ceda533719ac0da53d8245ea4826f43681)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9436074a26fe903134f71e66b0f9fcb7f6724438)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:14:15 +00:00
f26621c8c4 Bug 34303: Only perlcritic files from git repo
Test plan:
Run t/00-testcritic.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2bc251cfdd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 835bc43d31)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:25 +00:00
b5e51d1319 Bug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata
This adds a routine that can strip non xml characters form a record.
It is intended for cases where we do not wish to throw an exception,
but rather need to process a record to allow other work to continue

To test:
prove -v t/db_dependent/Koha/Biblio/Metadata.t

Signed-off-by: Sam Lau <samalau@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 4997d59c83)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9544bd25a2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:23 +00:00
69657cae57 Bug 34288: Unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fbc21148e7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e7c83d93cf)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:22 +00:00
7d1e4955fe Revert "Bug 33496: Add 'host_items' param to Koha::Biblio->items"
This reverts commit aac8c1e36e.
2023-07-19 10:52:40 +01:00
65e2308581 Bug 33974: (RMAINT fix) Fix bad rebase in biblios.t
A line has been missed when cherry-picking/rebasing commit 83a1fbac24

Line added and tests now passing
2023-07-19 08:42:08 +00:00
08741b6426 Bug 33727: (QA follow-up) perl tidy whole file
Test plan:
Run prove again. Run qa tools.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0f2a47d3c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8ecb70b338)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:28:28 +00:00
419d3ca563 Bug 33727: Merge both Calendar tests
The old t tests become part of the first subtest.

Test plan:
Run the new t/db_dependent/Calendar.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eb6c36c4d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6052f0ec17)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:28:28 +00:00
06a85cc894 Bug 33727: Groundwork for Calendar.t
Update test while removing need for Test::DBIx::Class.

Test plan:
Run t/Calendar.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e736a5d5f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d77d59fcaa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:28:28 +00:00
d2498373a6 Bug 34243: Fix copy/pasted city references in api tests
Two occurrences.
Just comments.

Test plan:
Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 308d75d05d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ef77656e85)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:28:27 +00:00
9e71c42a1e Bug 33817: Enforce server-side
Signed-off-by: Martin Renvoize <martin.renvoize@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 384de4a74a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e4ef4c5e3d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:20:52 +00:00
83a1fbac24 Bug 33974: Make biblioitem columns searchable in a generic way
This patch makes biblioitem attributes be searchable on the biblios
endpoint. It does so by using the new method in Koha::Biblios, and by
adjusting objects.search(_rs) to accept a $query_fixer arrayref of
functions to be applied to each query or order_by parameters.

The result is cleaner code to write, but complex internals.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass! Searching for biblioitem attributes works on the
API!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 353f328ad3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 21ebede0de)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:57 +00:00
bb9139ee0d Bug 33974: Add Koha::Biblios->api_query_fixer
This patch adds the `api_query_fixer` method to the class, and adds
tests to validate its behavior.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblios.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60e8998e91)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 949ba13a6e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:57 +00:00
d84e74c5a4 Bug 33573: Unit tests
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24d753cda1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f430c075c1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:55 +00:00
fa2b922934 Bug 34211: Add tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b86ad81bbf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d8326b64a3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:20 +00:00
21ac3587d1 Bug 27824: Add a test
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a91e80af7d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5f6f595af5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:20 +00:00
Aleisha Amohia
028c371b4c Bug 31147: Recalls should not adjust due time for related checkouts
The current recalls behaviour adjusts the due date of the most appropriate checkout based on the 'recall due date interval' circulation rule. It also adjusts the due time, which is buggy behaviour. The due date should be adjusted based on the circulation rule, but the due time should remain the same.

To test:

1. Enable the UseRecalls system preference and configure recalls-related circulation and fines rules
2. Check out Item A to Patron A
3. Log into the database and check the due date for that checked out item, e.g.

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be YYYY-MM-DD 23:59:00

4. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, at the exact time you placed the recall. This is buggy behaviour.

5. Apply the patch and restart services
6. Check in Item A, do NOT fulfill the recall
7. Cancel the recall

8. Check out Item A to Patron A
9. Log into the database and check the due date for that checked out item, e.g.

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be YYYY-MM-DD 23:59:00

10. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, with time of 23:59:00.

11. Check in Item A, do NOT fulfill the recall
12. Cancel the recall

13. Check out Item A to Patron A. Specify a due date and change the due time so it isn't 23:59.
14. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, with time you set in Step 13.

15. Confirm tests pass t/db_dependent/Koha/Recalls.t

Sponsored-by: Catalyst IT
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 780d6ecb51)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 023cbfde02)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:19 +00:00
4fae89c4c2 Bug 32801: Add tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b157a2cd7f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4041d06124)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:42 +00:00