Bugzilla – Attachment 113637 Details for
Bug 27021
Chaining on Koha::Objects->empty should always return an empty resultset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27021: Make chaining ->empty always return an empty resultset
Bug-27021-Make-chaining--empty-always-return-an-em.patch (text/plain), 1.09 KB, created by
David Nind
on 2020-11-14 07:45:16 UTC
(
hide
)
Description:
Bug 27021: Make chaining ->empty always return an empty resultset
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-11-14 07:45:16 UTC
Size:
1.09 KB
patch
obsolete
>From fa0db123820d781c23d89058401446315c8c0e79 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 13 Nov 2020 15:54:32 -0300 >Subject: [PATCH] Bug 27021: Make chaining ->empty always return an empty > resultset > >This patch borrows the implementation Martin did on bug 27002, to >woraround this issue, and implements it properly on the >Koha::Objects->empty method. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Objects.t >=> FAIL: Tests fail! The resultset should be empty and it isn't! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off! > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Objects.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/Objects.pm b/Koha/Objects.pm >index 3ea4727048..2f16b35888 100644 >--- a/Koha/Objects.pm >+++ b/Koha/Objects.pm >@@ -377,6 +377,7 @@ sub empty { > class => $self > ) unless ref $self; > >+ $self = $self->search(\'0 = 1'); > $self->_resultset()->set_cache([]); > > return $self; >-- >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 27021
:
113626
|
113627
|
113636
|
113637
|
113638
|
113639