Commit graph

6573 commits

Author SHA1 Message Date
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
5161f6e966 Bug 34094: (follow-up) Fix failing unit test
The unit tests were written to assume we always do a 'contains' search,
but the new system preference allows for 'starts_with' or 'contains'.

As such, for the tests to pass, we need to explicitly mock the
preference to 'contains'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b787e66fef)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 26e4866c9d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:42 +00:00
9d2f2a8124 Bug 33496: Add 'host_items' param to Koha::Biblio->items
This patch adds an option to the $biblio->items method to allow
retrieving the items and analytic items for a record. This is intended
to allow fetching a single Items object, and related object, rather than
having to fetch the items, and the host items, and push them together

This is step towards being able to fetch items using API/DataTables directly

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

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 8ff2e962b2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit aac8c1e36e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:27:57 +00:00
335f3ed00a Bug 33879: Add unit test to show problem
Test plan:
Run t/db_dependent/Auth.t without second patch.
Should fail:
    #          got: 'opac'
    #     expected: 'intranet'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7fda38647)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5377331f46)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:27:56 +00:00
a9b50d6b57 Bug 33404: Add unit tests
Test plan:
Run t/db_dependent/Breeding.t
Run t/db_dependent/Breeding_Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Amended patch: perltidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9cab7f1fc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fdcb386548)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:27:56 +00:00
jeremy breuillard
c1f054023e Bug 23775: Claiming a serial issue doesn't create the next one
Whenever we need to generate manually a new serial we go to page
'serials-edit.pl'. With this patch it is possible to generate a new
serial on page 'serials.pl'.

Test Plan:
-- Previously we need a serial which is in EXPECTED status & the Date
received should not be later than today --
1) On the intra. Make sure to have at least 1 subscription for a
   bibliographic record & 1 vendor linked
2) Then Home > Serials > Claims > Claims for <your_vendor_name>
3) Tick the checkbox of the row where the status is EXPECTED then
4) Click 'Send notification'
5) Notice the status of the row : it is now CLAIMED
6) To verify: Home > Serials > Serial collection information for
   <your_record_name>
7) Here the status is CLAIMED too but nothing happened around
8) Apply patch
9) Repeat from 2) to 6)
10) The status is still CLAIMED & the new serial with status EXPECTED is
    freshly generated

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 bd72f24d04)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e495547b8b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:00:04 +00:00
3f2effb2a7 Bug 31651: Adjust tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c93df98068)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d1e538c2cb)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 10:45:32 +00:00
4f66174249 Bug 33500: Add tests for RecordLocalUseOnReturn
To test:
1. Turn on RecordLocalUseOnReturn
2. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t
3. Tests fail.
4. Apply patch
5. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t
6. Tests pass.

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 2238d9f096)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b07fa2af06)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 10:40:25 +00:00
1213b9311f Bug 33176: Enforce bad values
1. Turn on RequirePaymentType
2. Create a manual invocie on a patron account
3. Go to pay it, 'Payment type:' is marked as required.
4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute.
5. You are able to make the payment without a payment type.
6. Apply patch and restart_all
7. Try 4-5 again. This time you should get a 500 error and the payment should not go through.
8. Try a paymnet again this time manipulate the DOM and change the value of 'CASH' to something else like 'SOMETHINGELSE'.
9. Try to submit the payment and again you will get a 500 error. The payment should not go through.
10. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful.
11. Make sure tests will pass

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 676d263687)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6be23e7251)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 10:08:37 +00:00
db6758b8c2 Bug 33176: Handle RequirePaymentType
Test plan:

1. Turn on RequirePaymentType
2. Create a manual invocie on a patron account
3. Go to pay it, 'Payment type:' is marked as required.
4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute.
5. You are able to make the payment without a payment type.
6. Apply patch and restart_all
7. Try 4-5 again. This time you should get a 500 error and the payment should not go through.
8. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful.
9. Make sure tests will pass:

prove -v t/db_dependent/Koha/Account.t

Signed-off-by: David Nind <david@davidnind.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 b15a15df9e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 98347e1612)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 10:08:20 +00:00
b315b82793 Bug 33844: Modify test to show problem
Add delete key.
Without the follow-up, this triggers a delete. Test fails.
DBIx::Class::Row::delete(): Not in database at /usr/share/koha/Koha/Object.pm line 234

Test plan:
Run t/db_dependent/Koha/Item.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: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2cc9fe3949)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 09:07:02 +00:00
46ef2e6f04 Bug 32478: (QA follow-up) Keep current hashref behavior
Prevent a crash on wrong contents for ItemsDeniedRenewal pref
as we did before.
Note: Could be a provisional measure (no band aid to repeat anywhere)
until we resolve this in preferences.pl.

Test plan:
Without this patch:
Change ItemsDeniedRenewal to 'nonsense'
Run perl -MKoha::Items -e'Koha::Items->find(X)->is_denied_renewal; print "OK\n"'
=> Replace X by a valid itemnumber
Crashes with: Can't use string ("nonsense") as a HASH ref ... No OK print.

Apply this patch
Run perl -MKoha::Items -e'Koha::Items->find(X)->is_denied_renewal; print "OK\n"'
=> Replace X by a valid itemnumber
Warns only with: Hashref expected for ItemsDeniedRenewal. You got OK.
Clear ItemsDeniedRenewal
Try again. No warning anymore.
Run t/Context.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 ab1cb8a3c0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:58:45 +00:00
27d5e594bc Bug 32478: (QA follow-up) Shebang and chmod for Koha/Config/SysPrefs.t
Test plan:
Run t/db_dependent/Koha/Config/SysPrefs.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 b4192a6525)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:58:37 +00:00
David Gustafsson
b99f0ce4cf Bug 32478: Fix syspref NULL values in tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 151c76eafb)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:58:28 +00:00
David Gustafsson
b7919fd525 Bug 32478: Remove Koha::Config::SysPref->find since bypasses cache
get_yaml_pref_hash also allows invalid YAML and only parses a limited
subset so remove this method to avoid future issues.

To test):

Since tests already exists for C4::Context->yaml_preference and this
is a trivial change, do we really need a test plan for this?

Sponsored-by: Gothenburg University Library
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 342d46e611)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:55:38 +00:00
67d27898df Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env
This patch includes a unit test which checks the memory address
of the $env hashref in middlewares before and after
Koha::Middleware::Env is applied.

It succeeds when the same $env is maintained before and after
this middleware. It fails if the $env has been overwritten with
a new hashref (as evidenced by the new memory address for the
hash).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c7142fe94)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f73dbd00ad)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:41:27 +00:00
fec8edbd3f Bug 33852: Add one more test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 144efca99d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a22ca6877e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:03 +00:00
7b825c7028 Bug 33852: Make jobs.t test the only_current parameter
This trivial patch adds a test to the only_current parameter.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/jobs.t
=> SUCCESS: New tests added, and pass
3. Sign off :-D

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 76983f5275)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8a5665d4b7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:02 +00:00
7ae673c286 Bug 32894: (QA follow-up) Fix tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4d613494ab)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit bf5ccb47fd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:20 +00:00
a6002b1090 Bug 32894: (follow-up) Koha::Item->last_returned_by
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ad94cf3e0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0e0d1f134d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:19 +00:00
0dead55b94 Bug 32894: Fix test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 45d882de53)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 278769067c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:18 +00:00
ff2e43f456 Bug 33904: Add tests
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 dfed7f235d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 80dec321bd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 08:51:23 +00:00
0a757c856a Bug 33416: Fix Searchbar_spec.ts
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5a39823dbc)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
(cherry picked from commit 5eec29d2da)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-13 09:04:56 +00:00
c521213b14 Bug 33416: Fix Agreements.ts
<failure message="Timed out retrying after 10000ms: Expected to find element: `#agreements_list table tbody tr:first`, but never found it." type="AssertionError"><![CDATA[AssertionError: Timed out retrying a
fter 10000ms: Expected to find element: `#agreements_list table tbody tr:first`, but never found it.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2167028025)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
(cherry picked from commit e1fbe67683)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-13 09:04:55 +00:00
David Gustafsson
b6f02212ae Bug 32060: Improve performance of columns_to_str
To test:
1) Ensure the following tests pass
  t/db_dependent/Koha/Item.t
  t/db_dependent/Koha/Bibio.t
2) Go to a biblio (preferably as serial) with many items and
   click "New" -> "New item" and note down the response time.
3) Apply the patch
4) Ensure tests in 1) still pass
5) Repeat step 2), the response time should be substantially
   improved

Sponsored-by: Gothenburg University Library

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: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 850f6f403b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-12 11:42:35 +00:00
3a21f93737 Bug 32464: (follow-up) fix t/db_dependent/Koha/Item.t
Remove useless unit tests with mss arg

Test with :
prove t/db_dependent/Koha/Filter/EmbedItems.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9117020143)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-12 11:42:34 +00:00
ded4859435 Bug 21983: Make DelBiblio update linked ILL requests
This patch makes DelBiblio update the biblio linked ILL requests so the
value in biblio_id is moved to the deleted_biblio_id.

The change is covered by tests.

To test:
1. Apply this patchset
2. Run:
   $ ktd --shell
  k$ updatedatabase
  k$ qa --run-tests
=> SUCCESS: Tests pass! All green/good
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0cf01b8a2)
2023-06-12 11:14:13 +00:00
862b84555a Bug 21983: Add Koha::Biblio->ill_requests
This patch adds a new method, used for retrieving the linked ill
requests for a biblio.

To test:
1. Apply this patch and run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a9759b3b0e)
2023-06-12 11:14:01 +00:00
ac012ea98c Bug 33697: Remove RecordedBooks (rbdigital) integration
RecordedBooks search API integration is now obsolete following
rbdigital's incorporation into OverDrive. Associated code should be
removed.

https://company.overdrive.com/2020/06/23/overdrive-to-acquire-rbdigital-from-rbmedia/

Test plan:
use git grep extensively and confirm that this patch removes all
occurrences of this feature.

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 8b9355088a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 33fdf290bb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-12 10:28:24 +00:00
164972d589 Bug 33411: (follow-up) Set debit type for mocked fines
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 56715cbb28)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-12 10:14:45 +00:00
a5a7ecd77e Bug 33411: Unit test update
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 638d79036c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-12 10:14:44 +00:00
c34e4acbc0 Bug 33761: (RMaint follow-up) Remove errant test from bug 31557 added by git)
A test from bug 31557 was introduced by git when cherry-picking 33761. As bug 31557 was not backported, this caused t/db_dependent/HoldsQueue.t to fail.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-09 11:11:30 +00:00
ea31cb1511 Bug 33815: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6cd6c7833e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-08 17:15:34 +00:00
4f28cd3227 Bug 33834: Fix random failure on api/v1/ill_requests.t
This patch makes the GET request results more deterministic so we avoid
random failures. It does so by adding a fixed value to each ILL request
and then sorting by it.

To test:
1. Run:
   $ DB_IMAGE=mysqli:8.0 ktd up -d
   # wait until it finished:
   $ ktd --logs
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/ill_requests.t
  (repeat a few times)
=> FAIL: It sometimes fails
3. Apply this patch
4. Repeat 2
=> SUCCESS: It doesn't fail
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1a8903ae85)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-08 17:15:33 +00:00
5052f9cec0 Bug 33362: Allow return claims to be resolved even if the issue has since been delete from the database
Test Plan:
1) Check out an item
2) Claim return on it, moving it to the old_issues table
3) Delete the old_issue via koha-mysql or Use cleanup_database.pl
4) Attempt to resolve the claim
5) Note the error
6) Apply this patch set
7) Restart all the things!
8) Attempt to resolve the claim
9) No errors!

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 816bbbe77f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-08 17:15:33 +00:00
0993144755 Bug 33791: (QA follow-up) Stick to 'item_id' for the parameter name
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d0195cef6c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-08 17:09:06 +00:00
fba7d4e5f7 Bug 33791: Add unit test
Test plan:
Run t/db_dependent/Koha/Hold.t
NOTE: This test should fail without following patch, but pass with it.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 306439b4c6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-08 17:09:05 +00:00
9bd219768e Bug 33777: Fix Auth_with_shibboleth.t
We need to 'mock' the new pref EmailFieldPrecedence

Test plan:
Run t/Auth_with_shibboleth.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 f436bc639c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-08 16:58:13 +00:00
90579d3c61 Bug 33761: Unit test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 67e9356dea)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-06-08 16:34:44 +00:00
2e1d7d0365 Bug 33719: Silence warnings on ContentWarningField in Search.t
Test plan:
Run t/db_dependent/Search.t

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f1b75d49bb)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-07 10:16:07 +00:00
0405071987 Bug 33718: Fix the mock of Koha::Config->get in mock_config
It should not mock calls for other sections than 'config' in
koha-conf.xml.

Test plan:
Without this patch:
[1] Enable AutoLinkBiblios, CatalogModuleRelink and LinkerRelink.
This will trigger a SearchAuthorities call when creating a sample biblio.
Note: SearchAuthorities calls Zconn and gets back information from
a wrong part of koha-conf.xml.
[2] Run t/db_dependent/Koha/Pseudonymization.t
You should see something like:
  {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 587. at /usr/share/koha/C4/Biblio.pm line 302

With this patch:
[3] Run t/db_dependent/Koha/Pseudonymization.t. Should pass now.
[4] git grep -l mock_config | xargs -i{} prove {}
    Exclude Mocks.pm.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit 50d3c3c0a8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-07 10:16:07 +00:00
8ca03273aa Bug 32648: Clear cache in Filter_MARC_ViewPolicy.t
Search.t is failing if run after Filter_MARC_ViewPolicy.t because of a
missing flush

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 434a73b0e6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-07 10:16:07 +00:00
3d4e74a9cd Bug 32775: (QA follow-up) remove useless empty line
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2928c1cf63)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-05 16:51:50 +00:00
73b0462d23 Bug 32775: (follow-up) Unit tests
Test plan:
1. Apply this patch and restart services
2. Run t/db_dependent/Languages.t
3. Notice tests 16 and 17 sometimes fail
4. Apply all the other patches and restart services
5. Run t/db_dependent/Languages.t
6. Notice all tests consistently pass

Sponsored-by: Kinder library, New Zealand
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 283cb0fd13)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-05 16:51:49 +00:00
027ecfa640
Bug 32878: (QA follow-up) Correct unit test
After the patch we fail on renewing a not for loan item with an item
level hold.

I don't find justification for why this should be renewable, so I just
change the test expectation

This needs another QA eye

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12939c7583)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-26 07:21:39 +01:00
ea289271d2
Bug 32878: (QA follow-up) Unit test
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a116216732)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-26 07:21:38 +01:00
70b8a7d2e0
Bug 33580: Bring back ability to mark item as seen via SIP2 item information request
Prior to Koha 22.05, the SIP2 item information message had a side affect of updating the datelastseen field for items. This bug has been fixed, but was being utilized by inventory tools that used SIP2. We should bring back this affect and formalize it as an optional SIP2 config account setting.

Test Plan:
1) Apply this patch set
2) prove t/db_dependent/SIP/Message.t

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 fbd4d3a9fe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-16 07:35:11 +01:00
9019528b6f
Bug 33557: Add LinkerConsiderThesaurus system preference
Bug 30280 added the ability to use multiple thesauri for authorities in Koha.
This is a large change, and many libraries use authorities in a ess strict manner.
This patch simply adds a preference, disabled by default, to enable this new feature

To test:
1 - Find or create a record with a 650 heading, second indicator 0 (LOC)
2 - Ensure this links to an authority in your system
3 - Disable AutoCreateAuthorities, enable CatalogModuleRelink
4 - Edit the heading to second indicator 2
5 - Save, the heading does not link
6 - Apply patch, updatedatabase, restart all
7 - Edit and save record again
8 - Heading should now link to the LOC authority, despite different second indicator value for source

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bf7389d601)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-16 07:32:11 +01:00
d31b347e73
Bug 28328: Adjust 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 4e933cbc11)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-15 19:38:11 +01:00
6d567185f0 Bug 33064: Update cypress tests
This patch amends Searchbar_spec.ts to account for the new licenses option

Test plan:
1) Run yarn cypress open
2) Select the Searchbar_spec.ts test
3) The test should pass

Signed-off-by: Lucas Gass <lucas@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 5b3d848b2e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-05-15 14:15:28 +00:00
f1bc806ade Bug 33490: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 80d73b87c4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-05-15 13:22:37 +00:00
61d4a4ffa4 Bug 33490: Make url consistent
This ensures we populate the max_expiration_date param on the browser
url for consistency with selected dates.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f9cb6b823e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-05-15 13:20:44 +00:00
4b22dff729 Bug 33490: Unit tests
This patch adds cypress tests for the filter by expired functionality in
the ERM Agreements page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f68b350ba)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-05-15 13:20:10 +00:00
b6d543fc27 Bug 33408: Remove obsolete tests and template sys pref code
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0f01c16ba1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-05-15 13:16:18 +00:00
8c410fdec3 Bug 33408: Prevent access to erm module by URL if sys pref is disabled
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0efb53b3a2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-05-15 13:16:01 +00:00