Commit graph

5733 commits

Author SHA1 Message Date
eeef7839fb
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>
2023-08-29 14:59:01 -03:00
a05dff84eb
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>
2023-08-18 10:29:25 +03:00
3870b5a068
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>
2023-08-18 10:29:24 +03:00
Hammat Wele
13d3e87503
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>
2023-08-15 15:14:12 +03:00
Emily Lamancusa
4203632582
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>
2023-08-15 12:17:03 +03:00
fa5f9470c9
Bug 34357: Replace SUPER->imageurl in ItemTypes
Test plan:
Run t/db_dependent/Koha/ItemTypes.t

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-15 12:16:48 +03:00
99b3e2dbcc
Bug 34359: Remove unneeded module Koha/BiblioUtils/Iterator.pm with test
Test plan:
git grep BiblioUtils::Iterator

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-15 12:16:47 +03:00
2a8c43f975
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>
2023-08-15 11:25:53 +03:00
Katrin Fischer
19f9240759
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>
2023-08-15 11:25:50 +03:00
Emily Lamancusa
3ff1430bb4
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>
2023-08-15 11:25:47 +03:00
6e0afe7b04
Bug 30524: (QA follow-up) Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-07 21:00:07 -03:00
68a03b7f4c
Bug 30524: (QA follow-up) Unit tests for GenerateCSRF()
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-07 21:00:06 -03:00
9497556fef
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>
2023-08-07 20:59:59 -03:00
2fd6625abc
Bug 28966: (QA follow-up) tmp_holdsqueue no longer an iterator
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-26 17:48:28 -03:00
c195ffa9b1
Bug 28966: (QA follow-up) Fix failing unit tests
Test Plan:
1) prove t/db_dependent/TestBuilder.t
2) Note tests fail
3) Apply this patch
4) Run updatedatabase.pl
5) Update the schema files ( alias 'dbic' can be used in
   koha-testing-docker )
6) prove t/db_dependent/TestBuilder.t
7) Tests now pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-26 15:41:12 -03:00
328baf44b4
Bug 34258: (QA follow-up) Tidy the test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-26 11:06:06 -03:00
Andreas Roussos
5d0b4b4433
Bug 34258: update SIP-related unit test
Test plan:

1) Run the updated SIP-related unit test *without* having applied
   the other patch from this bug report -- it should fail:

   $ prove t/db_dependent/SIP/ILS.t

2) Apply the patch that fixes C4/SIP/ILS/Transaction/Renew.pm

3) Re-run the unit test -- it should pass.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-26 11:06:05 -03:00
96187695d7
Bug 28966: Prefetch patron data for holds queue viewer
Test Plan:
1) Generate the holds queue
2) Load the holds queue viewer page
3) Apply this patch
4) Restart all the things!
5) Reload the page
6) Note nothing has changed

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>
2023-07-25 16:25:38 -03:00
69653a281d
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>
2023-07-25 16:25:37 -03:00
419d1d4fe9
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>
2023-07-25 16:25:36 -03:00
4485963f5d
Bug 34226: Add tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
2023-07-25 16:25:36 -03:00
e9ce739b74
Bug 33964: Use Email::Sender::Transport::SMTP::Persistent for sending email
As described in bug 30013, some outgoing SMTP services ( such as Gmail ) do not like Koha's current behavior of initiating a new connection for each email sent.  If we switch from Email::Sender::Transport::SMTP to Email::Sender::Transport::SMTP::Persistent and store the object for the duration of the message queue processing, this should solve that issue.

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>
2023-07-24 14:55:33 -03:00
5ba8a8510a
Bug 33105: Tidy files
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-20 10:59:31 -03:00
3ead2ab623
Bug 33105: Add tests
Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-20 10:59:25 -03:00
08913eeda1
Bug 34178: (QA follow-up) Tidy
Tidy the relevant lines to pass the new QA rules

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-19 13:00:44 -03:00
c5e45213d5
Bug 34178: Adjust tests
We need to clear the cache when changing rules/statuses

To test:
1 - prove -v t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t

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>
2023-07-19 13:00:43 -03:00
1763b136d1
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>
2023-07-19 13:00:41 -03:00
8096ec9fff
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>
2023-07-19 13:00:40 -03:00
41274ef751
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>
2023-07-19 13:00:37 -03:00
7afbba200d
Bug 33444: Update AddRenewal to take a hashref of params
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed skip_record_index => 1 from automatic_renewals.pl. See BZ.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-19 12:06:52 -03:00
88ccaaf3ac
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>
2023-07-19 12:06:48 -03:00
4997d59c83
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>
2023-07-18 12:46:57 -03:00
fbc21148e7
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>
2023-07-18 12:46:54 -03:00
0a0b1eb68b
Bug 30979: (QA follow-up) Tidy things
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-14 12:14:47 -03:00
b72c623c30
Bug 30979: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-14 12:14:39 -03:00
c0f2a47d3c
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>
2023-07-14 12:14:37 -03:00
2eb6c36c4d
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>
2023-07-14 12:14:37 -03:00
308d75d05d
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>
2023-07-14 08:59:49 -03:00
cc478eaaa9
Bug 33039: Add ability to specify a template for serial subscription "Published on (text)" field
Some libraries would like to have the text version of the serials
"published on" field auto-generated from a template. This template
should be definable at the subscription level.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Restart all the things!
4) Create or edit a new subscription
5) Edit the "Publication date template", create a template toolkit
   template.
   Keys available are the Koha::Subscription object as 'subscription'
   and the following serial table columns as keys:
    serialseq
    serialseq_x
    serialseq_y
    serialseq_z
    subscriptionid
    biblionumber
    status
    planneddate
    publisheddate
    publisheddateext
    notes
    routingnotes
   So your example template could be "[% subscription.subscriptionid %] [% biblionumber %]"
6) Generate the next serial
7) Note the next issue has a "Date published (text)" field based on the
   template you set!

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>
2023-07-14 08:59:43 -03:00
3b68039351
Bug 33954: Add tests
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-13 15:19:38 -03:00
d5ded8684d
Bug 33953: Adjust tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-13 15:19:36 -03:00
3c52e63f78
Bug 33952: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-13 15:19:35 -03:00
b86ad81bbf
Bug 34211: Add tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-13 15:19:34 -03:00
a91e80af7d
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>
2023-07-13 15:19:32 -03:00
Aleisha Amohia
780d6ecb51
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>
2023-07-13 15:19:31 -03:00
b157a2cd7f
Bug 32801: Add tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-12 14:30:50 -03:00
b787e66fef
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>
2023-07-12 14:30:49 -03:00
384de4a74a
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>
2023-07-10 15:43:09 -03:00
68f22a1d9f
Bug 34212: Fix tests
Not sure what we were trying to do, but apparently we only use the keys
to generate the id string. How did "please" end up here?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-07 09:18:12 -03:00
720dec3f45
Bug 33029: Add wrapper method for dt_from_string to KohaDates template toolkit plugin
It would be very useful to have direct access to dt_from_string in our templates. This would allow for us to handle custom date and time formatting. It would, for example, allow us to output the month name for a given date via Template Toolkit easily.

Test Plan:
1) Apply this patch
2) In a notice add '[% Use KohaDates %][% KohaDates.datetime_from_string().ymd %]' to the top of a notice
3) Generate that notice for a patron
4) Note today's date in iso format is rendered at the top of the notice

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-06 12:24:17 -03:00
8ff2e962b2
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>
2023-07-06 10:08:36 -03:00
a7fda38647
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>
2023-07-05 12:17:24 -03:00
Sam Lau
5d9bc07316
Bug 34101: Unit Tests
prove t/db_dependent/SIP/Message.t

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>
2023-07-05 12:17:23 -03:00
e9cab7f1fc
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>
2023-07-05 12:17:22 -03:00
a24d1589ce
Bug 23336: (follow-up) Fix failing test
Our consistency improvement to the AddIssue return in bug 23336
highlighted a bad test assumption.  The 'Reinsert the original issue'
line was silently failing and as such the subsequent test lines were
actually resulting in a renewal (which previous to this patchset
returned an empty return that happened to match the empty return of an
issue failure)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-05 12:17:18 -03:00
353f328ad3
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>
2023-07-03 14:51:43 -03:00
60e8998e91
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>
2023-07-03 14:51:42 -03:00
24d753cda1
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>
2023-07-03 14:51:30 -03:00
jeremy breuillard
bd72f24d04
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>
2023-07-03 10:35:09 -03:00
3fc1f27524
Bug 33971: Remove x-koha-query header support
This patch removes support for the `x-koha-query` header entirely from
the codebase. For the purpose:

- $c->objects->search is adjusted
- Relevant tests are cleared/adapted
- The OpenAPI spec gets the header removed

To test:
1. Apply this patch and run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t \
           t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass!
2. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-03 10:35:06 -03:00
0f1b048b5d
Bug 33971: Remove x-koha-query usage in biblios.t
This patch removes handling of x-koha-query from the tests.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass! Change from x-koha-header to q= gives same
results.
4. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-03 10:35:05 -03:00
918bdd435d
Bug 23336: (QA follow-up) Minor fixes
This patch deals with some QA script warnings, and also makes some
changes in line with bug 33556.

We also adds current user id and checkout item id into the confirmation
token to improve security and fix the failing tests.

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>
2023-07-03 10:35:01 -03:00
dfc6da2df4
Bug 23336: Unit tests
This patch adds unit tests for the new checkout availability endpoint
we're going to introduce in this patchset.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-07-03 10:34:58 -03:00
3b0fc1fc41
Bug 33996: Add missing authority objects mapping
This patch adds a minimal mapping (i.e. some things get excluded from
the API objects for now). It makes some attributes consistent with the
current API names, and the rest can be added later when they become
needed and we discuss a proper name. But right now is a mess :-/

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2023-06-29 11:11:12 -03:00
23b328d6af
Bug 33778: (QA follow-up) Update for master
The error message was updated in master.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-29 11:11:10 -03:00
38a09d187e
Bug 33778: Move to db_dependent
Test plan:
Run t/db_dependent/Auth_with_shibboleth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2023-06-29 11:11:08 -03:00
2238d9f096
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>
2023-06-23 09:46:39 -03:00
30b06a6c00
Bug 31185: Unit test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-21 13:20:33 -03:00
1c3a35418e
Bug 33885: Make Koha::Acq::Order->creator return undef if no creator
If the account of the creator of an order has been deleted we should
return undef here, instead of crashing with
GET /api/v1/acquisitions/orders: unhandled exception (Mojo::Exception)<<DBIC result _type  isn't of the _type Borrower at /kohadevbox/koha/Koha/Objects.pm line 445.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-16 10:55:18 -03:00
2ab07927e2
Bug 29691: Unit tests
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>
2023-06-15 08:48:14 -03:00
37f441edd8
Bug 33963: Remove C4::BackgroundJob
Finally! No more occurrences of this module, we can happily remove it!

Test plan:
git grep is your friend

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>
2023-06-15 08:48:12 -03:00
9f4e9f451b
Bug 33528: Fix basic_workflow.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-14 12:46:47 -03:00
0843221be2
Bug 32910: (follow-up) Adjust Koha::Template::Plugin::Asset tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-14 09:21:59 -03:00
676d263687
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>
2023-06-12 11:52:07 -03:00
b15a15df9e
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>
2023-06-12 11:52:06 -03:00
144efca99d
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>
2023-06-09 08:29:01 -03:00
76983f5275
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>
2023-06-09 08:29:01 -03:00
dfed7f235d
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>
2023-06-09 08:28:58 -03:00
4d613494ab
Bug 32894: (QA follow-up) Fix tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2023-06-07 16:44:05 -03:00
9ad94cf3e0
Bug 32894: (follow-up) Koha::Item->last_returned_by
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2023-06-07 16:44:04 -03:00
45d882de53
Bug 32894: Fix test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2023-06-07 16:44:04 -03:00
6264ecdad0
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>
2023-06-07 15:25:24 -03:00
c50dda0d47
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>
2023-06-07 15:25:22 -03:00
David Gustafsson
e67f956e0e
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>
2023-06-07 15:25:21 -03:00
David Gustafsson
e9738a8370
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>
2023-06-07 15:25:18 -03:00
David Gustafsson
b6ae2c1ee3
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>
2023-06-06 16:20:56 -03:00
657fad8283
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>
2023-06-06 15:40:16 -03:00
d235937259
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>
2023-06-06 15:40:13 -03:00
f1cd3a44b0
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>
2023-06-06 15:40:12 -03:00
73384f636d
Bug 33242: Add unit test
Test plan:
Run t/db_dependent/Letters/TemplateToolkit.t

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2023-06-06 10:12:16 -03:00
0f0897f6b0
Bug 33236: (follow-up) Handle new suggestion in ReNewSubscription
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2023-06-06 10:08:35 -03:00
fb877da7d3
Bug 33236: Move NewSuggestion to Koha::Suggestion->store
The NewSuggestion routine saved the suggestion to the DB
and returned the id

This patch moves the code to Koha::Suggestion->store and
handles emailing upon creation, this adds that functionality to
suggestions added via api

To test:
1 - Apply patch
2 - Test adding a suggestion on the opac and staff client
3 - Confirm the suggestions are added correctly

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2023-06-06 10:08:35 -03:00
8b9355088a
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>
2023-06-05 15:36:11 -03:00
143e0fe8ac
Bug 33789: Add unit test
JD amended patch: Remove biblionumber => 144

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-05 15:36:10 -03:00
7095ef2fa7
Bug 33493: (QA follow-up) Only bless the first transfer
No need to do a walk through on all the results.
Correcting two test descriptions on the way.

Test plan:
Run t/db_dependent/Koha/Item.t
Run t/db_dependent/Koha/Items.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-05 15:36:09 -03:00
110d74f572
Bug 33493: (follow-up) Rename relationship and add test
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-05 15:36:08 -03:00
1f265d7d4a
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>
2023-06-05 14:36:06 -03:00
fe1c67b3d7
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>
2023-06-05 14:36:05 -03:00
6cd6c7833e
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>
2023-05-26 09:50:04 -03:00
1a8903ae85
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>
2023-05-26 09:50:04 -03:00
816bbbe77f
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>
2023-05-24 11:21:31 -03:00
d0195cef6c
Bug 33791: (QA follow-up) Stick to 'item_id' for the parameter name
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-22 14:46:30 -03:00
306439b4c6
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>
2023-05-22 14:46:29 -03:00
e6859b46ec
Bug 29046: (QA follow-up) Make sure tests get the right EmailFieldPrimary value mocked
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-18 12:13:45 -03:00
2a9c6db338
Bug 29046: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-18 12:13:42 -03:00
67e9356dea
Bug 33761: Unit test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-18 10:54:24 -03:00
d0c34a4ce3
Bug 32450: (QA follow-up) Fix SIP/Transaction.t
You forgot this one, Matt. Comment29 :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-17 10:25:10 -03:00
5a7624fe7d
Bug 32450: (QA follow-up) Fix failing tests
This patch fixes the failing tests in t/db_dependent/SIP/Patron.t

Test plan:
Run prove -v t/db_dependent/SIP/Patron.t and all tests should pass

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-17 10:25:09 -03:00
f8df1953c8
Bug 32450: (QA follow-up) Fix QA test errors
Exec flag added to atomic update file, trailing whitespaces removed
Unit tests patched to remove duplicate variable names

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-17 10:25:07 -03:00
cb07be78c7
Bug 32450: Unit tests updated
Unit tests for the non_issues_charges function have been updated to remove the system preferences and test based on the new database flags

Test plan:
1) Apply all patches
2) In the kshell, run prove -v t/db_dependent/Accounts.t
3) All tests should pass

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-17 10:25:06 -03:00
631af0c405
Bug 33607: Add framework display to staff details page
This patch adds a Frameworks pluing to allow fetching the framework text
and displays this on the intranet details page

To test:
1 - Apply patch
2 - View a record details page in staff
3 - Confirm you see the framework name
4 - prove -v t/db_dependent/Template/Plugin/Frameworks.t

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-16 15:17:43 -03:00
Aleisha Amohia
39b17d0526
Bug 30358: Strip leading/trailing whitespace characters from input fields when cataloguing
This enhancement adds a system preference StripWhitespaceChars which,
when enabled, will strip leading and trailing whitespace characters from
all fields when cataloguing both bibliographic records and authority
records. Whitespace characters that will be stripped are:
- spaces
- newlines
- carriage returns
- tabs

To test:
1. Apply patch and install database updates
2. Go to Administration, system preferences, find the new
StripWhitespaceChars preference. It should be "Don't strip" by default.
Change it to "Strip".
3. Search for a biblio record and edit it. Put some leading or trailing
whitespace characters in input fields and textarea fields and save.
4. Confirm these characters are removed when you save the record.
5. Repeat steps 3 and 4 for authority records.
6. Confirm tests pass t/db_dependent/Biblio/ModBiblioMarc.t

Sponsored-by: Educational Services Australia SCIS

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Also strip inner newlines

This patch amends the StripWhitespaceChars system preference to also
strip inner newlines (line breaks and carriage returns) when enabled.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Inner newlines should be replaced with a space

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Fixing tests and including for inner newlines

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Clarify syspref wording about fields affected

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Consider field has multiple subfields of same key

To test:

1) Click the clone subfield button to make multiple subfields with the
same key, i.e. 500$a$a$a
2) Save the record and confirm that the fields contain the correct data
after whitespaces are stripped.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Put multiple subfields fix on auth side

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) stripWhitespaceChars subroutine and tests

To test:

Confirm test plan above still works as expected and tests pass in
t/Koha_MetadataRecord.t

Sponsored-by: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Fixing ModBiblioMarc.t tests

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Do not strip whitespace from control fields

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Simplify regex

The regex does the following:
1. Replace newlines and carriage returns with a space
2. Replace leading and trailing whitespace with nothing (strip)

Signed-off-by: Hammat Wele <hammat.wele@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-16 15:17:26 -03:00
Aleisha Amohia
8c663b9df3
Bug 33098: Revert suggestion status when orders are cancelled
This enhancement will revert the status of a suggestion from ORDERED to
ACCEPTED when an order made from a suggestion is cancelled.

To test:
1. Log into the OPAC and go to purchase suggestions
2. Add a new purchase suggestion
3. Log into the staff interface. The suggestion will show on the home
page
4. Select the suggestion and mark it as Accepted
5. Go to Acquisitions. Find or create a basket
6. Add an order to the basket from a suggestion
7. You'll be redirected to the suggestions page. Click the order button
next to your suggestion
8. Fill out the order details as normal and confirm the order.
9. In a new tab, go to the suggestions management page and confirm the
suggestion now shows as ORDERED.
10. In the other tab with your basket, cancel the order you just made
from the suggestion.
11. Refresh the suggestions management tab. Confirm the suggestion now
shows as ACCEPTED.
12. Confirm tests pass t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Waikato Institute of Technology
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-16 10:17:12 -03:00
Katrin Fischer
78984024c8 Bug 11844: (follow-up) Fix tests
Moves the test from 999 which already exists in record to 998
as the feature only matches on the first field.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-05-16 12:58:38 +02:00
Julian Maurice
95421d0611 Bug 11844: Add tests
Tests added for:

- Koha::AdditionalField
- TransferOrder
- marcfield_mode

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-05-16 12:58:38 +02:00
Julian Maurice
7be92fb26e Bug 11844: Take into account itemtypes, branches, and cn_source
MARC subfields can be linked to "authorised values" that are not real
authorised values: itemtypes, branches, and cn_source.
Those were not taken into account. This patch fixes that

Test plan:
1. Create additional fields for order lines with a MARC subfield that is
   linked to one of those "fake" authorised values list
2. Follow the same steps as in the main test plan

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-05-16 12:58:38 +02:00
f1b75d49bb 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>
2023-05-16 12:39:21 +02:00
4eeac8a18d Bug 33733: Move to db_dependent
The subtest is added to the existing db_dependent test.

Test plan:
Run t/db_dependent/XSLT.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-05-16 12:38:16 +02:00
434a73b0e6 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>
2023-05-16 11:24:26 +02:00
cfaf1d8340
Bug 8179: (QA follow-up) Fix files permissions
Not sure how this happened.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-15 18:24:01 -03:00
2b22290256
Bug 30418: Unit tests
Test plan:
1. Run unit tests
sudo koha-shell <instance>
prove t/db_dependent/Koha/Patron.t
prove t/db_dependent/Virtualshelves.t

Sponsored-by: Catalyst IT, New Zealand

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-15 18:23:58 -03:00
2928c1cf63
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>
2023-05-15 18:23:54 -03:00
283cb0fd13
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>
2023-05-15 18:23:51 -03:00
Agustin Moyano
a551cb47ea
Bug 8179: Receive multiple orders
This patch implements the code to allow a patron to receive multiple
orders at the same time in /cgi-bin/koha/acqui/orderreceive.pl page

To test:
1. apply all patches
2. updatedatabase
3. Go to system preferences and allow AcqReceiveMultipleOrderLines
4. In acquisitions module, create a vendor if you don't have one and add
   3 baskets.. one with create items on ordering, one with create items
   on receiving and finally one with create items when cataloguing
5. Fill baskets with orders (There should be at least 15 orders in total). There should be a mix of orders created by suggestions, others by subscriptions and others by neither of those methods.
6. Close all baskets and receive shipment.
CHECK => in /cgi-bin/koha/acqui/parcel.pl page, in top table there is a column with checkboxes, and a button that says "Receive selected"
7. If all orders from all baskets are shown in the table, set the rows per page to 10, so table has more than one page
8. Check some of the checkboxes
CHECK => "Receive selected" button shows how many rows are selected
9. Go to the next page and select some more rows
CHECK => Changing page does not modify how many rows where selected
10. Go back to previous page
CHECK => Previously selected rows are still selected
11. Reload the page to deselect all rows
12. Select only one row and click on "Receive selected" button
CHECK => the page /cgi-bin/koha/acqui/orderreceive.pl behaves just the same as if the "receive" link in the selected row would have been clicked.
13. Click on cancel to go back to parcel.pl page
14. Select all rows (even the ones from the next page of the table) and
    click on "Receive selected"
CHECH => In orderreceive.pl page there is a table with all selected rows
15. Ensure table has more than one page, as in step 7
16. Click on the "edit" link in the last row of the current page
CHECK => A modal window is displayed with 4 tabs within: Info,
Accounting, Receipt history and Items
CHECK => Modal has 4 buttons at the bottom, 'Previous' to go to previos
order, 'Cancel' to close the modal without keeping modifications, 'Save'
to close modal keeping modifications and 'Next' to go to the next order
CHECK => Even that we are at the end of the current page, 'Next' button
is still available
17. Click on 'Next' button
CHECK => The table behind the modal now displays the next page, and the modal was not closed
18. Click on 'Previous'
CHECK => The table behind the modal went back to the first page, and the modal was not closed
19. Click on 'Previous' button till you reach the first row of the first
    page
CHECK => Only when you reach the first row of the first page 'Previous'
button gets disabled
20. Click on 'Next' button till you reach the last row of the last page
CHECK => Only when you reach the last button of the last page 'Next'
button gets disabled
21. Check that behaviour for the different types of order are still the
    same
    a. For orders that where created through suggestion, check that the
suggestion info is present in Info tab. If when suggestion was accepted
you set a reason, a dropdown to change the reason shoul display also.
    b. For orders that where created through subscriptions, check that
the Items tab is disabled, and the Receipt history is enabled. On
accounting tab you should be able to change quantity ordered. If there
were less items received than ordered, the next time you receive this
order the child order generated from this one shoul appear in receipt
history.
    c. For orders that don't come from subscription and creates there items on ordering, Receipt history
should be disabled, and a table with prefilled items shold appear in the
Items tab. You can edit them and the changes should appear in the item's
row.
    d. For orders that don't come from subscription and creates there
items on receiving, Receipt history should be disabled, and a form to
create the items should appear in Items tab. When you add an item a
table should appear.
    e. For orders that don't come from subscription and creates there
ites on cataloguing, Receipt history and Items tabs should be disabled.
    f. Any changes made in quantity (received or ordered) or funds in the modal should be
reflected in the table if you click save from the modal.
22. Once you've done all you checking and verifications click save
23. While saving a progress bar should appear
24. If no error was detected, you should be redirected back to parcel.pl
    page
25. If an error or warning was detected (like there is an order with 0
    items to receive) the save button should be disabled and warnings
are dispayed.
26. prove t/db_dependent/Koha/Acquisition/Fund.t t/db_dependent/Koha/Acquisitoin/Order.t t/db_dependent/Koha/Item.t

Sponsored-by: Virginia Polytechnic Institute and State University
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-15 08:53:47 -03:00
9d4dc1cf21
Bug 33580: Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-15 08:53:45 -03:00
Aleisha Amohia
6cf8c901f5
Bug 32129: Use patron category when checking if item can fill recall
This patch uses the patron category of the patron who requested the most
relevant recall to check for more specific circulation rules relating to
recalls. This ensures that patrons who are allowed to place recalls are
able to fill their recalls, especially when recalls are not generally
available for all patron categories.

To test:
1) Go to Administration -> System preferences and enable UseRecalls
2) Go to Administration -> Circulation and fines rules and set a general
All/All rule and a Category A/Itemtype A rule. All values can be set
however you like except for these recalls rules:

All/All rule:
Recalls allowed: 0
Recalls per record: 0
On shelf recalls allowed: if any unavailable

Category A/Itemtype A rule:
Recalls allowed: 5
Recalls per record: 5
On shelf recalls allowed: if any unavailable

3) Find an item of Itemtype A. Check it out to Patron A (any category).
4) Log into the OPAC as Patron B (of Category A). Find the item and
place a recall on the item.
5) Back in the staff interface, check in the item. This should trigger
the recalls process so you can allocate the item to Patron B's recall,
however the pop-up box to confirm the recall does not show. This is the
bug.

6) Apply the patch and restart services

7) Check in the item again. Confirm the pop-up box to confirm the recall
shows and you are able to allocate the item to Patron B's recall.
8) Confirm tests pass t/db_dependent/Koha/Item.t

Sponsored-by: Auckland University of Technology
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>
2023-05-12 17:50:02 -03:00
1a5f418f7d
Bug 31212: (QA follow-up) Fix unit test, remove unused imports
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-12 17:49:59 -03:00
David Gustafsson
ddc2906b77
Bug 31735: Avoid re-fetcing objects from database by passing them directly instead of ids to various subroutines
To test:

1) Run the following test and make sure all pass:
  t/db_dependent/api/v1/biblios.t
  t/db_dependent/api/v1/checkouts.t
  t/db_dependent/api/v1/return_claims.t
  t/db_dependent/Circulation/CalcDateDue.t
  t/db_dependent/Circulation/CheckIfIssuedToPatron.t
  t/db_dependent/Circulation/dateexpiry.t
  t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t
  t/db_dependent/Circulation/GetTopIssues.t
  t/db_dependent/Circulation_holdsqueue.t
  t/db_dependent/Circulation/IsItemIssued.t
  t/db_dependent/Circulation/issue.t
  t/db_dependent/Circulation/MarkIssueReturned.t
  t/db_dependent/Circulation/maxsuspensiondays.t
  t/db_dependent/Circulation/ReturnClaims.t
  t/db_dependent/Circulation/Returns.t
  t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
  t/db_dependent/Circulation.t
  t/db_dependent/Circulation/TooMany.t
  t/db_dependent/Circulation/transferbook.t
  t/db_dependent/DecreaseLoanHighHolds.t
  t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
  t/db_dependent/HoldsQueue.t
  t/db_dependent/Holds/RevertWaitingStatus.t
  t/db_dependent/Illrequests.t
  t/db_dependent/ILSDI_Services.t
  t/db_dependent/Items.t
  t/db_dependent/Koha/Account/Line.t
  t/db_dependent/Koha/Acquisition/Order.t
  t/db_dependent/Koha/Biblio.t
  t/db_dependent/Koha/Holds.t
  t/db_dependent/Koha/Items.t
  t/db_dependent/Koha/Item.t
  t/db_dependent/Koha/Object.t
  t/db_dependent/Koha/Patrons.t
  t/db_dependent/Koha/Plugins/Circulation_hooks.t
  t/db_dependent/Koha/Pseudonymization.t
  t/db_dependent/Koha/Recalls.t
  t/db_dependent/Koha/Recall.t
  t/db_dependent/Koha/Template/Plugin/CirculationRules.t
  t/db_dependent/Letters/TemplateToolkit.t
  t/db_dependent/Members/GetAllIssues.t
  t/db_dependent/Members/IssueSlip.t
  t/db_dependent/Patron/Borrower_Discharge.t
  t/db_dependent/Patron/Borrower_PrevCheckout.t
  t/db_dependent/Reserves/GetReserveFee.t
  t/db_dependent/Reserves.t
  t/db_dependent/rollingloans.t
  t/db_dependent/selenium/regressions.t
  t/db_dependent/SIP/ILS.t
  t/db_dependent/Holds.t
  t/db_dependent/Holds/LocalHoldsPriority.t
  t/db_dependent/Holds/HoldFulfillmentPolicy.t
  t/db_dependent/Holds/HoldItemtypeLimit.t
  t/db_dependent/Circulation/transferbook.t
2) Performe one or more checkouts for a patron, making sure
  that the circulation rules allows for renewals (for example by
  setting an earlier due-date).
3) Log in as this patron in OPAC and make sure the list of
  checkouts is displayed correctly, and that renewing an issue
  still works.

Sponsored-by: Gothenburg University Library
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-12 12:40:21 -03:00
519844611d
Bug 31557: (QA follow-up) Make tests more robust
Tests had a few problems:

- They weren't wrapped in a transaction explicitly
- They called Koha::Biblios->delete!
- They failed if run a couple times

This patch:

- Wraps things in a transaction
- Removes not-required things ($target_rs variable not used)
- Preserves the tests logic, but filters the resultset on the
  biblionumber instead of deleting all the database which can fail
  depending on FK constraints.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-12 11:22:48 -03:00
e84ae9b720
Bug 31557: (QA follow-up) Fix number of tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-12 11:22:48 -03:00
9f96f8b322
Bug 31557: Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library
Right now the holds queue builder starts filling bib-level holds with
items whose patron's home library matches the item's home library.

It would be good and reasonable to have the option to prioritize
item's whose patron's home library matches the item's holding library
to minimize transfers.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-12 11:22:47 -03:00
fbd4d3a9fe
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>
2023-05-12 11:22:47 -03:00
e79e23e8a2
Bug 33567: Empty NFL_statuses pref in unit test
This test should fail now, since it would trigger the hardcoded
fallback in the XSLT module.

Test plan:
Run t/db_dependent/XSLT.t
Should fail.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-12 11:22:41 -03:00
49803c311b
Bug 33403: Fix Letters.t if number pattern with id=1 does not exist
Bad assumption in DB, we should create the data we need

Test plan:
> delete from subscription_numberpatterns;

prove t/db_dependent/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:27 -03:00
bf7389d601
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>
2023-05-10 15:26:26 -03:00
c78b1a9a66
Bug 33277: (follow-up) Fix notdefined search for Zebra and ES
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:24 -03:00
7911eb6666
Bug 33277: Search thesaurus for 'notspecified'
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:24 -03:00
5d0050d84d
Bug 33277: Add comments and missing thesauri
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:23 -03:00
be0241ea69
Bug 33277: Support custom thesaurus authority with no 040 specified
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:23 -03:00
d73f567366
Bug 33277: Do not search using thesaurus when linking non 6XX fields
This patch sets thesaurus as undefined when linking any field except 6XX

This fixes the case where authrotiy records don't have the thesaurus defined

Consequently - this means that Koha does not support multiple thesaurus records
for authorities outside of subjects

i.e. Using the default linker, and having both an LCSH and Sears record for 'Shakespeare,William'
A 100 entry will find two results and the heading won't be linked. Previously we always linked to the LCSH

To test:
1 - Import the attached auths and biblio (from bug 33159 comment 24)
2 - Set system preferences:
    RequireChoosingExistingAuthority - don't require
    AutoCreateAuthorities - don't generate
    CatalogModuleRelink - Do
    LinkerKeepStale - Don't
    LinkerModule - default
    LinkerRelink - do
3 - Edit the imported bib
4 - Save it
5 - Headings are not linked except 600
6 - Apply patch
7 - Restart all
8 - Edit and save record
9 - Headings are successfully linked

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:22 -03:00
Julian Maurice
436d9b044e
Bug 25503: Add failing test for _get_biblio_for_export
Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=25508
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:19 -03:00
Julian Maurice
a87315e682
Bug 25503: Make Koha::Exporter::Record tests pass with unimarc
Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=25508
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 15:26:18 -03:00
4e933cbc11
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>
2023-05-10 15:26:17 -03:00
ce8911a955
Bug 30928: Add tests
prove -v t/db_dependent/Koha/Statistics.t
prove -v t/db_dependent/Stats.t

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-10 14:19:21 -03:00
ca37cbf6ca
Bug 32548: Add tests
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>
2023-05-09 11:46:58 -03:00
82eb5d7d26
Bug 33206: Unit test
Signed-off-by: Nick <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-09 11:46:53 -03:00
64c4f115cd
Bug 33653: Never consider received orders as late
We should not list received orders on the late orders page.

Test plan:
* Create a basket
* Create a normal order (not from a subscription, no standing order)
* Leave estimated delivery date empty
* Close the basket
* Create a new invoice and receive the order line
* Go to acq > late orders
* Verify the order is not in the list
* Set filter for 'To' date into the future, i.e. 01/01/2025
=> Without this patch the order shows up
=> With this patch applied the received order does not show up

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-09 10:58:07 -03:00
3551ef41a0
Bug 33611: Unit test
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-09 10:58:03 -03:00
Agustin Moyano
ead5f5c2f4
Bug 31799: (follow-up) Tidy up and fix duplicate barcode handling
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-09 10:57:56 -03:00
Agustin Moyano
51d50810fa
Bug 31799: Add REST endpoint to modify a biblio's item
To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Get a biblio with an item
4. Make a PUT request to /api/v1/biblios/:biblio_id/items/:item_id with a json body that represents an item to replace
5. Check that the item was modified
6. Sign off

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-09 10:57:55 -03:00
5e0c6b397d
Bug 22440: (follow-up) Fix existing tests
As we are introducing a FK for illrequests.biblio_id, TestBuilder is
generating a linked biblio, and so tests expecting undef are failing.

This fixes it by explicitly setting biblio_id => undef on creating the
request.

The patch also cleans the area a bit, removing a redundant and fragile
test as well.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 17:45:22 -03:00
d0bcb1ca83
Bug 31798: (QA follow-up) Fix tests permissions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 17:45:21 -03:00
b22f017a16
Bug 22440: (follow-up) Nothing is forever
This patch picks (yet) another class for testing purposes. The class
needs to not implement to_api() and to_api_mapping().

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 17:45:20 -03:00
Agustin Moyano
141c7cdf1a
Bug 31798: (follow-up) Tidy up and add duplicate barcode test
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>
2023-05-05 17:45:17 -03:00
Agustin Moyano
a7c5b80d70
Bug 31798: Add REST endpoint to add a biblio's item
To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Get a biblio
4. Make a POST request to /api/v1/biblios/:biblio_id/items with a json body that represents the new item
5. Check that the item is created
6. Sign off

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
2023-05-05 17:45:16 -03:00
a702f57adf
Bug 21043: Handle exceptions and switch to debit response
We were cheating a bit here and expecting a 'debit' to be sent in but a
'line' to be returned.

We should really be sending a debit and returning a debit.. so I've
update the paths schema as such and we're now coercing the
Koha::Account::Line object that's returned by Koha::Account->add_debit
into a Koha::Account::Debit object. Longer term it would be nice to
convert returns from the various Koha::Account methods to their correct
Koha::Account:: objects as apposed to them all being the base ::Line

I've also added some code to catch exceptions that can be thrown by
Koha::Account->add_debit and added the appropriate 400 errors into the
path specs again.

Finally.. I added more unit tests to prove the above

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>
2023-05-05 12:13:52 -03:00
Agustin Moyano
ab10759c50
Bug 21043: Add debit REST endpoint
This patch adds an endpoint to create a debit for a patron.

Testplan

1. Create a new account debit type (Administration > Debit types)
2. Add a fee with this debit type to a patron’s account via API
3. Make sure that this fee is shown in the accounting overview in the patron’s account in the staff interface
4. Make sure that it is possible to make a payment for this fee

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
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>
2023-05-05 12:13:51 -03:00
Agustin Moyano
1ecc49dc7a
Bug 29453: (follow-up) Add tests and fix minimum amount in credit.yaml definition
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 12:13:51 -03:00
Agustin Moyano
020f710e31
Bug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection work with Authorities and Biblios
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 12:13:50 -03:00
Agustin Moyano
67cafa719b
Bug 32735: Add endpoint to list authorities
This patch adds an endpoint to list authorities

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/authorities with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/api/v1/authorities.t
6. sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 12:13:49 -03:00
Agustin Moyano
b2801da206
Bug 31796: Add REST endpoint to modify an authority
To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Pick an authority to modify, and modify it's marc record
4. Make a PUT request to /api/v1/authorities/:authid with one of the following content type header
  - application/json
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
5. If content type is other than 'application/json' place the following header in the request 'x-authority-type: <auth type>'
5. Check that the authority was modified
6. Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 12:13:44 -03:00
Katrin Fischer
bd75309933
Bug 33197: Rename GDPR_Policy system preference
GDPR is a European Union (and, at time of writing, UK) law.
The GDPR_Policy system preference is about a patron
giving consent to their personal data being processed in
line with the library's privacy policy.

The name of the preference is vague: there could be
many policies implemented by libraries to comply with
GDPR. It also makes the preference look irrelevant for
libraries outside the areas where GDPR applies, while
it may be useful for libraries anywhere.

This renames GDPR_Policy to PrivacyPolicyConsent and
adjusts the system preference descriptions.

To test:
* Apply the patch
* Run database update
* Search for GDPR_Policy in the system preference
  - you should not find anything.
* Search for DataPrivacyConsent in the system preferences
  - you should find it and be able to activate it
* Verify the feature works as expected
  - If the preference is set to "enforced", you will be
    asked to give consent to the data privacy agreement
    in the OPAC when you log in
* Verify the page is now phrased neutrally using 'privacy policy'

Bonus: Consent date is now formatted according to DateFormat
       system preference.
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:54 -03:00
833de7b52d
Bug 33104: Add tests
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:49 -03:00
bdc2deba99
Bug 31795: (follow-up) Mock call to FindDuplicateAuthority
When running against Zebra, this tests fail because it requires the
record to be indexed timely. In theory, a 5 seconds delay should be
enough for the indexer to pick up. But that's not the point of the test,
and we should better just mock the query in this case.

To test:
1. Have ktd launch with zebra:
   $ ktd up -d
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/authorities.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Launch ktd with ES:
   $ ktd down
   $ ktd --es7 up -d
6. Repeat 2
=> SUCCESS: Tests pass!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:44 -03:00
138c370746
Bug 31795: Fix required permissions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:44 -03:00
531d03e811
Bug 31795: (QA follow-up) Use x-koha-override header
Despite its title, this patch does a couple more things.

1. The tests are rewritten to cover more things, and also to avoid
   deleting all authorities inside the transaction. It is really not
   required.
2. It makes the endpoint rely on the already generically implemented
   x-koha-override header, which is intended for the same use case as
   x-confirm-not-duplicate is for.
3. It changes the return codes to match the coding guidelines [1]
4. Only checks for duplicates if no override passed.

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

[1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER3.2.1_POST

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:43 -03:00
Agustin Moyano
1cbe4c2e41
Bug 31795: Add REST endpoint to add an authority
To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/authorities with one of the following content type header
  - application/json
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>"
5. Check that the authority is created
6. Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:43 -03:00
Katrin Fischer
81f2ed7e39
Bug 33419: (QA follow-up) Remove changes to basic_workflow.t
These are not needed: 942 and 200 have no subfields for
homebranch and holdingbranch.

The tests pass without these changes.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:40 -03:00
Laura Escamilla
a6caabfd2b
Bug 33419: Make home library and current library mandatory by default
Items without a home and current library can cause errors in Koha.
On the bibliographic page, items appear without the "edit" drop-down
or the selection check box. On a bulk delete page, items without
a home library create a red error that says "Cannot delete".

Making the home and current library values mandatory
helps avoid these issues.

Test plan (using koha-testing-docker (KTD)):
1. Reset KTD so that the web installer is used to setup Koha.[1]
2. Setup Koha using the web installer
   -> When setting up the default settings, don't add any of the
      optional data.
3. Once setup and logged in, check the two frameworks (default and ACQ)
    and note that $952$a and $952$b are not mandatory.
4. Apply the patch.
5. Repeat steps 1-2.
6. Once setup and logged in, check the two frameworks (default and ACQ)
   and note that $952$a and $952$b are now mandatory.

[1] How to access the web installer to setup Koha in KTD:
1. Access the database server:
   mysql -uroot -ppassword -hkoha-db-1
2. Drop the koha_kohadev database: drop database koha_kohadev;
3. Create the database: create database koha_kohadev;
4. Add privileges (for a real installation this would be limited):
   grant all on koha_kohadev.* to koha_kohadev;
5. Restart everything (there may be some errors listed):
   flush_memcached and then restart_all
6. Access the web installer: go to 127.0.0.1:8081
7. Use the database user name and password:
   get from /etc/koha/sites/kohadev/koha-conf.xml
   (default: koha_kohadev, password)
8. Continue through the installation process.

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>
2023-05-05 10:18:40 -03:00
81fc1ebe71
Bug 33329: Regression tests
This patch introduces tests for the bug highlighted on bug 32336, but in
the context of lists of records.

To reproduce:
1. Run:
   $ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> FAIL: Test fail, encoding is bad!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:38 -03:00
f394bf61cf
Bug 28267: Simplify things
We don't need:
* a separate Koha::Installer module when we already have
C4::Installer
* the tests as they are actually modifying the DB structure
without rolling back
* An unecessary complicated subroutine, just make is simple

WNC amended patch: Remove change to Koha.pm

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:36 -03:00
b76fb9cf46
Bug 28267: Add warnings for database row formats
This patch adds a warning on about.pl regarding database row formats
other than "DYNAMIC". It points to the Koha community wiki for more
information on how to resolve the problem.

This patch also stops the installer if there are any database tables
with a row format other than "DYNAMIC". It points to the Koha community
wiki for more information on how to resolve the problem.

Test plan:
0a. Apply the patch
0b. koha-plack --restart kohadev
1a. koha-mysql kohadev
1b. ALTER TABLE tags ROW_FORMAT=COMPACT;
2. Go to http://localhost:8081/cgi-bin/koha/about.pl
3. Note that there is a warning about database row formats
4a. koha-mysql kohadev
4b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
5. Go to http://localhost:8081/cgi-bin/koha/about.pl
6. Note that there is no warning about database row formats

7a. Manually change the version in Koha.pm to a higher version
7b. koha-plack --restart kohadev
8a. koha-mysql kohadev
8b. ALTER TABLE tags ROW_FORMAT=COMPACT;
9. Go to http://localhost:8081/
10. Log into the web installer and click through until you reach
a warning telling you that you have database row formats other
than 'DYNAMIC'
11. Note that you can't progress with the installer until
this problem is resolved
12a. koha-mysql kohadev
12b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
13. Refresh the page or redo the web installer process
14. Note that you're no longer blocked from running the installer
due to database row format
15. Undo your change to Koha.pm
16. Profit

Note: Due to bug 32665 you'll see an unrelated warning on
step 3

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:35 -03:00
177b53d794
Bug 33262: Unit tests
prove t/db_dependent/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 10:18:33 -03:00
50909d2266
Bug 22440: Move backend statuses api endpoint
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 09:13:43 -03:00
3cfce3b796
Bug 22440: Tests
Updated API tests

Co-authored-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 09:13:43 -03:00
e64fd9aafc
Bug 22440: Add GET /ill_requests
Co-authored-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>
2023-05-05 09:13:41 -03:00
1a186826e4
Bug 22440: Add Koha::Illrequests->filter_by_visible
This patch introduces a method for filtering out requests that match the
statuses specified on the *ILLHiddenRequestStatuses* system preference.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 09:13:40 -03:00
00629fe94f
Bug 33328: Rename x-marc-schema => x-record-schema
This patch renames the header on the biblio API so it is not entirely
tied to MARC, trying to follow the biblio_metadata table generic
approach.

To test:
1. Apply this patch
2. Run:
   $ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass
3. You agree with the change?
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Change sounds reasonable. Tests pass before and after patch.
"grep -r "x-marc-schema" *" confirms no occurrences after patch.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-05 09:13:24 -03:00
726004a8c1
Bug 33584: Fix failures for Commenter.t on MySQL8
The column names from information_schema are uppercase now in MySQL8.
In the arrayref with sliced hashes, we expected lowercase.

See e.g. https://stackoverflow.com/questions/54538448/what-are-the-changes-in-mysql-8-result-rowset-case

Test plan:
Run t/db_dependent/Koha/Database/Commenter.t
Do it again if possible with a MySQL 8 db server.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-24 12:08:00 -03:00
bc5a6e8d55
Bug 32484: (QA follow-up) Polishing unit test
Test plan, removed done_testing.
License.
Since we are in t/db, good to add transaction, although we currently
do not change anything here. But who knows?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-21 10:36:29 -03:00
Julian Maurice
689632256f
Bug 32484: Replace DateTime->now by Koha::DateUtils::dt_from_string
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-21 10:36:28 -03:00
Julian Maurice
edcabe3728
Bug 32484: Enable plugins when UseACQFrameworkForBiblioRecords is set
Test plan:
1. Do not apply the patch yet
2. Make sure you have an ACQ biblio framework with some framework
   plugins enabled. Create it if you don't.
3. Enable UseACQFrameworkForBiblioRecords system preference
4. Create a new acquisition basket.
5. On this new basket, click on "+ Add to basket", then "From a new
   (empty) record"
6. You should see a simplified MARC editor based on ACQ framework.
   Confirm that the plugins are not enabled (no visible buttons, nothing
   happening on focus/blur)
7. Apply patch
8. Repeat step 5
9. You should now see the plugins' buttons (only if you enabled plugins
   that use the 'click' event)
10. Confirm that the enabled plugins work correctly

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>
2023-04-21 10:36:28 -03:00
Janusz Kaczmarek
203646418a
Bug 33210: Add unit test
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-21 10:36:26 -03:00
806cbf8d8c
Bug 12029: Remove 'params' from filter_by_unread
It's not used and not needed, you can chain methods.

Also remove unused C4::Koha module and useless statement in tests.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-20 15:48:47 -03:00
Aleisha Amohia
52f228c02a
Bug 12029: Tests
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-20 15:48:46 -03:00
7c38f5811b
Bug 33103: Add REST API tests
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-20 15:48:39 -03:00
a387b37c1c
Bug 33103: Add tests for Aliases Koha classes
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-20 15:48:36 -03:00
981eeff7ef
Bug 33447: Make *->pickup_locations methods throw an exception on missing parameter
This patch fixes the FIXME for making the methods throw an exception.

Tests are added, and POD is adapted as well.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/patrons* \
           t/db_dependent/api/v1/holds.t \
           t/db_dependent/Reserves* \
           t/db_dependent/Hold* \
           t/db_dependent/Koha/Hold* \
           t/db_dependent/Items*

=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-20 15:48:32 -03:00
ef8adf34fd
Bug 33447: (follow-up) Fix tests and make assumption explicit
The patches made an assumption that patron would always be passed. It is
within Koha, but not in the Biblios tests.

There is no scenario where we can determine pickup locations that are not in
reference to a patron (who is picking it up?) so we should always have
this parameter

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-20 15:48:31 -03:00
1518569eaa
Bug 33447: (QA follow-up) Add comment for flushing cache
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-19 09:20:54 -03:00
89fb8f31ab
Bug 33447: Adjust tests
Signed-off-by: emlam <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-19 09:20:53 -03:00
cf83ec866c
Bug 33229: (follow-up) Adjust tests to set anonymous patron before setting patron privacy to 2
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-17 09:55:48 -03:00
7c45fc8bdf
Bug 33229: Clear patron reading history when privacy is set to never
This patch adds a check to patron store routine. When privacy is changed
to 'Never' we should immediately clear their history

To test:
1 - Set system preferences:
   AnonymousPatron - to a valid borrowernumber
   OPACPrivacy - Allow
2 - Checkout some items to a patron with priacy set to default, return them
3 - Log in to opac as patron
4 - Confirm you can see your history
5 - Change history to Never
6 - Confirm history still viewable
7 - Apply patch, restart all
8 - Set privacy to Default
9 - Confirm you can still see history, not deleted when not set as Never
10 - Set privacy to 'Never'
11 - Confirm history is anonymized

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-14 15:39:41 -03:00
Katrin Fischer
d5e45c54b1
Bug 33192: (QA follow-up) Fix it-IT sample data and unit tests
To test:
* prove t/db_dependent/Message.t
* Run the it-IT web installer and make sure 'email' is set.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-14 11:35:40 -03:00
101ce89374
Bug 33192: Update all occurrences of AutoEmailPrimaryAddress
This patch updates all references to AutoEmailPrimaryAddress to refer to
EmailFieldPrimary instead.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-14 11:35:39 -03:00
cb89844321
Bug 33360: Adjust Letters.t for limit parameter and domain limits
Includes:
[1] Add a counter in the send_or_die mock.
[2] Correct from processed count to sent count.
[3] More extensive testing for limit parameter and domain limits.

Test plan:
Run t/db_dependent/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2023-04-14 11:35:32 -03:00
f27a43c54a
Bug 33360: Extend Koha::Notice::Util with domain groups
The functionality is extended a bit here by:
[1] Allowing to combine domains in a shared count.
[2] Only counting sent messages for the specified
    domains when it is really needed.

Test plan:
Run t/db_dependent/Koha/Notice_Util.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2023-04-14 11:35:30 -03:00
0cbbd1b3d2
Bug 33360: Add Koha::Notice::Util for mail domain limits
Ground work in new module.
Includes unit test.

Test plan:
Run t/db_dependent/Koha/Notice_Util.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2023-04-14 11:35:29 -03:00
c101afb0a0
Bug 32127: Add unit test
Run prove t/db_dependent/Template/Plugin/Categories.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-14 11:35:24 -03:00
a59c530786
Bug 32334: (QA follow-up) Remove fh and verbose parameter in favor of messages
The module returns messages. The script can print them in verbose
mode. Test script adjusted accordingly.

Test plan:
Run t/db_dependent/Koha/Database/Commenter.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-12 11:22:01 -03:00