Bug 28359 - Invalid value of OpacHiddenItems crashes OPAC search
Summary: Invalid value of OpacHiddenItems crashes OPAC search
Status: RESOLVED DUPLICATE of bug 23583
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 24403
  Show dependency treegraph
 
Reported: 2021-05-16 22:05 UTC by Victor Grousset/tuxayo
Modified: 2021-10-13 15:03 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Grousset/tuxayo 2021-05-16 22:05:50 UTC
1. put «damaged: 1» in the syspref
2. in OPAC search something that yield at least on result with a least one item
3. error
   Can't use string ("1") as an ARRAY ref while "strict refs" in use at /kohadevbox/koha/C4/Items.pm line 1012

staff interface search is okay
Comment 1 Jonathan Druart 2021-05-17 15:21:11 UTC
I think this is invalid with bug 28125.
Comment 2 Victor Grousset/tuxayo 2021-05-17 15:49:16 UTC
The about page warning is not likely to be found when hitting the issue. But that can still help. And we have other fish to fry.
If somebody wants to make it easier to find the cause the OPAC search crash, they can send a patch here.

Anyway, «damaged: 1» doesn't trigger the warning ^^"
Comment 3 Jonathan Druart 2021-05-20 07:31:06 UTC
filter_by_visible_in_opac and GetHiddenItemnumbers have different behaviours:


From GetHiddenItemnumbers:
 if (any { $val eq $_ } @{$hidingrules->{$field}}) {
Expect an array (damaged: [1])

From filter_by_visible_in_opac:
  { '-not_in' => $rules->{$field} }
will work for array and scalar

GetHiddenItemnumbers must be removed anyway.
Comment 4 Tomás Cohen Arazi (tcohen) 2021-10-13 15:01:32 UTC
This is no longer valid since bug 23583.

*** This bug has been marked as a duplicate of bug 23583 ***
Comment 5 Tomás Cohen Arazi (tcohen) 2021-10-13 15:03:03 UTC
(In reply to Jonathan Druart from comment #3)
> filter_by_visible_in_opac and GetHiddenItemnumbers have different behaviours:
> 
> 
> From GetHiddenItemnumbers:
>  if (any { $val eq $_ } @{$hidingrules->{$field}}) {
> Expect an array (damaged: [1])
> 
> From filter_by_visible_in_opac:
>   { '-not_in' => $rules->{$field} }
> will work for array and scalar

This is true: it is an unadvertised side-effect of considering the OpacHiddenItems syspref YAML, and not just a subset of YAML.