Summary: | MARC subfield 9 not honoring visibility | ||
---|---|---|---|
Product: | Koha | Reporter: | Thomas Klausner <domm> |
Component: | Cataloging | Assignee: | Thomas Klausner <domm> |
Status: | CLOSED FIXED | QA Contact: | Kyle M Hall (khall) <kyle> |
Severity: | normal | ||
Priority: | P5 - low | CC: | dcook, jonathan.druart, kyle, m.de.rooy, martin.renvoize |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2206 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.11.00
|
|
Circulation function: | |||
Attachments: |
only show subfield "9" if subfield "a" is visibile (bug 28022)
Bug 28022: Only show subfield "9" if subfield "a" is visible Bug 28022: Only show subfield "9" if subfield "a" is visible |
Description
Thomas Klausner
2021-03-23 11:15:05 UTC
I believe the issue here is that if we hide the $9 which has the id of the linked authority record, the linking won't happen. So it is required to be visible. I am not sure if the authority linker could be changed to also work with a hidden field, but I think it would require some work at least? Would it work if we consider the visibility of $a? i.e. change: $subfield eq "9" and exists($tagslib->{$tag}->{'a'}->{authtypecode}) and defined($tagslib->{$tag}->{'a'}->{authtypecode}) and $tagslib->{$tag}->{'a'}->{authtypecode} ne '' to something like $subfield eq "9" and is_visibile($tagslib->{$tag}->{'a'}) and exists($tagslib->{$tag}->{'a'}->{authtypecode}) and defined($tagslib->{$tag}->{'a'}->{authtypecode}) and $tagslib->{$tag}->{'a'}->{authtypecode} ne '' where is_visibile would check the value of `hidden` of $tag->{a} ? (probably this wouldn't even need to be a function, but just some bit-twiddling on `hidden`) I was going to test something like this today. But if you say that this might have implications beyond the visibility of a field in the editor, we might end up removing the authtypecode from the various fields (which feels quite wrong..) Greetings, domm I have now implemented a patch that adds a workaround the the workaround (or another corner-case to the corner-case?): https://github.com/domm/Koha/commit/d19abcc23d5793becdd5edca26c4bd2d47fcd33f In the three places where `cataloguing/addbiblio.pl` checks if the subfield `9` has a subfield `a` with an `authtypecode`, I have added an additional check for subfield `a`->`hidden`. This works insofar as the fields (tags) are now no longer shown in the editor when subfield `a` does not have the `Editor` checkbox ticked. But I have no idea if this has any implications on other parts of Koha. So if somebody could please review the patch and comment on whether this the patch is acceptable or not (or what needs to be changed), I'd be very grateful! I'm also not really sure if you want the patch via a github pull request, or via a plain old patch per mail (or some other way?) Greetings, Thomas Klausner As Martin mentioned on the listserv, if you can use git-bz to attach a patch here (https://wiki.koha-community.org/wiki/Git_bz_configuration), then we can move things along. At a glance, this is looking OK. I'm sure between Katrin, Martin, and myself that we can get this done quickly. Since the change only targets the addbiblio.pl script, there shouldn't really be any implications for other parts of Koha. The only scenario I can think that could be a problem would be where someone has added a thesaurus to a subfield other than $a and they've hidden the $a but that's quite an edge case and they are already arguably doing the wrong thing there... Created attachment 119123 [details] [review] only show subfield "9" if subfield "a" is visibile (bug 28022) Amend the workaround (from but 2206) to only show subfield "9" in editor if subfield "a" has the editor-visibility bit set Anything I can do to make sure this fix gets in the next release? Created attachment 119903 [details] [review] Bug 28022: Only show subfield "9" if subfield "a" is visible Amend the workaround (from but 2206) to only show subfield "9" in editor if subfield "a" has the editor-visibility bit set. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Thanks for your submission Thomas, my apologies it took me a little while to come around to testing it... sooooo many things on the list. Signing off as it works as described and I can't see any obvious regressions. Created attachment 124768 [details] [review] Bug 28022: Only show subfield "9" if subfield "a" is visible Amend the workaround (from but 2206) to only show subfield "9" in editor if subfield "a" has the editor-visibility bit set. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master for 21.11, thanks to everybody involved! Congratulations, Thomas, for your first patch pushed! |