Bugzilla – Attachment 131106 Details for
Bug 30181
Koha::BackgroundJob->_derived_class returns an empty object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30181: Make Koha::BackgroundJob->_derived_class return the right thing
Bug-30181-Make-KohaBackgroundJob-derivedclass-retu.patch (text/plain), 1.20 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-02-25 09:46:59 UTC
(
hide
)
Description:
Bug 30181: Make Koha::BackgroundJob->_derived_class return the right thing
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-02-25 09:46:59 UTC
Size:
1.20 KB
patch
obsolete
>From bdef65ddcf7e93c6641faf710082fe0d86579f64 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 25 Feb 2022 06:42:25 -0300 >Subject: [PATCH] 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@theke.io> >--- > Koha/BackgroundJob.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index cb8a71fb04..150e6e2c4e 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -240,7 +240,7 @@ sub _derived_class { > unless $class; > > eval "require $class"; >- return $class->new; >+ return $class->_new_from_dbic( $self->_result ); > } > > =head3 type_to_class_mapping >-- >2.35.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30181
:
131105
|
131106
|
131107
|
131322
|
131323
|
131324
|
131325
|
131799
|
131800
|
131801
|
131802
|
131845
|
131846
|
131847
|
131848