Bug 13495 [QA Followup] - Re-word "Renew or return" button as well
[srvgit] / opac / opac-serial-issues.pl
index b534974..d276952 100755 (executable)
@@ -45,7 +45,7 @@ my $biblionumber = $query->param('biblionumber');
 if ( $selectview eq "full" ) {
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
-            template_name   => "opac-full-serial-issues.tmpl",
+            template_name   => "opac-full-serial-issues.tt",
             query           => $query,
             type            => "opac",
             authnotrequired => 1,
@@ -62,9 +62,11 @@ if ( $selectview eq "full" ) {
     }
 
     # now, check is there is an alert subscription for one of the subscriptions
-    foreach (@$subscriptions) {
-        if (getalert($loggedinuser,'issue',$_->{subscriptionid})) {
-            $_->{hasalert} = 1;
+    if ($loggedinuser) {
+        foreach (@$subscriptions) {
+            if (getalert($loggedinuser,'issue',$_->{subscriptionid})) {
+                $_->{hasalert} = 1;
+            }
         }
     }
 
@@ -90,7 +92,7 @@ if ( $selectview eq "full" ) {
 else {
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
-            template_name   => "opac-serial-issues.tmpl",
+            template_name   => "opac-serial-issues.tt",
             query           => $query,
             type            => "opac",
             authnotrequired => 1,
@@ -100,10 +102,12 @@ else {
 
     my $subscriptions = GetSubscriptionsFromBiblionumber($biblionumber);
     # now, check is there is an alert subscription for one of the subscriptions
-    foreach (@$subscriptions) {
-        my $subscription = getalert($loggedinuser,'issue',$_->{subscriptionid});
-        if (@$subscription[0]) {
-            $_->{hasalert} = 1;
+    if ($loggedinuser){
+        foreach (@$subscriptions) {
+            my $subscription = getalert($loggedinuser,'issue',$_->{subscriptionid});
+            if (@$subscription[0]) {
+                $_->{hasalert} = 1;
+            }
         }
     }