Bugzilla – Attachment 123879 Details for
Bug 28871
Koha::Objects->empty doesn't work correctly in list context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28871: Make Koha::Objects->empty work on list context
Bug-28871-Make-KohaObjects-empty-work-on-list-cont.patch (text/plain), 954 bytes, created by
Tomás Cohen Arazi (tcohen)
on 2021-08-17 15:21:56 UTC
(
hide
)
Description:
Bug 28871: Make Koha::Objects->empty work on list context
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-08-17 15:21:56 UTC
Size:
954 bytes
patch
obsolete
>From 68b44258391ee82542c5beea11ecb99a6ea38ca4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 17 Aug 2021 11:37:28 -0300 >Subject: [PATCH] Bug 28871: Make Koha::Objects->empty work on list context > >This patch makes Koha::Objects->empty work on list context, by making it >return the $self->search call. > >To test: >1. Apply the regression test patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Objects.t >=> FAIL: Tests fail! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D >--- > Koha/Objects.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Objects.pm b/Koha/Objects.pm >index 3ee0a55742..96b7bc4001 100644 >--- a/Koha/Objects.pm >+++ b/Koha/Objects.pm >@@ -383,7 +383,7 @@ sub empty { > $self = $self->search(\'0 = 1'); > $self->_resultset()->set_cache([]); > >- return $self; >+ return (wantarray) ? () : $self; > } > > =head3 Koha::Objects->reset(); >-- >2.30.2
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 28871
:
123876
|
123877
|
123878
|
123879
|
123925
|
123926
|
123987
|
123988