Bug 26820 - "Important" and "Mandatory" flags enforced only at subfield level for tags < 010 in basic editor
Summary: "Important" and "Mandatory" flags enforced only at subfield level for tags < ...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-25 21:25 UTC by Andrew Fuerste-Henry
Modified: 2024-04-26 16:36 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-10-25 21:25:53 UTC
To recreate:
- edit your framework so the 001 is set to Important at the tag level but not at the subfield level
- create a new record in that framework, note that the 001 is not marked Important
- edit framework, set it to Important on the @ subfield in the 001
- reload new record, see the 001 is now marked Important

We're not doing anything with Important at the tag level, so let's not ask for it.
Comment 1 Katrin Fischer 2020-11-01 00:57:11 UTC
Hi Andrew, I tested with 243 and I do get the warning on saving once all mandatory fields are filled in. Could it be only the controlfields acting differently?
Comment 2 Phil Ringnalda 2024-04-26 16:20:31 UTC
Yeah, it's https://git.koha-community.org/Koha-community/Koha/src/commit/1ea4a11c2a88f7b23b482e071db48ae235beb42b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt#L662 which has been like that since the migration to Template Toolkit in 2011.

I don't know where to look for history before that, but I'd be equally unsurprised if before there was another loop that handled 000-009 which had the separate message "Tag 001 is mandatory, it must be filled in" which didn't get migrated, or, that it has always been that way.

The way that now the advanced editor enforces field-level mandatory/important on < 010 and the basic editor does not makes the excuse that "it would be confusing to have a message '... at least one of its subfields must be filled' for a field with only one subfield" seem less confusing than just ignoring the field flag in one of the two editors is.

For a no-new-strings patch to backport, just removing the if(parseInt(arr[0]) >= 10) condition would work fine. Or for new strings, removing the condition and looking at the field number in the for( var prop in mandatoryFields ) loop below to decide between the "at least one of its subfields must be filled" or a new "it must be filled" string would be prettier.