Bug 19989: Use Koha::Patron::Modifications->delete instead of loop

Test:
1) Make a change to the user in the OPAC
2) In the staff client make sure this is the only request

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Zoe Bennett 2018-01-17 04:01:01 +00:00 committed by Jonathan Druart
parent f3d62e4331
commit 0f3fef5cae
1 changed files with 1 additions and 7 deletions

View File

@ -272,13 +272,7 @@ elsif ( $action eq 'update' ) {
$borrower_changes{borrowernumber} = $borrowernumber;
$borrower_changes{extended_attributes} = to_json($extended_attributes_changes);
# FIXME update the following with
# Koha::Patron::Modifications->search({ borrowernumber => $borrowernumber })->delete;
# when bug 17091 will be pushed
my $patron_modifications = Koha::Patron::Modifications->search({ borrowernumber => $borrowernumber });
while ( my $patron_modification = $patron_modifications->next ) {
$patron_modification->delete;
}
my $patron_modifications = Koha::Patron::Modifications->search({ borrowernumber => $borrowernumber })->delete;
my $m = Koha::Patron::Modification->new( \%borrower_changes )->store();