[Koha-bugs] [Bug 25303] Koha::Objects->delete should not skip overridden object class ->delete

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 28 14:56:58 CEST 2020


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

--- Comment #1 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 103855
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103855&action=edit
Bug 25303: Make Koha::Objects->delete loop on the object set

If we call Koha::Libraries->delete but Koha::Library->delete exists
(ie. Koha::Object->delete is overridden), then we Koha::Objects->delete
will be called and the overridden will not be executed.

This patch suggests to test if the method is overridden (using
Class::Inspector->function_exists). If so we loop on the different
objects of the set in a transaction and call the overridden ->delete method.

Existing tests widely cover this change.
t/db_dependent/Koha/Objects.t
    subtest 'Return same values as DBIx::Class' => sub {

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


More information about the Koha-bugs mailing list