https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24254
--- Comment #18 from Tomás Cohen Arazi <[email protected]> --- (In reply to Jonathan Druart from comment #17) > (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? I usually prefer explicit vs. implicit. But not a strong position on this particular case. The 'if passed use it, if not, read it' approach seems to me like the best compromise option. This could be a follow-up bug (it requires new tests, probably adapt the callers) -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
