Bug 11473: (follow-up) ensure link to item is construct correctly
authorGalen Charlton <gmc@esilibrary.com>
Fri, 17 Jan 2014 06:04:37 +0000 (06:04 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 17 Jan 2014 06:06:52 +0000 (06:06 +0000)
This patch adjusts the check on action_logs.info to better detect
if the event concerns an item.  This fixes a problem where the links
from log entries on item modifications would, if followed, result
in internal server errors.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
tools/viewlog.pl

index 67ce7dd..949bec7 100755 (executable)
@@ -115,7 +115,7 @@ if ($do_it) {
     @data=@$results;
     my $total = scalar @data;
     foreach my $result (@data){
-       if ($result->{'info'} eq 'item'||$result->{module} eq "CIRCULATION"){
+       if (substr($result->{'info'}, 0, 4) eq 'item' || $result->{module} eq "CIRCULATION"){
            # get item information so we can create a working link
         my $itemnumber=$result->{'object'};
         $itemnumber=$result->{'info'} if ($result->{module} eq "CIRCULATION");