[Koha-bugs] [Bug 28883] Koha::Objects->_new_from_dbic doesn't work correctly in list context

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 24 10:34:17 CEST 2021


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

--- Comment #46 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Tomás Cohen Arazi from comment #33)
> After reading the comments again, it seems that:
> - Keep wantarray, fix places: ashimema, tcohen
> - Get rid of wantarray: Joubu
> 
> what do you think, Marcel?

Well, it looks like Martin changed opinion between comment28 and comment31.
And I do not read explicitly that Joubu wants to get rid of wantarray btw.

I would like to go the wantarray approach like this dev proposes. More
generally, it is the perl way of things. (The number of hits on wantarray is
surprisingly low btw in the codebase.) We created ->search as context
sensitive, so making new_from_dbic now context sensitive too and therewith
->items, ->holds etc, etc too is a logical followup.
As Jonathan and I have been looking for bad calls, it feels that we are on the
safe side when going further. Maybe we should push this quickly if we want it
in the next release. Allowing to test and find remaining problems.

But this is something else:
> I could chase the places in which scalar is used in a chained fashion on 
> templates and make them use the Scalar TT plugin as suggested.

Personally, I dont like to go that road. I already had some reservations about
passing Koha objects into the templates, but okay we do. But adding these
scalar calls here and there in templates is imo kind of pollution. Solve in the
controller, in perl.
Already we may miss things when git grepping the codebase, since we forget that
we are using a different notation when calling objects in the templates. Which
might be dangerous in the long run?

So I would opt for adding a patch here that removes these three calls somehow
instead of adjusting them.

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


More information about the Koha-bugs mailing list