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
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-25 21:25 UTC by Andrew Fuerste-Henry
Modified: 2024-10-16 16:48 UTC (History)
4 users (show)

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


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.
Comment 3 Phil Ringnalda 2024-09-27 18:20:51 UTC
On second thought, we shouldn't touch the string at all until someone wants to do a broader rationalization of the way we deal with control fields. We already have the horrible string "Tag 000 subfield 0 fixed length control field in tab 0" when there is no tag 000, there is no subfield 0, only a "subfield" "00" which you can rename to anything you want, say, "@" like we call it everywhere else that we call it a "subfield", and doing so will make no difference, we will still say that subfield 0 is required, and will accept subfield @ being filled in as filling subfield 0.