Bugzilla – Attachment 77186 Details for
Bug 20469
Add item status to staff article requests form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20469: Use DBIC rs and return ->count
Bug-20469-Use-DBIC-rs-and-return--count.patch (text/plain), 1.46 KB, created by
Jonathan Druart
on 2018-07-23 15:53:03 UTC
(
hide
)
Description:
Bug 20469: Use DBIC rs and return ->count
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-23 15:53:03 UTC
Size:
1.46 KB
patch
obsolete
>From 9198f025f189812bbab9c97c05fa47829942f7ad Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 23 Jul 2018 12:52:01 -0300 >Subject: [PATCH] Bug 20469: Use DBIC rs and return ->count > >--- > Koha/Item.pm | 11 ++++++++--- > t/db_dependent/Koha/Items.t | 2 +- > 2 files changed, 9 insertions(+), 4 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 45f8995016..72e71594e7 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -289,9 +289,14 @@ sub current_holds { > =cut > > sub is_waiting_or_transit { >- my ( $self ) = @_; >- return 1 if Koha::Holds->search({ itemnumber => $self->itemnumber, found => ['W', 'T'] })->count > 0; >- return q{}; >+ my ($self) = @_; >+ >+ return $self->_result->reserves->search( >+ { >+ itemnumber => $self->itemnumber, >+ found => [ 'W', 'T' ], >+ } >+ )->count; > } > > =head3 type >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 51f1213654..0288a78876 100644 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -174,7 +174,7 @@ subtest 'is_waiting_or_transit' => sub { > is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, 1, > 'Item has transit hold' ); > $hold->found(undef)->store; >- is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, q{}, >+ is( Koha::Items->find($hold->itemnumber)->is_waiting_or_transit, 0, > 'Item should be available' ); > }; > >-- >2.11.0
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 20469
:
73281
|
73282
|
73388
|
76627
|
76628
|
76630
|
76631
|
77184
|
77185
|
77186
|
77222
|
77223
|
77224
|
107235
|
107236
|
107412
|
107413
|
107417
|
107418
|
107419
|
108345
|
108346
|
108347