Bug 21907: Fix article requests count for non-superlibrarians
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 11 Dec 2018 13:13:42 +0000 (10:13 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 4 Feb 2019 14:50:40 +0000 (14:50 +0000)
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>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

mainpage.pl

index da6aaee..49f46fc 100755 (executable)
@@ -71,7 +71,7 @@ my $pending_discharge_requests = Koha::Patron::Discharge::count({ pending => 1 }
 my $pending_article_requests = Koha::ArticleRequests->search_limited(
     {
         status => Koha::ArticleRequest::Status::Pending,
-        $branch ? ( branchcode => $branch ) : (),
+        $branch ? ( 'me.branchcode' => $branch ) : (),
     }
 )->count;