Bug 7873: fixes sort on Title in OPAC basket
[koha_fer] / C4 / Items.pm
index a9c0a16..c114e63 100644 (file)
@@ -530,7 +530,7 @@ sub ModItem {
         $item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields);
     };
 
-    $item->{'itemnumber'} = $itemnumber or return undef;
+    $item->{'itemnumber'} = $itemnumber or return;
 
     $item->{onloan} = undef if $item->{itemlost};
 
@@ -936,7 +936,8 @@ sub GetLostItems {
     my $dbh     = C4::Context->dbh;
 
     my $query   = "
-        SELECT *
+        SELECT title, author, lib, itemlost, authorised_value, barcode, datelastseen, price, replacementprice, homebranch,
+               itype, itemtype, holdingbranch, location, itemnotes, items.biblionumber as biblionumber
         FROM   items
             LEFT JOIN biblio ON (items.biblionumber = biblio.biblionumber)
             LEFT JOIN biblioitems ON (items.biblionumber = biblioitems.biblionumber)
@@ -2292,7 +2293,7 @@ sub _koha_delete_item {
     # delete from items table
     $sth = $dbh->prepare("DELETE FROM items WHERE itemnumber=?");
     $sth->execute($itemnum);
-    return undef;
+    return;
 }
 
 =head2 _marc_from_item_hash
@@ -2667,7 +2668,10 @@ sub PrepareItemrecordDisplay {
                 if (   ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.location' )
                     && $defaultvalues
                     && $defaultvalues->{'location'} ) {
-                    my $temp = $itemrecord->field($subfield) if ($itemrecord);
+
+                    my $temp; # make perlcritic happy :)
+                    $temp = $itemrecord->field($subfield) if ($itemrecord);
+
                     unless ($temp) {
                         $defaultvalue = $defaultvalues->{location} if $defaultvalues;
                     }