Bug 27177 - t/db_dependent/api/v1/holds.t failing after bug 26988
Summary: t/db_dependent/api/v1/holds.t failing after bug 26988
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: 20.05
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 26988
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-09 12:52 UTC by Andrew Fuerste-Henry
Modified: 2021-12-13 21:10 UTC (History)
3 users (show)

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


Attachments
Bug 27177: Fix failing t/db_dependent/api/v1/holds.t (1.04 KB, patch)
2020-12-09 13:56 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 27177: Fix failing t/db_dependent/api/v1/holds.t (1.10 KB, patch)
2020-12-09 15:11 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-12-09 12:52:12 UTC
After backporting bug 26988 to 20.05, we're failing t/db_dependent/api/v1/holds.t
Comment 1 Andrew Fuerste-Henry 2020-12-09 13:56:27 UTC
Created attachment 114277 [details] [review]
Bug 27177: Fix failing t/db_dependent/api/v1/holds.t

To test:
1 - prove t/db_dependent/api/v1/holds.t
2 - it fails!
3 - apply patch, restart
4- prove t/db_dependent/api/v1/holds.t
5 - it passes!
Comment 2 Victor Grousset/tuxayo 2020-12-09 15:11:20 UTC
Created attachment 114285 [details] [review]
Bug 27177: Fix failing t/db_dependent/api/v1/holds.t

To test:
1 - prove t/db_dependent/api/v1/holds.t
2 - it fails!
3 - apply patch, restart
4- prove t/db_dependent/api/v1/holds.t
5 - it passes!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 3 Victor Grousset/tuxayo 2020-12-09 15:27:25 UTC
It works :)


@QA: the script passes
Comment 4 Jonathan Druart 2020-12-14 11:18:36 UTC
I think you are actually missing bug 27002.
Comment 5 Jonathan Druart 2020-12-14 11:25:25 UTC
I haven't been digging very deep, but this patch is wrong:

416     return try { 
417         my @pickup_locations =                                                                       
418             $hold->itemnumber
419           ? @{ $hold->item->pickup_locations( { patron => $hold->patron } )->as_list() }             
420           : @{ $hold->biblio->pickup_locations( { patron => $hold->patron } )->as_list() };   

vs

216 sub pickup_locations {
...
231     return \@pickup_locations; 

So you are calling ->as_list on an arrayref (I bet this is not tested in the tests are you trying to fix).

As said in the previous comment, look at bug 27002 instead.
Comment 6 Andrew Fuerste-Henry 2020-12-14 14:47:27 UTC
Thanks, Jonathan. Closing this and pushing 27002 to 20.05 instead.