Bugzilla – Attachment 54628 Details for
Bug 16960
Patron::Modifications should be fixed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16960: Delete previous patron modifications
Bug-16960-Delete-previous-patron-modifications.patch (text/plain), 1.44 KB, created by
Jonathan Druart
on 2016-08-19 12:44:14 UTC
(
hide
)
Description:
Bug 16960: Delete previous patron modifications
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-08-19 12:44:14 UTC
Size:
1.44 KB
patch
obsolete
>From eebd492eb4b9672d411f765685a8dbd5df5233b3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 19 Aug 2016 13:39:35 +0100 >Subject: [PATCH] Bug 16960: Delete previous patron modifications > >If a patron edit his/her details a second time, we need to delete the >first ones to avoid a "duplicate entry for key PRIMARY" error. > >Test plan: >Log in at the OPAC >Edit your details >Edit them again >=> Without this patch, Koha will crash >=> With the patch applied, everything should work as expected >--- > opac/opac-memberentry.pl | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 1bf5acf..1a5bac4 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -227,6 +227,14 @@ elsif ( $action eq 'update' ) { > > $borrower_changes{borrowernumber} = $borrowernumber; > >+ # 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 $m = Koha::Patron::Modification->new( \%borrower_changes )->store(); > > $template->param( >-- >2.8.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 16960
:
53657
|
53920
|
54027
|
54079
|
54080
|
54157
|
54461
|
54628
|
54665
|
54666
|
54667
|
54668