Bugzilla – Attachment 135697 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.10 KB, created by
David Nind
on 2022-06-03 22:44:41 UTC
(
hide
)
Description:
Bug 30877: use List::MoreUtils::uniq from recalls_to_pull.pl
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-06-03 22:44:41 UTC
Size:
3.10 KB
patch
obsolete
>From 9d49e7bc1e5f0ccbdd4a81d02726085c7bf397ba 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 > >Signed-off-by: David Nind <david@davidnind.com> >--- > 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 a45ee8248d..201cab407e 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; >@@ -63,7 +65,7 @@ if ( $op eq 'list' ) { > { 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]; > >@@ -93,13 +95,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 => $biblio, > items_count => $items_count, >@@ -107,12 +102,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.30.2
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