Bug 30876

Summary: recalls/recalls_to_pull.pl introduces an incorrect use of ->search in list context
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Aleisha Amohia <aleisha>
Severity: critical    
Priority: P5 - low CC: aleisha, arthur.suzuki, jonathan.druart, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29844
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.01
Bug Depends on: 19532, 29844    
Bug Blocks: 29734, 30877, 30885    
Attachments: Bug 30876: Fix wrong call to ->search in list context
Bug 30876: Fix wrong call to ->search in list context
Bug 30876: Use Koha::Biblio
Bug 30876: Use Koha::Biblio
Bug 30876: (follow-up) Use the $biblio object even further

Description Tomás Cohen Arazi 2022-06-01 11:10:25 UTC

    
Comment 1 Tomás Cohen Arazi 2022-06-01 11:22:19 UTC
Created attachment 135534 [details] [review]
Bug 30876: Fix wrong call to ->search in list context

The code is clearly incorrect as ->search no longer returns a list when
called in list context.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Jonathan Druart 2022-06-01 11:57:08 UTC
The error is: The method Koha::Items->can_be_waiting_recall is not covered by tests!
Comment 3 Jonathan Druart 2022-06-01 11:57:41 UTC
After patch:
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'biblio_id' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 394
Comment 4 Jonathan Druart 2022-06-01 11:59:35 UTC
Created attachment 135535 [details] [review]
Bug 30876: Fix wrong call to ->search in list context

The code is clearly incorrect as ->search no longer returns a list when
called in list context.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2022-06-01 11:59:39 UTC
Created attachment 135536 [details] [review]
Bug 30876: Use Koha::Biblio

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Tomás Cohen Arazi 2022-06-01 13:29:53 UTC
Created attachment 135546 [details] [review]
Bug 30876: Use Koha::Biblio

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Tomás Cohen Arazi 2022-06-01 13:29:58 UTC
Created attachment 135547 [details] [review]
Bug 30876: (follow-up) Use the $biblio object even further

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Aleisha Amohia 2022-06-02 21:34:44 UTC
Code looks good, patch works, tests happy, passing QA
Comment 9 Tomás Cohen Arazi 2022-06-06 14:38:20 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 10 Lucas Gass 2022-06-15 16:07:45 UTC
Pushed to 22.05.x for 22.05.01
Comment 11 Arthur Suzuki 2022-06-21 13:44:30 UTC
depends on recalls, enhancement not available in 21.11, won't backport