[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 Aug 27 14:55:23 CEST 2021


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

Jonathan Druart <jonathan.druart+koha at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Failed QA

--- Comment #15 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Wow, no! This is not as trivial as it looks like.

We must force scalar context actually. I am expecting lot of side-effects with
this change.

Try with:
use Koha::Items;
my $item = Koha::Items->find(1);

my $h1 = { holds => $item->holds, something => 'else' };
use Data::Printer colored => 1; warn p $h1 

Add 1 hold
=> holds is a Koha::Hold when we expect a set

Add another hold
Outch, you get:

{
  holds => Koha::Hold,
  Koha::Hold=Hash => "something",
  else => undef
}

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


More information about the Koha-bugs mailing list