From 04e140a53918e02c17a51d160467dbbec683e913 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Mon, 18 Nov 2019 12:30:27 +0000 Subject: [PATCH] Bug 23916: (follow-up) Fix column name collision Seems that joining 'borrowers' into the query run in C4::Members::GetAllIssues caused a column name collision, which blatted the retrieval of issues.branchcode. So we now are being a bit more specific in what is coming from where in the query. Signed-off-by: Ben Veasey --- C4/Members.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index c0e103c40e..9fbfc6f30c 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -274,7 +274,7 @@ sub GetAllIssues { my $dbh = C4::Context->dbh; my $query = -'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp +'SELECT issues.*, items.*, biblio.*, biblioitems.*, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp,borrowers.firstname,borrowers.surname FROM issues LEFT JOIN items on items.itemnumber=issues.itemnumber LEFT JOIN borrowers on borrowers.borrowernumber=issues.issuer @@ -282,7 +282,7 @@ sub GetAllIssues { LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber WHERE issues.borrowernumber=? UNION ALL - SELECT *, old_issues.timestamp as issuestimestamp, old_issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp + SELECT old_issues.*, items.*, biblio.*, biblioitems.*, old_issues.timestamp as issuestimestamp, old_issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp,borrowers.firstname,borrowers.surname FROM old_issues LEFT JOIN items on items.itemnumber=old_issues.itemnumber LEFT JOIN borrowers on borrowers.borrowernumber=old_issues.issuer -- 2.11.0