Bugzilla – Attachment 186952 Details for
Bug 34671
Collapsing fields in patron form allows saving without mandatory fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34671: Fix QA issues
0001-Bug-34671-Fix-QA-issues.patch (text/plain), 6.85 KB, created by
Emmi Takkinen
on 2025-09-26 06:16:07 UTC
(
hide
)
Description:
Bug 34671: Fix QA issues
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2025-09-26 06:16:07 UTC
Size:
6.85 KB
patch
obsolete
>From 1ac238908905923ebca1566ae511b2a9c0215e7d Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >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 %] > <li data-category_code="[% patron_attribute.category_code | html %]" data-pa_code="[% patron_attribute.code | replace('[^a-zA-Z0-9_-]', '') %]"> >- [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode%] >+ [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %] > <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label> >- [% ELSIF patron_attribute.mandatory && patron_attribute.category_code != patron_category.categorycode %] >- <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label> > [% ELSE %] > <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label> > [% END %] > [% IF ( patron_attribute.use_dropdown ) %] >- [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %] >- <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required"> >- [% ELSIF patron_attribute.mandatory && patron_attribute.category_code != patron_category.categorycode %] >- <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]"> >- [% ELSE %] >- <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]"> >- [% END %] >+ <select >+ id="[% patron_attribute.form_id | html %]" >+ name="[% patron_attribute.form_id | html %]" >+ [% IF patron_attribute.mandatory && patron_attribute.category_code == patron_category.categorycode %]required="required"[% END %] >+ > > <option value=""></option> > [% 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('<span id="'+fieldset_id+'-error" class="required">'+error_msg+'</span>'); >+ if (!$("#" + fieldset_id + "-error").length) { >+ fieldset >+ .find("legend") >+ .before( >+ '<span id="' + >+ fieldset_id + >+ '-error" class="required">' + >+ error_msg + >+ "</span>" >+ ); > } > }); >- } >+ }, > }); > > var mrform = $("#manual_restriction_form"); >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34671
:
155643
|
156145
|
156263
|
156264
|
156453
|
156454
|
158168
|
158299
|
158524
|
158525
|
158526
|
184067
|
184068
|
184069
|
185285
| 186952