From 6dbd91f052973a49f16861ab8c595bd3cb9a9138 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 66b019ebbb..5679d16506 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -275,7 +275,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 @@ -283,7 +283,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