[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 16:46:37 CEST 2020


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

--- Comment #7 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 103865
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103865&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 {

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

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


More information about the Koha-bugs mailing list