Lp 1694058: Fix Issue With Place Holds Reported in Testing user/dyrcona/lp1694058_multiple_hold_placement
authorJason Stephenson <jason@sigio.com>
Sun, 29 Oct 2017 19:14:41 +0000 (15:14 -0400)
committerJason Stephenson <jason@sigio.com>
Sun, 29 Oct 2017 19:21:12 +0000 (15:21 -0400)
When staff did have to override in order to place the hold, and the
"Place another hold for this title" link was subsequnetly used, the
inputs for the patron barcodes and some other fields on the place
holds page were duplicated.  To avoid this, we now use uniq from the
List::MoreUtils library when retrieving the hold targets list from the
CGI parameters.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm

index 6095f85..b630517 100644 (file)
@@ -14,6 +14,7 @@ $Data::Dumper::Indent = 0;
 use DateTime;
 use DateTime::Format::ISO8601;
 my $U = 'OpenILS::Application::AppUtils';
+use List::MoreUtils qw/uniq/;
 
 sub prepare_extended_user_info {
     my $self = shift;
@@ -984,7 +985,7 @@ sub load_place_hold {
     my $cgi = $self->cgi;
 
     $self->ctx->{page} = 'place_hold';
-    my @targets = $cgi->param('hold_target');
+    my @targets = uniq $cgi->param('hold_target');
     my @parts = $cgi->param('part');
 
     $ctx->{hold_type} = $cgi->param('hold_type');