Bug 9374: (follow-up) add FIXME suggesting that use of a regexp is not the long-term...
[koha.git] / labels / spinelabel-print.pl
index 82c6d51..7076a08 100755 (executable)
@@ -48,7 +48,7 @@ $sth = $dbh->prepare($sql);
 $sth->execute($barcode);
 $item = $sth->fetchrow_hashref;
 
-if ( $item->{'itemnumber'} eq '' ) {
+unless (defined $item) {
   $template->param( 'Barcode' => $barcode );
   $template->param( 'BarcodeNotFound' => 1 );
 }
@@ -62,14 +62,14 @@ while ( my ( $key, $value ) = each(%$item) ) {
     $value = '' unless defined $value;
     my @characters = split( //, $value );
     my $charnum    = 1;
-    my $wordnum    = 1;
+    my $wordernumber    = 1;
     my $i          = 1;
     foreach my $char (@characters) {
         if ( $char ne ' ' ) {
-            $data->{$key} .= "<span class='character word$wordnum character$charnum' id='$key$i'>$char</span>";
+            $data->{$key} .= "<span class='character word$wordernumber character$charnum' id='$key$i'>$char</span>";
         } else {
             $data->{$key} .= "<span class='space character$charnum' id='$key$i'>$char</span>";
-            $wordnum++;
+            $wordernumber++;
             $charnum = 1;
         }
         $charnum++;