Bug 19532: (QA follow-up) Fix few Koha::Recalls->search occurrences

Due to the wantarray change, we should fix this call in list context.
We should either use an iterator now or append as_list.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Marcel de Rooy 2022-03-01 14:00:27 +00:00 committed by Fridolin Somers
parent 9e68bb7fbb
commit b9ba0e131a
3 changed files with 5 additions and 5 deletions

View File

@ -307,8 +307,8 @@ if ( $pending_checkouts->count ) { # Useless test
$issue->{MySummaryHTML} = $my_summary_html;
}
my @maybe_recalls = Koha::Recalls->search({ biblionumber => $issue->{biblionumber}, itemnumber => [ undef, $issue->{itemnumber} ], old => undef });
foreach my $recall ( @maybe_recalls ) {
my $maybe_recalls = Koha::Recalls->search({ biblionumber => $issue->{biblionumber}, itemnumber => [ undef, $issue->{itemnumber} ], old => undef });
while( my $recall = $maybe_recalls->next ) {
if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) {
$issue->{recall} = 1;
last;

View File

@ -45,7 +45,7 @@ if ( $op eq 'cancel' ) {
}
if ( $op eq 'list' ) {
my @recalls = Koha::Recalls->search({ status => [ 'R','O','T' ] });
my @recalls = Koha::Recalls->search({ status => [ 'R','O','T' ] })->as_list;
my @pull_list;
my %seen_bib;
foreach my $recall ( @recalls ) {
@ -57,7 +57,7 @@ if ( $op eq 'list' ) {
$seen_bib{$recall->biblionumber}++;
# get recall data about this biblio
my @this_bib_recalls = Koha::Recalls->search({ biblionumber => $recall->biblionumber, status => [ 'R','O','T' ] }, { order_by => { -asc => 'recalldate' } });
my @this_bib_recalls = Koha::Recalls->search({ biblionumber => $recall->biblionumber, status => [ 'R','O','T' ] }, { order_by => { -asc => 'recalldate' } })->as_list;
my $recalls_count = scalar @this_bib_recalls;
my @unique_patrons = do { my %seen; grep { !$seen{$_->borrowernumber}++ } @this_bib_recalls };
my $patrons_count = scalar @unique_patrons;

View File

@ -51,7 +51,7 @@ if ( $op eq 'modify' ) {
}
if ( $op eq 'list' ) {
my @recalls = Koha::Recalls->search({ status => 'W' });
my @recalls = Koha::Recalls->search({ status => 'W' })->as_list;
my $borrower = Koha::Patrons->find( $loggedinuser );
my @over;
my $maxdelay = C4::Context->preference('RecallsMaxPickUpDelay') || 7;