DBD::mysql::st execute failed: Column 'branchcode' in where clause is ambiguous [for Statement "SELECT COUNT( * ) FROM `article_requests` `me` JOIN `borrowers` `borrowernumber` ON `borrowernumber`.`borrowernumber` = `me`.`borrowernumber` WHERE ( ( `branchcode` = ? AND `status` = ? ) )" with ParamValues: 0="LIBRARY", 1='PENDING'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. No method count found for Koha::ArticleRequests DBIx::Class::Storage::DBI::_dbh_execute(): Column 'branchcode' in where clause is ambiguous at /usr/share/koha/lib/Koha/Objects.pm line 395 at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 71. To recreate: 1 - Enable 'IndependentBranchesPatronModifications' and article requests 2 - Sign in as non-superlibrarian 3 - View plack log 4 - Refresh mainpage, see error in logs
Caused by commit 710175fbe6721583028083d498f1df4a44bb1784 Bug 18403: Article requests
Created attachment 83037 [details] [review] Bug 21907: Fix article requests count for non-superlibrarians The query generates "Column 'branchcode' in where clause is ambiguous" Test plan: 1 - Enable 'IndependentBranchesPatronModifications' and article requests 2 - Sign in as non-superlibrarian 3 - View plack log 4 - Refresh mainpage, see error in logs
Created attachment 83794 [details] [review] Bug 21907: Fix article requests count for non-superlibrarians The query generates "Column 'branchcode' in where clause is ambiguous" Test plan: 1 - Enable 'IndependentBranchesPatronModifications' and article requests 2 - Sign in as non-superlibrarian 3 - View plack log 4 - Refresh mainpage, see error in logs Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
I am not even sure if the current behaviour is correct: When requesting an article the pick-up branch is selected and it seems only libraries from the pick-up branch see the request... so the fact where the item actually is is not taken into account at all and libraries who might be able to fill the request are not notified?
My confusion was related to bug 22265. PQA.
Created attachment 84681 [details] [review] Bug 21907: Fix article requests count for non-superlibrarians The query generates "Column 'branchcode' in where clause is ambiguous" Test plan: 1 - Enable 'IndependentBranchesPatronModifications' and article requests 2 - Sign in as non-superlibrarian 3 - View plack log 4 - Refresh mainpage, see error in logs Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.03
backported to 18.05.x for 18.05.09
Depends on Bug 18403 not in 17.11.x