Bugzilla – Attachment 125246 Details for
Bug 29086
Reuse article request filtering methods in Biblio template plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29086: Simplify querying active article requests
Bug-29086-Simplify-querying-active-article-request.patch (text/plain), 1.74 KB, created by
Martin Renvoize (ashimema)
on 2021-09-24 13:08:23 UTC
(
hide
)
Description:
Bug 29086: Simplify querying active article requests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-24 13:08:23 UTC
Size:
1.74 KB
patch
obsolete
>From a4dd8a27d23aac313fdd9aef25c97593cd484180 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 22 Sep 2021 16:49:33 -0300 >Subject: [PATCH] Bug 29086: Simplify querying active article requests > >This patch makes a trivial replacement of a query for a higher level >method that does the same query. > >To test: >1. Enable the ArticleRequests feature >2. Place some article requests on known biblios >3. Have some article requests be active on others finished (either > completed or cancelled) >4. Go to the detail page for those records >=> SUCCESS: The active article requests count is correct! >5. Sign off :-D > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Template/Plugin/Biblio.pm | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > >diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm >index 5ec35422947..ecb8de82614 100644 >--- a/Koha/Template/Plugin/Biblio.pm >+++ b/Koha/Template/Plugin/Biblio.pm >@@ -26,7 +26,6 @@ use Koha::Holds; > use Koha::Biblios; > use Koha::Patrons; > use Koha::ArticleRequests; >-use Koha::ArticleRequest::Status; > > sub HoldsCount { > my ( $self, $biblionumber ) = @_; >@@ -41,16 +40,9 @@ sub ArticleRequestsActiveCount { > > my $ar = Koha::ArticleRequests->search( > { >- biblionumber => $biblionumber, >- status => [ >- -or => [ >- status => Koha::ArticleRequest::Status::Requested, >- status => Koha::ArticleRequest::Status::Pending, >- status => Koha::ArticleRequest::Status::Processing >- ] >- ] >+ biblionumber => $biblionumber > } >- ); >+ )->filter_by_current; > > return $ar->count(); > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29086
:
125175
|
125176
|
125246
|
125247
|
125347
|
125348