https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40136 --- Comment #30 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 196118 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196118&action=edit Bug 40136: (follow-up) Fix IsItemIssued.t mock_userenv mock_userenv was called before the test patron was created and used the default borrowernumber (51), which doesn't necessarily exist in the test database. This caused safe_to_delete to crash on the not_same_branch check when Koha::Patrons->find returned undef. Move mock_userenv after patron creation and pass the actual borrowernumber. Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.