From b38e411f33fbe08c1af72d05c46d1d7fbc2e73a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 5 Oct 2012 10:45:18 +0200 Subject: [PATCH] Bug 1963 Problem with deleted biblio in a virtual shelf 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. --- C4/VirtualShelves.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index 8c0b15e..90a00a5 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -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=? "; -- 1.7.11.1