Bugzilla – Attachment 129300 Details for
Bug 29506
objects.search should call search_limited if present
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[21.05.x] Bug 29506: Make objects.search call search_limited if present
2105x-Bug-29506-Make-objectssearch-call-searchlimi.patch (text/plain), 1.59 KB, created by
Tomás Cohen Arazi
on 2022-01-11 15:01:49 UTC
(
hide
)
Description:
[21.05.x] Bug 29506: Make objects.search call search_limited if present
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2022-01-11 15:01:49 UTC
Size:
1.59 KB
patch
obsolete
>From 7de98648e3dbf463d13628e6a6285af4e7db58ef Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 Nov 2021 14:30:21 -0300 >Subject: [PATCH] [21.05.x] Bug 29506: Make objects.search call search_limited > if present > >This patch makes objects.search 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: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/REST/Plugin/Objects.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm >index 7ccc1c4cf4..69b53e5d8a 100644 >--- a/Koha/REST/Plugin/Objects.pm >+++ b/Koha/REST/Plugin/Objects.pm >@@ -150,6 +150,11 @@ for API rendering. > > $filtered_params = $c->merge_q_params( $filtered_params, $query_params, $result_set ); > } >+ >+ # If search_limited exists, use it >+ $result_set = $result_set->search_limited, >+ if $result_set->can('search_limited'); >+ > # Perform search > my $objects = $result_set->search( $filtered_params, $attributes ); > my $total = $result_set->search->count; >-- >2.32.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 29506
:
127751
|
127752
|
127753
|
127754
|
127755
|
127756
|
128668
|
128669
|
128670
|
129299
| 129300 |
129301