From bc06a7736afbb4aad99d4697e7b0d55e6272cc2b Mon Sep 17 00:00:00 2001 From: "J. David Bavousett" Date: Wed, 17 Feb 2010 11:19:09 -0500 Subject: [PATCH] Bug 3775: Accounts::chargelostitem uses title, but title not available to it This patch fixes the SELECT so that title is available when it is used later on, which will prevent 'Use of uninitialized value' errors. It also uses JOIN properly, which the original query and my initial patches for this did not. Signed-off-by: Galen Charlton --- C4/Accounts.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index c40fc39ded..d43442ea6e 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -283,7 +283,11 @@ sub chargelostitem{ my $dbh = C4::Context->dbh(); my ($itemnumber) = @_; - my $sth=$dbh->prepare("SELECT * FROM issues, items WHERE issues.itemnumber=items.itemnumber and issues.itemnumber=?"); + my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title + FROM issues + JOIN items USING (itemnumber) + JOIN biblio USING (biblionumber) + WHERE issues.itemnumber=?"); $sth->execute($itemnumber); my $issues=$sth->fetchrow_hashref(); -- 2.39.5