From 87e305a401d778f1d28bc74086d050ea8f42f7a2 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 Signed-off-by: Bouzid Fergani Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- C4/Members.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index efee49b809..cef9a2c633 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -273,7 +273,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 @@ -281,7 +281,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.39.5