declare the variable once, then update the values
authorChris Sharp <csharp@georgialibraries.org>
Mon, 29 Aug 2022 16:45:16 +0000 (12:45 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 29 Aug 2022 16:45:16 +0000 (12:45 -0400)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm

index 69db076..a230855 100644 (file)
@@ -20,14 +20,15 @@ my $U = 'OpenILS::Application::AppUtils';
 my $self = shift;
 my $path = $self->apache->path_info;
 my $update_type = 'register';
+my @api_fields;
 
 if ($path =~ m|opac/erenew/submit|) {
-    my $update_type = 'renew';
+    $update_type = 'renew';
 }
 
 # Create different api_fields array if registration or renewal
 if ($update_type == 'renew') {
-    my @api_fields = (
+    @api_fields = (
         {name => 'vendor_username', required => 1},
         {name => 'vendor_password', required => 1},
         {name => 'patron_id', required => 1}, #needed for matching
@@ -57,7 +58,7 @@ if ($update_type == 'renew') {
         {name => 'temp_renewal'} #new boolean value
     );
 } else {
-    my @api_fields = (
+    @api_fields = (
         {name => 'vendor_username', required => 1},
         {name => 'vendor_password', required => 1},
         {name => 'first_given_name', class => 'au', required => 1},