Bugzilla – Attachment 183159 Details for
Bug 40092
Adding authorities - clicking save doesn't fill auto-populated fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40092: Fill auto-populated control fields in MARC editors
Bug-40092-Fill-auto-populated-control-fields-in-MA.patch (text/plain), 3.70 KB, created by
David Nind
on 2025-06-11 12:17:33 UTC
(
hide
)
Description:
Bug 40092: Fill auto-populated control fields in MARC editors
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-06-11 12:17:33 UTC
Size:
3.70 KB
patch
obsolete
>From 6639771dec72fcea8ec4df7721f5a09c6d513168 Mon Sep 17 00:00:00 2001 >From: Andrii Nugged <nugged@gmail.com> >Date: Mon, 9 Jun 2025 02:16:21 +0300 >Subject: [PATCH] Bug 40092: Fill auto-populated control fields in MARC editors >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Problem: Clicking Save doesn't fill control fields automatically in both the authority and bibliographic MARC editors. > >Regression introduced when class `framework_plugin` was added: `AreMandatoriesNotOk()` rewrites the element `class` attribute with a hardâcoded string, dropping existing classes. Because the plugins that populate 000/003/005/008 rely on `framework_plugin`, the inputs are skipped and the fields remain empty. > >This patch stops clobbering the attribute and instead appends the visual 'notFilled' class via `elt.classList.add()`. The one-line fix is applied in both `authorities.tt` and `addbiblio.tt`. > >Test plan: > >Authority editor > >1. Authorities â New authority â choose framework (e.g. Topical term). >2. Leave all fields blank, click Save. > Before patch: 000, 003, 008 remain blank; required tags turn yellow. >3. Apply patch, hardârefresh, repeat steps 1â2. > After patch: control fields autoâpopulate as in 24.11. > >Bibliographic editor > >1. Cataloguing â New record (Not in Advanced MARC editor). >2. Click Save without entering data. > Before patch: control fields stay blank; record cannot be saved. >3. Apply patch, hardârefresh, repeat. > After patch: record is blocked, but 000/005/008 autoâpopulate. > >Both editors behave like 24.11; mandatory highlighting still works. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../intranet-tmpl/prog/en/modules/authorities/authorities.tt | 3 ++- > .../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index 09f997a2af..466480e75f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >@@ -242,7 +242,8 @@ > if ( elt.nodeName == 'SELECT' ) { > $(elt).siblings('.select2').find("span[role='combobox']").addClass(notFilledClass); > } else { >- elt.setAttribute('class','input_marceditor noEnterSubmit ' + notFilledClass); >+ // elt.setAttribute('class','input_marceditor noEnterSubmit framework_plugin ' + notFilledClass); >+ elt.classList.add(notFilledClass); > } > $('#' + subfields[i]).focus(); > tabflag[tag+subfield+tagnumber][1]=label[i]; >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 003358530c..5433e5c618 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -576,7 +576,8 @@ > if ( elt.nodeName == 'SELECT' ) { > $(elt).siblings('.select2').find("span[role='combobox']").addClass(notFilledClass); > } else { >- elt.setAttribute('class','input_marceditor noEnterSubmit ' + notFilledClass); >+ // elt.setAttribute('class','input_marceditor noEnterSubmit framework_plugin ' + notFilledClass); >+ elt.classList.add(notFilledClass); > } > $('#' + subfields[i]).focus(); > tabflag[tag+subfield+tagnumber][1]=label[i]; >-- >2.39.5
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 40092
:
183124
| 183159