View | Details | Raw Unified | Return to bug 30889
Collapse All | Expand All

(-)a/Koha/BackgroundJob.pm (-12 / +17 lines)
Lines 166-183 sub process { Link Here
166
166
167
    $args ||= {};
167
    $args ||= {};
168
168
169
    my $context = decode_json($self->context);
169
    if ( $self->context ) {
170
    C4::Context->_new_userenv(-1);
170
        my $context = decode_json($self->context);
171
    C4::Context->interface( $context->{interface} );
171
        C4::Context->_new_userenv(-1);
172
    C4::Context->set_userenv(
172
        C4::Context->interface( $context->{interface} );
173
        $context->{number},       $context->{id},
173
        C4::Context->set_userenv(
174
        $context->{cardnumber},   $context->{firstname},
174
            $context->{number},       $context->{id},
175
        $context->{surname},      $context->{branch},
175
            $context->{cardnumber},   $context->{firstname},
176
        $context->{branchname},   $context->{flags},
176
            $context->{surname},      $context->{branch},
177
        $context->{emailaddress}, undef,
177
            $context->{branchname},   $context->{flags},
178
        $context->{desk_id},      $context->{desk_name},
178
            $context->{emailaddress}, undef,
179
        $context->{register_id},  $context->{register_name}
179
            $context->{desk_id},      $context->{desk_name},
180
    );
180
            $context->{register_id},  $context->{register_name}
181
        );
182
    }
183
    else {
184
        Koha::Logger->get->warn(qq{A background job didn't have context defined ($self->id)});
185
    }
181
186
182
    return $derived_class->process( $args );
187
    return $derived_class->process( $args );
183
}
188
}
(-)a/t/db_dependent/Koha/BackgroundJobs/BatchUpdateBiblio.t (-2 / +1 lines)
Lines 52-58 subtest "Exceptions must be stringified" => sub { Link Here
52
            type           => 'batch_biblio_record_modification',
52
            type           => 'batch_biblio_record_modification',
53
            data           => encode_json {
53
            data           => encode_json {
54
                record_ids => [ $biblio->biblionumber ],
54
                record_ids => [ $biblio->biblionumber ],
55
            }
55
            },
56
        }
56
        }
57
    )->store;
57
    )->store;
58
    $job = Koha::BackgroundJobs->find( $job->id );
58
    $job = Koha::BackgroundJobs->find( $job->id );
59
- 

Return to bug 30889