Bugzilla – Attachment 144852 Details for
Bug 26558
Guarantor information is lost when an error occurs during new account creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26558: Make guarantor information persist despite an error
Bug-26558-Make-guarantor-information-persist-despi.patch (text/plain), 3.26 KB, created by
ByWater Sandboxes
on 2022-12-27 17:01:19 UTC
(
hide
)
Description:
Bug 26558: Make guarantor information persist despite an error
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2022-12-27 17:01:19 UTC
Size:
3.26 KB
patch
obsolete
>From e2761701fd0e33fcb27d7ca8c945b1e535c0f81b Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Wed, 14 Dec 2022 08:36:01 +0200 >Subject: [PATCH] Bug 26558: Make guarantor information persist despite an > error > >When one tries to create an account with patron guarantor and >error occurs (already used username, wrong age etc.), guarantor >information is lost. This patch always saves added patron >guarantor information to the template param new_guarantors. > >To test: >1. Create a new account but cause an error that will keep the >account from saving (enter the wrong age for a category or >give the patron a username that's already being used). >2. Search for and select a guarantor. >3. Try to save the account and wait for the "The following >fields are wrong. Please fix them." message. >=> Note that the guarantor information is gone and you need >to search for and select the guarantor again. >4. Apply this patch. >5. Repeat steps 1.-3. >=> Note that guarantor information hasn't been lost. > >This patch also removes code block from duplicate patron >check because we now save param new_guarantors even if >error doesn't occur. > >To test: >1. Create a new account but cause a duplicate patron error. >2. Search for and select a guarantor. >3. Try to save the account. >=> Guarantor information should persist. > >Sponsored-by: Koha-Suomi Oy > >Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> >--- > members/memberentry.pl | 25 ++++++++++++------------- > 1 file changed, 12 insertions(+), 13 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 2ebf3b4335..e345af807b 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -110,6 +110,18 @@ my $guarantor = undef; > $guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; > $template->param( guarantor => $guarantor ); > >+my @new_guarantors; >+my @new_guarantor_id = $input->multi_param('new_guarantor_id'); >+my @new_guarantor_relationship = $input->multi_param('new_guarantor_relationship'); >+foreach my $gid ( @new_guarantor_id ) { >+ my $patron = Koha::Patrons->find( $gid ); >+ my $relationship = shift( @new_guarantor_relationship ); >+ next unless $patron; >+ my $g = { patron => $patron, relationship => $relationship }; >+ push( @new_guarantors, $g ); >+} >+$template->param( new_guarantors => \@new_guarantors ); >+ > my @delete_guarantor = $input->multi_param('delete_guarantor'); > foreach my $id ( @delete_guarantor ) { > my $r = Koha::Patron::Relationships->find( $id ); >@@ -250,19 +262,6 @@ if ( ( $op eq 'insert' ) and !$nodouble ) { > if ( $patrons->count > 0) { > $nodouble = 0; > $check_member = $patrons->next->borrowernumber; >- >- >- my @new_guarantors; >- my @new_guarantor_id = $input->multi_param('new_guarantor_id'); >- my @new_guarantor_relationship = $input->multi_param('new_guarantor_relationship'); >- foreach my $gid ( @new_guarantor_id ) { >- my $patron = Koha::Patrons->find( $gid ); >- my $relationship = shift( @new_guarantor_relationship ); >- next unless $patron; >- my $g = { patron => $patron, relationship => $relationship }; >- push( @new_guarantors, $g ); >- } >- $template->param( new_guarantors => \@new_guarantors ); > } > } > >-- >2.30.2
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 26558
:
144844
|
144852
|
152782
|
152834
|
155522