[Bug 40092] New: Adding authorities - clicking save doesn't fill auto-populated fields
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Bug ID: 40092 Summary: Adding authorities - clicking save doesn't fill auto-populated fields Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: MARC Authority data support Assignee: koha-bugs@lists.koha-community.org Reporter: david@davidnind.com QA Contact: testopia@bugs.koha-community.org When adding a new authority record, clicking save (without filling in any fields) doesn't fill in the auto-populated fields such as 000, 003, and 008. In a 24.11.x instance, this works (start up a local instance or use one of the demos): 1. Authorities > New authority > Topical term 2. Don't enter any information in any fields. 3. Click 'save'. 4. Note that fields such as 000 and 003 are auto-populated (not sure if that is the right term). In 25.05.00 or main, this no longer works: 1. Repeat steps 1 to 3. 2. Note that: - fields such as 000 and 003 are not auto-populated - the mandatory fields are now highlighted in yellow - clicking the individual fields doesn't auto-populate them -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 --- Comment #1 from David Nind <david@davidnind.com> --- See Mattermost chat discussion (8 June 2025): https://chat.koha-community.org/koha-community/pl/akiuk7i73b8qmd38haaxrq7z5o -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nugged@gmail.com --- Comment #2 from Andrii Nugged <nugged@gmail.com> --- We're preparing to upgrade our production to 25.05, so we've been doing thorough beta testing with librarians with our Finnish libraries. During this testing, we discovered that the main MARC records interface is also affected by the same issue. We found why, prepared a fix, and post-checked with librarians that this bug is gone. The root cause is in the JavaScript function `AreMandatoriesNotOk`, which uses hardcoded rewriting of classes, so it removed recently announced `framework_plugin` calss: elt.setAttribute('class', 'input_marceditor noEnterSubmit ' + notFilledClass); so our solution is to expand hardcoded line with the class: elt.setAttribute('class', 'input_marceditor noEnterSubmit framework_plugin ' + notFilledClass); or, better yet, or, if that does not creates any other border cases, completely replace the hardcoded class assignment with a more flexible method: elt.classList.add(notFilledClass); Code below. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nugged@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 --- Comment #3 from Andrii Nugged <nugged@gmail.com> --- Created attachment 183124 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183124&action=edit Bug 40092: Fill auto-populated control fields in MARC editors 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #4 from Andrii Nugged <nugged@gmail.com> --- one thing to decide: I put both variants in code, one commented out so we should throw it away if second more elegant (and future-for-new-classes-proof) one is better and works: // elt.setAttribute('class','input_marceditor noEnterSubmit framework_plugin ' + notFilledClass); or .classList.add(notFilledClass); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Shane Sammons <ssammons@npelem.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ssammons@npelem.com --- Comment #5 from Shane Sammons <ssammons@npelem.com> --- I tried the proposed solution as I was also experiencing no auto-population on 000,003,005,and 008 in cataloging coming from 23 to 25.05. I just tried adding a new MARC record and just pressed save (no data entry) and now the fields 000,003,005,and 008 all populate as they did before. I have the lines commented out as recommended. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183124|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 183159 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183159&action=edit Bug 40092: Fill auto-populated control fields in MARC editors 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes a regression release notes| |between Koha 24.11, and | |25.05 and main. When adding | |a new authority or | |bibliogrpaphic record, | |clicking save (without | |filling in any fields) now | |restores filling in the | |auto-populated fields such | |as 000, 003, and 008. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 --- Comment #7 from Andrii Nugged <nugged@gmail.com> --- Notes for QA phase: we need to decide if `.classList.add(notFilledClass);` is universal and do not interfere/future proof (looks like). If so, then remove another proposed but commented out solution `// elt.setAttribute...`. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 --- Comment #8 from David Nind <david@davidnind.com> --- It would also be nice to have a test for this, if it is possible (I have no idea how to create them myself!). That would help avoid breaking the feature again in the future. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #9 from David Nind <david@davidnind.com> --- I changed the status to major, ideally so that this can be fixed in the first maintenance release for 25.05. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Adding authorities - |Clicking save doesn't fill |clicking save doesn't fill |auto-populated fields in |auto-populated fields |authority and biblio editor CC| |aleisha@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This fixes a regression |This fixes a regression release notes|between Koha 24.11, and |between Koha 24.11, and |25.05 and main. When adding |25.05 and main. When adding |a new authority or |a new authority or |bibliogrpaphic record, |bibliographic record, |clicking save (without |clicking save (without |filling in any fields) now |filling in any fields) now |restores filling in the |restores filling in the |auto-populated fields such |auto-populated fields such |as 000, 003, and 008. |as 000, 003, and 008. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183159|0 |1 is obsolete| | --- Comment #10 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 183914 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183914&action=edit Bug 40092: Fill auto-populated control fields in MARC editors 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> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |aleisha@catalyst.net.nz |y.org | --- Comment #11 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Andrii Nugged from comment #7)
Notes for QA phase: we need to decide if `.classList.add(notFilledClass);` is universal and do not interfere/future proof (looks like). If so, then remove another proposed but commented out solution `// elt.setAttribute...`.
Thank you Andrii. I decided to use the 'safer' commented out solution because then we're clear on exactly which classes should be present. This is a symptom of a bug which happens earlier in the process, where the framework_plugin class isn't passed back to the template as it should, probably in a Perl script, which we would be able to add a test for... but since this is a major bug, let's get this fix in and work out how to programmatically ensure the right classes are passed through later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 --- Comment #12 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00 |25.11.00,25.05.02 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 --- Comment #13 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00,25.05.02 |25.11.00,25.05.02,24.11.08 released in| | Patch complexity|--- |Trivial patch Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40092 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #16 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org