Bugzilla – Attachment 161254 Details for
Bug 29510
objects.find should call search_limited if present
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29510: Make objects.find call search_limited if present
Bug-29510-Make-objectsfind-call-searchlimited-if-p.patch (text/plain), 1.35 KB, created by
Martin Renvoize
on 2024-01-22 16:34:56 UTC
(
hide
)
Description:
Bug 29510: Make objects.find call search_limited if present
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2024-01-22 16:34:56 UTC
Size:
1.35 KB
patch
obsolete
>From a6a79c246fb1bf7b680fab1ba455fe4af9b8d5f7 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 Nov 2021 18:03:00 -0300 >Subject: [PATCH] Bug 29510: Make objects.find call search_limited if present > >This patch makes objects.find implicitly update the passed >*$result_set* to use search_limited. This way no object leaks could >happen without noticing. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t >=> FAIL: Tests fail because search_limited is not used >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! Results are correctly filtered based on userenv! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/Plugin/Objects.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm >index 32dab06d4ba..2777aa076e0 100644 >--- a/Koha/REST/Plugin/Objects.pm >+++ b/Koha/REST/Plugin/Objects.pm >@@ -86,6 +86,9 @@ The result object can then be used for further processing. > } > ); > >+ $result_set = $result_set->search_limited >+ if $result_set->can('search_limited'); >+ > my $object = $result_set->find( $id, $attributes ); > > return $object; >-- >2.43.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 29510
:
127759
|
127760
|
127761
|
127772
|
127773
|
127774
|
161253
|
161254
|
161255
|
161477
|
161478
|
161479