From df373dc6886eb20d1a5e76d07e7005216de2cba8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 26 Jun 2018 13:04:01 -0300 Subject: [PATCH] Bug 20991: Do not lost patron's category when editing a patron If there is an error in the edit patron form the patron's category is lost. This seems to be a long standing bug. Test plan: - Edit an existing patron - Change the patron category to a category that triggers the error that the user is not in the right age range for that new category - Save, error is triggered => Without this patch the patron category has been reset You should also test different ways to edit/add a patron (quick add, step 1) Signed-off-by: Katrin Fischer Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit b3cd4a382ffad36668164749dafb58d48c00d7f1) Signed-off-by: Fridolin Somers --- members/memberentry.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 77c8eaf01b..31cbd60eaa 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -610,7 +610,7 @@ foreach my $category_type (qw(C A S P I X)) { { 'categorycode' => $patron_category->categorycode, 'categoryname' => $patron_category->description, 'categorycodeselected' => - ( ( defined( $borrower_data->{'categorycode'} ) && $patron_category->categorycode eq $borrower_data->{'categorycode'} ) || ( defined($categorycode) && $patron_category->categorycode eq $categorycode ) ), + ( defined($categorycode) && $patron_category->categorycode eq $categorycode ), }; } my %typehash; -- 2.39.5