Bug 37622: Fix add_debit
We should not call discard_changes after accessing ->id but before Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
a32495bf58
commit
9e8b9f607a
|
|
@ -220,9 +220,9 @@ sub add_debit {
|
|||
|
||||
my $debit = $patron->account->add_debit($data);
|
||||
$debit = Koha::Account::Debit->_new_from_dbic( $debit->{_result} );
|
||||
$debit->discard_changes;
|
||||
|
||||
$c->res->headers->location( $c->req->url->to_string . '/' . $debit->id );
|
||||
$debit->discard_changes;
|
||||
|
||||
return $c->render(
|
||||
status => 201,
|
||||
|
|
|
|||
Loading…
Reference in New Issue