From 3f1248a8fc37b65f81595001de6e7f1a2f0df56a Mon Sep 17 00:00:00 2001 From: Adam Styles Date: Fri, 4 Mar 2022 11:22:38 +1100 Subject: [PATCH] Bug 30224: Show correct important field in cataloguing validation This patch fxes the cataloguing validation messages to show the correct tag, when the whole field is important (not just a subfield). Note: Look at Bug 30159 to fix the formatting of the validation popup. 1. Go to Administration -> MARC bibliographic frameworks 2. Click Actions next to a framework, view MARC structure 3. Edit multiple tags (at least 2) and check the Important checkbox. 4. Go to cataloguing and create a new record using the framework you just edited 5. Don't fill any of the important fields. Click Save to force the validation for the important tags 6. Notice that the error message shows that an important field isn't filled, but the tag number shown is repeated for each message. The 'Go to field' link goes to the right tag, but the tag number shown is incorrect. 7. Apply patch and refresh page 8. Click Save to force validation again. 9. Confirm the correct tag number is now showing for each error message. Sponsored-by: Education Services Australia SCIS --- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 5325d6e91fe..97b70a2b9d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -688,7 +688,7 @@ function PopupMARCFieldDoc(field) { if( mandatoryFields[prop]["importance"] == "mandatory" ){ StrAlert += "
  • " + _("Field %s is mandatory, at least one of its subfields must be filled.").format( prop ) + ' ' + _("Go to field") + '
  • '; } else { - StrAlert += "
  • " + _("Field %s is important, at least one of its subfields must be filled.").format(arr[0]) + ' ' + _("Go to field") + '
  • '; + StrAlert += "
  • " + _("Field %s is important, at least one of its subfields must be filled.").format(prop) + ' ' + _("Go to field") + '
  • '; } } StrAlert += ""; -- 2.11.0