From 1c88f4cefa9a7945b3520b7249f7134d26f8fa4b Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sun, 23 Apr 2017 15:54:12 -0400 Subject: [PATCH] LP 1189989: Add suspend option when placing hold Fix the Apache Internal Server error caused by the previous patch. Signed-off-by: Jason Stephenson Signed-off-by: Kathy Lussier Signed-off-by: Galen Charlton --- .../lib/OpenILS/WWW/EGCatLoader/Account.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 91edcb6c3c..95bad4a858 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1034,6 +1034,13 @@ sub load_place_hold { } else { $ctx->{default_sms_notify} = ''; } + if ($cgi->param('hold_suspend')) { + $ctx->{frozen} = 1; + if ($cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){ + $ctx->{thaw_date} = "$3-$1-$2"; + } + } + # If we have a default pickup location, grab it if ($$user_setting_map{'opac.default_pickup_location'}) { @@ -1050,6 +1057,8 @@ sub load_place_hold { if ($ctx->{phone_notify}) { $hdata->{phone_notify} = $ctx->{phone_notify}; } if ($ctx->{sms_notify}) { $hdata->{sms_notify} = $ctx->{sms_notify}; } if ($ctx->{sms_carrier}) { $hdata->{sms_carrier} = $ctx->{sms_carrier}; } + if ($ctx->{frozen}) { $hdata->{frozen} = 1; } + if ($ctx->{thaw_date}) { $hdata->{thaw_date} = $ctx->{thaw_date}; } return $hdata; }; @@ -1289,10 +1298,6 @@ sub attempt_hold_placement { my @create_targets = map {$_->{target_id}} (grep { !$_->{hold_failed} } @hold_data); - my $thaw_date; - if ($cgi->param('hold_suspend') && $cgi->param('thaw_date') =~ m:^(\d{2})/(\d{2})/(\d{4})$:){ - $thaw_date = "$3-$1-$2"; - } if(@create_targets) { @@ -1313,8 +1318,6 @@ sub attempt_hold_placement { pickup_lib => $pickup_lib, hold_type => $hold_type, holdable_formats_map => $holdable_formats, - frozen => $cgi->param('hold_suspend'), - thaw_date => $thaw_date }), \@create_targets ); -- 2.43.2