Bugzilla – Attachment 135537 Details for
Bug 30877
use List::MoreUtils::uniq from recalls_to_pull.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30877: use List::MoreUtils::uniq from recalls_to_pull.pl
Bug-30877-use-ListMoreUtilsuniq-from-recallstopull.patch (text/plain), 3.24 KB, created by
Jonathan Druart
on 2022-06-01 12:05:49 UTC
(
hide
)
Description:
Bug 30877: use List::MoreUtils::uniq from recalls_to_pull.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-06-01 12:05:49 UTC
Size:
3.24 KB
patch
obsolete
>From c1ada050c7839d9e35b602199de7536934025807 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 Jun 2022 14:04:47 +0200 >Subject: [PATCH] Bug 30877: use List::MoreUtils::uniq from recalls_to_pull.pl > >Test plan: >Confirm that "Recalls to pull" is still working correctly >--- > recalls/recalls_to_pull.pl | 23 +++++++++-------------- > 1 file changed, 9 insertions(+), 14 deletions(-) > >diff --git a/recalls/recalls_to_pull.pl b/recalls/recalls_to_pull.pl >index 06a14c5ea36..d320db49623 100755 >--- a/recalls/recalls_to_pull.pl >+++ b/recalls/recalls_to_pull.pl >@@ -18,6 +18,8 @@ > > use Modern::Perl; > use CGI qw ( -utf8 ); >+use List::MoreUtils qw( uniq ); >+ > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); > use Koha::BiblioFrameworks; >@@ -60,7 +62,7 @@ if ( $op eq 'list' ) { > my $biblio = Koha::Biblios->find($recall->biblio_id); > my @this_bib_recalls = Koha::Recalls->search({ biblio_id => $recall->biblio_id, status => [ 'requested','overdue','in_transit' ] }, { order_by => { -asc => 'created_date' } })->as_list; > my $recalls_count = scalar @this_bib_recalls; >- my @unique_patrons = do { my %seen; grep { !$seen{$_->patron_id}++ } @this_bib_recalls }; >+ my @unique_patrons = uniq @this_bib_recalls ; > my $patrons_count = scalar @unique_patrons; > my $first_recall = $this_bib_recalls[0]; > >@@ -90,13 +92,6 @@ if ( $op eq 'list' ) { > # don't push data if there are no items available for this recall > > # get unique values >- my @unique_callnumbers = do { my %seen; grep { !$seen{$_}++ } @callnumbers }; >- my @unique_copynumbers = do { my %seen; grep { !$seen{$_}++ } @copynumbers }; >- my @unique_enumchrons = do { my %seen; grep { !$seen{$_}++ } @enumchrons }; >- my @unique_itemtypes = do { my %seen; grep { !$seen{$_}++ } @itemtypes }; >- my @unique_locations = do { my %seen; grep { !$seen{$_}++ } @locations }; >- my @unique_libraries = do { my %seen; grep { !$seen{$_}++ } @libraries }; >- > push( @pull_list, { > biblio => $recall->biblio, > items_count => $items_count, >@@ -104,12 +99,12 @@ if ( $op eq 'list' ) { > patrons_count => $patrons_count, > pull_count => $items_count <= $recalls_count ? $items_count : $recalls_count, > first_recall => $first_recall, >- callnumbers => \@unique_callnumbers, >- copynumbers => \@unique_copynumbers, >- enumchrons => \@unique_enumchrons, >- itemtypes => \@unique_itemtypes, >- locations => \@unique_locations, >- libraries => \@unique_libraries, >+ callnumbers => [ uniq @callnumbers ], >+ copynumbers => [ uniq @copynumbers ], >+ enumchrons => [ uniq @enumchrons ], >+ itemtypes => [ uniq @itemtypes ], >+ locations => [ uniq @locations ], >+ libraries => [ uniq @libraries ], > }); > } > } >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30877
:
135537
|
135697