Commit graph

6602 commits

Author SHA1 Message Date
9544bd25a2
Bug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata
This adds a routine that can strip non xml characters form a record.
It is intended for cases where we do not wish to throw an exception,
but rather need to process a record to allow other work to continue

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

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4997d59c83)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-19 09:27:43 +01:00
e7c83d93cf
Bug 34288: Unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fbc21148e7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-19 08:32:47 +01:00
8ecb70b338
Bug 33727: (QA follow-up) perl tidy whole file
Test plan:
Run prove again. Run qa tools.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0f2a47d3c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 12:40:38 +01:00
6052f0ec17
Bug 33727: Merge both Calendar tests
The old t tests become part of the first subtest.

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

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

Test plan:
Run t/Calendar.t

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

Test plan:
Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 308d75d05d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 12:39:30 +01:00
d8326b64a3
Bug 34211: Add tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b86ad81bbf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 12:26:05 +01:00
5f6f595af5
Bug 27824: Add a test
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a91e80af7d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 12:24:01 +01:00
Aleisha Amohia
023cbfde02
Bug 31147: Recalls should not adjust due time for related checkouts
The current recalls behaviour adjusts the due date of the most appropriate checkout based on the 'recall due date interval' circulation rule. It also adjusts the due time, which is buggy behaviour. The due date should be adjusted based on the circulation rule, but the due time should remain the same.

To test:

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

SELECT date_due FROM issues WHERE itemnumber = XXXX;

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

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

SELECT date_due FROM issues WHERE itemnumber = XXXX;

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

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

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

SELECT date_due FROM issues WHERE itemnumber = XXXX;

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

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

SELECT date_due FROM issues WHERE itemnumber = XXXX;

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

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

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

SELECT date_due FROM issues WHERE itemnumber = XXXX;

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

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

Sponsored-by: Catalyst IT
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 780d6ecb51)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 12:23:30 +01:00
4041d06124
Bug 32801: Add tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b157a2cd7f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 11:05:42 +01:00
26e4866c9d
Bug 34094: (follow-up) Fix failing unit test
The unit tests were written to assume we always do a 'contains' search,
but the new system preference allows for 'starts_with' or 'contains'.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b787e66fef)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 11:02:37 +01:00
e4ef4c5e3d
Bug 33817: Enforce server-side
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 384de4a74a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 10:26:13 +01:00
aac8c1e36e
Bug 33496: Add 'host_items' param to Koha::Biblio->items
This patch adds an option to the $biblio->items method to allow
retrieving the items and analytic items for a record. This is intended
to allow fetching a single Items object, and related object, rather than
having to fetch the items, and the host items, and push them together

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

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8ff2e962b2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 16:41:26 +01:00
5377331f46
Bug 33879: Add unit test to show problem
Test plan:
Run t/db_dependent/Auth.t without second patch.
Should fail:
    #          got: 'opac'
    #     expected: 'intranet'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7fda38647)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 16:35:19 +01:00
Sam Lau
bc22bc611d
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>
(cherry picked from commit 5d9bc07316)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 16:34:55 +01:00
fdcb386548
Bug 33404: Add unit tests
Test plan:
Run t/db_dependent/Breeding.t
Run t/db_dependent/Breeding_Auth.t

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

Amended patch: perltidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9cab7f1fc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 16:33:30 +01:00
21ebede0de
Bug 33974: Make biblioitem columns searchable in a generic way
This patch makes biblioitem attributes be searchable on the biblios
endpoint. It does so by using the new method in Koha::Biblios, and by
adjusting objects.search(_rs) to accept a $query_fixer arrayref of
functions to be applied to each query or order_by parameters.

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

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 353f328ad3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 16:21:30 +01:00
949ba13a6e
Bug 33974: Add Koha::Biblios->api_query_fixer
This patch adds the `api_query_fixer` method to the class, and adds
tests to validate its behavior.

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60e8998e91)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 16:21:29 +01:00
f430c075c1
Bug 33573: Unit tests
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24d753cda1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:56:46 +01:00
jeremy breuillard
e495547b8b
Bug 23775: Claiming a serial issue doesn't create the next one
Whenever we need to generate manually a new serial we go to page
'serials-edit.pl'. With this patch it is possible to generate a new
serial on page 'serials.pl'.

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bd72f24d04)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:55:19 +01:00
11978e0f17
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>
(cherry picked from commit 3b0fc1fc41)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:45:59 +01:00
499141f8a8
Bug 33778: (QA follow-up) Update for master
The error message was updated in master.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 23b328d6af)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:44:39 +01:00
ccc8b569cf
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>
(cherry picked from commit 38a09d187e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:44:38 +01:00
7bfbc03cb6
Bug 33778: Fix indentation of last subtest
Only whitespace.

Test plan:
git diff -w HEAD~1.. t/Auth_with_shibboleth.t
No differences.

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>
(cherry picked from commit 02ec437d47)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:44:37 +01:00
5709e2db0e
Bug 33778: Further polishing
Use mock_preference.
Move final tests for BaseURLs into one subtest.
Change reset_config to allow passing parameters replacing some variables.
Copyright line.

Test plan:
Run t/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>
(cherry picked from commit f951b553d4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:44:36 +01:00
1eb2a37516
Bug 33778: Remove T::D::C from Auth_with_shibboleth.t
This test should be in t/db. It needs patrons, categories, branches.
T::D::C now hides e.g. the branchcode constraint.
When removing T::D::C, we therefore need to add a branchcode in the
shibboleth test config.

Test plan:
Run t/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>
(cherry picked from commit a8ff03d192)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:44:36 +01:00
d1e538c2cb
Bug 31651: Adjust tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c93df98068)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 15:42:22 +01:00
b07fa2af06
Bug 33500: Add tests for RecordLocalUseOnReturn
To test:
1. Turn on RecordLocalUseOnReturn
2. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t
3. Tests fail.
4. Apply patch
5. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t
6. Tests pass.

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2238d9f096)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 13:39:40 +01:00
51cf4cd1b6
Bug 31185: Unit test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 30b06a6c00)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 13:21:34 +01:00
8f9c879614
Bug 33528: Fix basic_workflow.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9f4e9f451b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 12:14:44 +01:00
6be23e7251
Bug 33176: Enforce bad values
1. Turn on RequirePaymentType
2. Create a manual invocie on a patron account
3. Go to pay it, 'Payment type:' is marked as required.
4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute.
5. You are able to make the payment without a payment type.
6. Apply patch and restart_all
7. Try 4-5 again. This time you should get a 500 error and the payment should not go through.
8. Try a paymnet again this time manipulate the DOM and change the value of 'CASH' to something else like 'SOMETHINGELSE'.
9. Try to submit the payment and again you will get a 500 error. The payment should not go through.
10. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful.
11. Make sure tests will pass

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 676d263687)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 08:15:11 +01:00
98347e1612
Bug 33176: Handle RequirePaymentType
Test plan:

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

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b15a15df9e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-17 08:15:09 +01:00
f73dbd00ad
Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env
This patch includes a unit test which checks the memory address
of the $env hashref in middlewares before and after
Koha::Middleware::Env is applied.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c7142fe94)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 09:22:00 +01:00
a22ca6877e
Bug 33852: Add one more test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 144efca99d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 08:10:01 +01:00
8a5665d4b7
Bug 33852: Make jobs.t test the only_current parameter
This trivial patch adds a test to the only_current parameter.

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

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76983f5275)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 08:10:01 +01:00
bf5ccb47fd
Bug 32894: (QA follow-up) Fix tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4d613494ab)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 07:50:41 +01:00
0e0d1f134d
Bug 32894: (follow-up) Koha::Item->last_returned_by
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ad94cf3e0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 07:50:41 +01:00
278769067c
Bug 32894: Fix test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 45d882de53)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 07:50:40 +01:00
e0d3271573
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>
(cherry picked from commit 7095ef2fa7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 07:42:51 +01:00
9e821301e8
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>
(cherry picked from commit 110d74f572)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-12 07:42:51 +01:00
80dec321bd Bug 33904: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dfed7f235d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-06-26 14:58:20 +02:00
fdc345dd9c 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>
(cherry picked from commit 1c3a35418e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-06-26 14:41:10 +02:00
2cc9fe3949
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-09 16:05:08 -03:00
ab1cb8a3c0
Bug 32478: (QA follow-up) Keep current hashref behavior
Prevent a crash on wrong contents for ItemsDeniedRenewal pref
as we did before.
Note: Could be a provisional measure (no band aid to repeat anywhere)
until we resolve this in preferences.pl.

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

Apply this patch
Run perl -MKoha::Items -e'Koha::Items->find(X)->is_denied_renewal; print "OK\n"'
=> Replace X by a valid itemnumber
Warns only with: Hashref expected for ItemsDeniedRenewal. You got OK.
Clear ItemsDeniedRenewal
Try again. No warning anymore.
Run t/Context.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-06-09 16:05:07 -03:00
b4192a6525
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-09 16:05:06 -03:00
David Gustafsson
151c76eafb
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-09 16:05:06 -03:00
David Gustafsson
342d46e611
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-09 16:04:58 -03:00
David Gustafsson
850f6f403b
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-09 12:04:57 -03:00
9117020143
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-09 12:04:55 -03:00
c0cf01b8a2
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-09 12:04:52 -03:00