Online Renewal - Get URL path in a different way
authorTerran McCanna <tmccanna@georgialibraries.org>
Fri, 2 Sep 2022 21:35:15 +0000 (17:35 -0400)
committerJason Stephenson <jstephenson@cwmars.org>
Tue, 29 Nov 2022 19:12:49 +0000 (14:12 -0500)
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm

index 9ea2947..475a7dd 100644 (file)
@@ -16,17 +16,20 @@ $Data::Dumper::Indent = 0;
 my $U = 'OpenILS::Application::AppUtils';
 
 # Check URL to see if this is a new registration or a renewal
-my $self = shift;
-my $path = $self->apache->path_info;
+my $refpath = '';
+if ($ENV{'HTTP_REFERER'}) { 
+    $refpath = $ENV{'HTTP_REFERER'}
+}; 
+
 my $update_type = 'register';
 my @api_fields;
 
-if ($path =~ m|opac/erenew/submit|) {
+if ($refpath =~ m|opac/erenew/submit|) {
     $update_type = 'renew';
 }
 
 # Create different api_fields array if registration or renewal
-if ($update_type == 'renew') {
+if ($update_type eq 'renew') {
     @api_fields = (
         {name => 'vendor_username', required => 1},
         {name => 'vendor_password', required => 1},