[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 13:19:37 CET 2020


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

--- Comment #17 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Tomás Cohen Arazi from comment #15)
> (In reply to Jonathan Druart from comment #13)
> > Why does the method take rules in parameter? Why don't we simply build the
> > rules from the pref in the method?
> 
> If it was called in a loop, we could reuse the rules. That was the idea.
> Maybe we should read the rules locally if the parameter was not passed at
> all (i.e. !exists $params->{rules}).

What for? Performance?
If we are looping on biblios then it's not that reading the pref and building
the rules that will have an impact on perf. If you are concerned about that I
would cache it at package level (->{_item_hide_rules}).

I think it's better to prevent calls that will forget to pass the rules, or
having to update all the callers if we decide to add one rules.

What do you think?

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


More information about the Koha-bugs mailing list