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

(-)a/Koha/Hold.pm (+24 lines)
Lines 200-205 sub set_transfer { Link Here
200
    $self->found('T');
200
    $self->found('T');
201
    $self->store();
201
    $self->store();
202
202
203
    Koha::Plugins->call(
204
        'after_hold_action',
205
        {
206
            action  => 'transfer',
207
            payload => { hold => $self->get_from_storage }
208
        }
209
    );
210
203
    return $self;
211
    return $self;
204
}
212
}
205
213
Lines 257-262 sub set_waiting { Link Here
257
265
258
    $self->set($values)->store();
266
    $self->set($values)->store();
259
267
268
    Koha::Plugins->call(
269
        'after_hold_action',
270
        {
271
            action  => 'waiting',
272
            payload => { hold => $self->get_from_storage }
273
        }
274
    );
275
260
    return $self;
276
    return $self;
261
}
277
}
262
278
Lines 345-350 sub set_processing { Link Here
345
    $self->found('P');
361
    $self->found('P');
346
    $self->store();
362
    $self->store();
347
363
364
    Koha::Plugins->call(
365
        'after_hold_action',
366
        {
367
            action  => 'processing',
368
            payload => { hold => $self->get_from_storage }
369
        }
370
    );
371
348
    return $self;
372
    return $self;
349
}
373
}
350
374
(-)a/t/db_dependent/Koha/Plugins/Holds_hooks.t (-2 / +19 lines)
Lines 130-136 subtest 'after_hold_action (placed) hook tests' => sub { Link Here
130
130
131
subtest 'Koha::Hold tests' => sub {
131
subtest 'Koha::Hold tests' => sub {
132
132
133
    plan tests => 4;
133
    plan tests => 7;
134
134
135
    $schema->storage->txn_begin;
135
    $schema->storage->txn_begin;
136
136
Lines 181-186 subtest 'Koha::Hold tests' => sub { Link Here
181
    qr/after_hold_action called with action: resume, ref: Koha::Hold/,
181
    qr/after_hold_action called with action: resume, ref: Koha::Hold/,
182
      '->resume calls the after_hold_action hook';
182
      '->resume calls the after_hold_action hook';
183
183
184
    warning_like {
185
        $hold->set_transfer;
186
    }
187
    qr/after_hold_action called with action: transfer, ref: Koha::Hold/,
188
      '->set_transfer calls the after_hold_action hook';
189
190
    warning_like {
191
        $hold->set_processing;
192
    }
193
    qr/after_hold_action called with action: processing, ref: Koha::Hold/,
194
      '->set_processing calls the after_hold_action hook';
195
196
    warning_like {
197
        $hold->set_waiting;
198
    }
199
    qr/after_hold_action called with action: waiting, ref: Koha::Hold/,
200
      '->set_waiting calls the after_hold_action hook';
201
184
    warning_like {
202
    warning_like {
185
        $hold->cancel;
203
        $hold->cancel;
186
    }
204
    }
187
- 

Return to bug 31894