From 05809159a7f4dc20fa188e7a9b72ed3f064ef3c0 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Fri, 7 Nov 2025 13:11:53 +0200 Subject: [PATCH 2/2] Bug 34671: Fix validating hidden mandatory patron attribute fields Hidden mandatory patron attribute field were still causing problems while saving. Class required was added even if the attribute wasn't tied to patrons category. To test: 1. Add patron attribute to some patron category and set it as mandatory. 2. Add or modify patron with different category. 3. Attempt to save. => Make sure saving the patron is succesful. 4. Add or modify patron with category where you added mandatory attribute. => Make sure that attribute is displayed in form and it's manadatory. Sponsored-by: Koha-Suomi Oy --- .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 7c657c2430..04c8f66d3b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1523,7 +1523,7 @@ [% END %] [% FOREACH patron_attribute IN pa_loo.items %]
  • - [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %] + [% IF patron_attribute.mandatory && (patron_attribute.category_code == patron_category.categorycode || !patron_attribute.category_code) %] [% ELSE %] @@ -1532,7 +1532,7 @@ [% ELSE %] - [% IF patron_attribute.mandatory %] + [% IF patron_attribute.mandatory && (patron_attribute.category_code == patron_category.categorycode || !patron_attribute.category_code) %] [% IF patron_attribute.is_date %]