[Koha-bugs] [Bug 30181] Koha::BackgroundJob->_derived_class returns an empty object

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 3 15:23:07 CET 2022


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

--- Comment #7 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 131323
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131323&action=edit
Bug 30181: Make Koha::BackgroundJob->_derived_class return the right thing

This patch makes _derived_class rely on _new_from_dbic to generate a new
object with the right class, but based on the same DB row. Not an empty
one as it was before. This way we can remove some biolerplate that is
required now when writing background job classes.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/BackgroundJob.t
=> FAIL: Boo, tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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