Bugzilla – Attachment 116077 Details for
Bug 27580
NULL values not correctly handled in Koha::Items->filter_by_visible_in_opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27580: Handle NULL values correctly in Koha::Items->filter_by_visible_in_opac
Bug-27580-Handle-NULL-values-correctly-in-KohaItem.patch (text/plain), 1.27 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-01-29 19:46:58 UTC
(
hide
)
Description:
Bug 27580: Handle NULL values correctly in Koha::Items->filter_by_visible_in_opac
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-01-29 19:46:58 UTC
Size:
1.27 KB
patch
obsolete
>From b9c3bc678a5a0aecc651e2cbff57cdb536a72719 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 29 Jan 2021 16:43:06 -0300 >Subject: [PATCH] Bug 27580: Handle NULL values correctly in > Koha::Items->filter_by_visible_in_opac > >This patch fixes the internally used query so it doesn't consider NULL >values as IN the set. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Items.t >=> FAIL: Tests fail :-/ >3. Apply this patch >4. Repeat 2 >=> SUCCESS: tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Items.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/Items.pm b/Koha/Items.pm >index 6d401d83ef2..2d81a24c590 100644 >--- a/Koha/Items.pm >+++ b/Koha/Items.pm >@@ -78,8 +78,9 @@ sub filter_by_visible_in_opac { > my $rules = C4::Context->yaml_preference('OpacHiddenItems') // {}; > > my $rules_params; >- foreach my $field (keys %$rules){ >- $rules_params->{$field}->{'-not_in'} = $rules->{$field}; >+ foreach my $field ( keys %$rules ) { >+ $rules_params->{$field} = >+ [ { '-not_in' => $rules->{$field} }, undef ]; > } > > $result = $result->search( $rules_params ); >-- >2.30.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 27580
:
116076
|
116077
|
116080
|
116081
|
116094
|
116095