Bugzilla – Attachment 161478 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.45 KB, created by
Marcel de Rooy
on 2024-01-26 07:49:20 UTC
(
hide
)
Description:
Bug 29510: Make objects.find call search_limited if present
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-01-26 07:49:20 UTC
Size:
1.45 KB
patch
obsolete
>From c5907be0818ff00a6c8ad9bee4de7cc74ff243e6 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 >Content-Type: text/plain; charset=utf-8 > >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> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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 32dab06d4b..2777aa076e 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.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 29510
:
127759
|
127760
|
127761
|
127772
|
127773
|
127774
|
161253
|
161254
|
161255
|
161477
| 161478 |
161479