[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 09:05:00 CEST 2021


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

--- Comment #42 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
$biblio->items->filter_by_visible_in_opac( { patron => $patron } )->as_list
=> This filter sub in Koha/Items always returns a scalar (a plural object).
=> Unfortunately, we have been quite inconsistent in this area.

E.g. directly following it:
sub filter_out_lost {
    my ($self) = @_;
    my $params = { itemlost => 0 };
    return $self->search( $params );
}
->search is context specific (contains wantarray), so depends on caller and
thus filter_out_lost is too. I am lost ;)

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


More information about the Koha-bugs mailing list