Bug 26558: Make guarantor information persist despite an error
authorEmmi Takkinen <emmi.takkinen@koha-suomi.fi>
Wed, 14 Dec 2022 06:36:01 +0000 (08:36 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 13 Oct 2023 00:11:43 +0000 (14:11 -1000)
commite522b49641981fbf45dfa6a7966c7c133f8c068d
tree6f83c7963ce96455a364abb4e7d11311cd990fe1
parent9f80b40ecea72cdca75bcd50e41f7a9016042a32
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 70fc698899f51b9f17bd38a91df75bf3c3274e1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
members/memberentry.pl