From 1ac238908905923ebca1566ae511b2a9c0215e7d Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Thu, 25 Sep 2025 14:43:39 +0300 Subject: [PATCH] Bug 34671: Fix QA issues This patch fixes issue with orphan select closing tag and tidies the code. Sponsored-by: Koha-Suomi Oy --- .../prog/en/modules/members/memberentrygen.tt | 16 +++++------- koha-tmpl/intranet-tmpl/prog/js/members.js | 26 ++++++++++++------- 2 files changed, 23 insertions(+), 19 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 479230d4c7..e70f03f334 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1521,21 +1521,17 @@ [% 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 %] - [% ELSIF patron_attribute.mandatory && patron_attribute.category_code != patron_category.categorycode %] - [% ELSE %] [% END %] [% IF ( patron_attribute.use_dropdown ) %] - [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %] - - [% ELSE %] - [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %] [% IF auth_val_loo.authorised_value == patron_attribute.value %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js index 274e2ef5a6..c8f730a156 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members.js @@ -159,8 +159,8 @@ function select_user(borrowernumber, borrower, relationship) { fieldset.show(); //Add attribute required so visible new_guarantor_relationship is validated - if($(".new_guarantor_relationship").is(":visible")){ - $(".new_guarantor_relationship").prop('required',true); + if ($(".new_guarantor_relationship").is(":visible")) { + $(".new_guarantor_relationship").prop("required", true); } if (relationship) { @@ -357,22 +357,30 @@ $(document).ready(function () { else form.beenSubmitted = true; form.submit(); }, - invalidHandler: function(form, validator) { + invalidHandler: function (form, validator) { var error_msg = jQuery.validator.messages.missing_fields; // First remove error messages so that it doesn't // show in fieldset without errors - $("fieldset").each(function(){ - $("#"+$(this).attr("id")+"-error").remove(); + $("fieldset").each(function () { + $("#" + $(this).attr("id") + "-error").remove(); }); - $(validator.errorList).each(function() { + $(validator.errorList).each(function () { var fieldset = $(this.element).parents('[id*="memberentry_"]'); var fieldset_id = fieldset.attr("id"); //Add error message only if it doesn't already exist - if(!$("#"+fieldset_id+"-error").length){ - fieldset.find("legend").before(''+error_msg+''); + if (!$("#" + fieldset_id + "-error").length) { + fieldset + .find("legend") + .before( + '' + + error_msg + + "" + ); } }); - } + }, }); var mrform = $("#manual_restriction_form"); -- 2.34.1