Bug 27177

Summary: t/db_dependent/api/v1/holds.t failing after bug 26988
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: Hold requestsAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Jonathan Druart <jonathan.druart>
Severity: major    
Priority: P5 - low CC: gmcharlt, jonathan.druart, victor
Version: 20.05   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 26988    
Bug Blocks:    
Attachments: Bug 27177: Fix failing t/db_dependent/api/v1/holds.t
Bug 27177: Fix failing t/db_dependent/api/v1/holds.t

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.