[Koha-bugs] [Bug 34932] A missing manager (51) failed my patron test

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Sep 27 14:54:53 CEST 2023


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

--- Comment #1 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st
execute failed: Cannot add or update a child row: a foreign key constraint
fails (`koha_myclone`.`accountlines`, CONSTRAINT
`accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`) REFERENCES
`borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE) at
/usr/share/koha/Koha/Object.pm line 170

This line is the culprit:
$patron->account->pay({ amount => 10, debits => [ $debit ] });

The pay routine gets the manager from userenv. When there is no borrowernumber,
Mocks returns 51. And when that does not exist, boom.

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


More information about the Koha-bugs mailing list