From a2915e6742921ffa1df62cf47564174870f2c44e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 21 May 2014 08:05:53 -0400 Subject: [PATCH] Bug 12302 - OPAC course details not displaying item status correctly for itemtypes that are not for loan If an item is not for loan based on it's itemtype, opac-detail.pl will show the item as "Not for loan" but opac-course-details.pl will show the item as "Available". Test Plan: 1) Enable course reserves 2) Create a course, add an item to it 3) Edit that item's itemtype, set it to not for loan 4) View the item from opac-detail.pl, note the status is "Not for loan" 5) View the item from opac-course-details.pl, note the status is "Available" 6) Apply this patch 7) Reload opac-course-details.pl, not the status is now "Not for loan" --- C4/Biblio.pm | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 0fb453d..d0b073b 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -899,10 +899,11 @@ sub GetBiblioFromItemNumber { my $sth; if ($itemnumber) { $sth = $dbh->prepare( - "SELECT * FROM items + "SELECT items.*, biblio.*, biblioitems.*, itemtypes.notforloan as notforloan_per_itemtype FROM items LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber - WHERE items.itemnumber = ?" + LEFT JOIN itemtypes ON itemtypes.itemtype = " . C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype' . " + WHERE items.itemnumber = ?" ); $sth->execute($itemnumber); } else { -- 1.7.2.5