bug: bookcount.pl pulls wrong title. Problem is sql joins on wrong columns
authorMichael Hafen <mdhafen@tech.washk12.org>
Fri, 22 Aug 2008 17:12:47 +0000 (11:12 -0600)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 28 Oct 2008 21:09:25 +0000 (22:09 +0100)
the sql seems to assume that biblionumber and biblioitemnumber are always the same, which in my case they aren't.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Biblio.pm

index e4e2dc2..e98a264 100644 (file)
@@ -539,7 +539,7 @@ sub GetBiblioItemData {
     my ($biblioitemnumber) = @_;
     my $dbh       = C4::Context->dbh;
     my $query = "SELECT *,biblioitems.notes AS bnotes
-        FROM biblio LEFT JOIN biblioitems on biblio.biblionumber=biblioitems.biblioitemnumber ";
+        FROM biblio LEFT JOIN biblioitems on biblio.biblionumber=biblioitems.biblionumber ";
     unless(C4::Context->preference('item-level_itypes')) { 
         $query .= "LEFT JOIN itemtypes on biblioitems.itemtype=itemtypes.itemtype ";
     }