Bug 12062: Follow up to fix more untraslatable cases
[koha_fer] / opac / opac-serial-issues.pl
index b534974..edc6248 100755 (executable)
@@ -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;
+            }
         }
     }
 
@@ -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;
+            }
         }
     }