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 <katrin.fischer.83@web.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2018-06-26 13:04:01 -03:00 committed by Martin Renvoize
parent b6010314df
commit b3cd4a382f
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 1 additions and 1 deletions

View File

@ -614,7 +614,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;