[Koha-bugs] [Bug 24254] Add Koha::Items->filter_by_visible_in_opac

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 18 12:23:28 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24254

--- Comment #16 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Jonathan Druart from comment #12)
> Comment on attachment 114279 [details] [review]
> Bug 24254: Add Koha::Items->filter_by_visible_in_opac
> 
> Review of attachment 114279 [details] [review]:
> -----------------------------------------------------------------
> 
> ::: Koha/Items.pm
> @@ +70,5 @@
> > +        $search_params->{$field}->{'-not_in'} = $rules->{$field};
> > +    }
> > +
> > +    $search_params->{itemlost}->{'<='} = 0
> > +        if C4::Context->preference('hidelostitems');
> 
> Where is that <= 0 coming from?
> 
> From C4::Search:
> 1919                 # hidden because lost
> 1920                 if ($hidelostitems && $item->{itemlost}) {
> 1921                     $hideatopac_count++;
> 1922                     next;
> 1923                 }
> 
> Remember that -1 is evaluated true.

Good catch! I overlooked the negative values here. All this was very
undocumented, so I'd say we need a regression test for that.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list