Bug 1963 Problem with deleted biblio in a virtual shelf
authorFrédéric Demians <f.demians@tamil.fr>
Fri, 5 Oct 2012 08:45:18 +0000 (10:45 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 17 Oct 2012 16:06:21 +0000 (18:06 +0200)
This bug reappear in HEAD/3.8. When trying to display a virtual shelf
(list) containing a deleted biblio, this error message is displayed:

Software error:

Can't call method "field" on an undefined value at ....C4/Koha.pm line
1231.

This fix modify SQL query retrieving biblios, just skipping records from
virtual shelf table with no linked record in biblio table: LEFT JOIN
replace with JOIN.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

C4/VirtualShelves.pm

index 8c0b15e..90a00a5 100644 (file)
@@ -267,7 +267,7 @@ sub GetShelfContents {
        " SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
             biblio.*, biblioitems.itemtype, biblioitems.publicationyear as year, biblioitems.publishercode, biblioitems.place, biblioitems.size, biblioitems.pages
          FROM   virtualshelfcontents vc
-         LEFT JOIN biblio      ON      vc.biblionumber =      biblio.biblionumber
+         JOIN biblio      ON      vc.biblionumber =      biblio.biblionumber
          LEFT JOIN biblioitems ON  biblio.biblionumber = biblioitems.biblionumber
          LEFT JOIN itemtypes   ON biblioitems.itemtype = itemtypes.itemtype
          WHERE  vc.shelfnumber=? ";