To reproduce: 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 4. Note that the guarantor information is gone and you need to search for and select the guarantor again
Tested, this is still an issue on current master.
Readding guarantor parameters when error occurs should to the trick. This could be achived same way it is done in bug 24113, but at the end of following code block in memberentry.pl: if ($nok or !$nodouble){ $op="add" if ($op eq "insert"); $op="modify" if ($op eq "save"); %data=%newdata; $template->param( updtype => ($op eq 'add' ?'I':'M')); # used to check for $op eq "insert"... but we just changed $op! unless ($step){ $template->param( step_1 => 1,step_2 => 1,step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1, step_7 => 1 ); } } However this really feels like pointless repetition and there should probably be a better way to do this. Or way to make these parameters persist.
Created attachment 144844 [details] [review] 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
Created attachment 144852 [details] [review] 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>
Worked great and will be very helpful.
Can we move that in a condition? We don't need to do it if all went well.
Created attachment 152782 [details] [review] 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
I moved the check in if ($nok) statement. Barbara, would you like to test and sign-off again?
Created attachment 152834 [details] [review] 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: Sam Lau <samalau@gmail.com>
*** Bug 34750 has been marked as a duplicate of this bug. ***
Created attachment 155522 [details] [review] 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: Sam Lau <samalau@gmail.com> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Note we have opened Bug 34776 which is a similar problem, messaging preferences are wiped when there is an error.
Pushed to master for 23.11. Nice work everyone, thanks!
Nice small enhancement, I choose to backport Pushed to 23.05.x for 23.05.05
Enhancement - not backporting to 22.11.x