Bug 34916 - ArticleRequests.t may fail on wrong borrowernumber
Summary: ArticleRequests.t may fail on wrong borrowernumber
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marcel de Rooy
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 34933
  Show dependency treegraph
 
Reported: 2023-09-26 13:44 UTC by Marcel de Rooy
Modified: 2023-10-17 17:12 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.05,22.11.11


Attachments
Bug 34916: Fix wrong borrowernumber in ArticleRequests.t (1.33 KB, patch)
2023-09-26 13:48 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 34916: Fix wrong borrowernumber in ArticleRequests.t (1.34 KB, patch)
2023-09-29 11:32 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2023-09-26 13:44:02 UTC
When you dont have the 50 sample patrons, the 51 returned by Mocks for userenv->{number} may not be found. And ArticleRequests.t fails.

Can't call method "libraries_where_can_see_patrons" on an undefined value at /usr/share/koha/Koha/ArticleRequests.pm line 55.
Comment 1 Marcel de Rooy 2023-09-26 13:48:45 UTC
Created attachment 156227 [details] [review]
Bug 34916: Fix wrong borrowernumber in ArticleRequests.t

Simple fix: Send patron to userenv instead of library only.

Test plan:
Do not apply patch.
Remove borrowernumber 51.
Run t/db_dependent/Koha/ArticleRequests.t. (FAIL)
Apply patch, rerun test (PASS)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-09-26 13:49:07 UTC
Trivial: self SO
Comment 3 Marcel de Rooy 2023-09-26 13:49:26 UTC
This may affect more tests, but I stumbled over this prominent example.
Comment 4 Katrin Fischer 2023-09-29 11:32:42 UTC
Created attachment 156381 [details] [review]
Bug 34916: Fix wrong borrowernumber in ArticleRequests.t

Simple fix: Send patron to userenv instead of library only.

Test plan:
Do not apply patch.
Remove borrowernumber 51.
Run t/db_dependent/Koha/ArticleRequests.t. (FAIL)
Apply patch, rerun test (PASS)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 5 Tomás Cohen Arazi 2023-10-04 13:15:10 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-10-05 19:54:13 UTC
Pushed to 23.05.x for 23.05.05
Comment 7 Matt Blenkinsop 2023-10-17 17:12:07 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x