Bug 24698

Summary: UNIMARC authorities leader plugin
Product: Koha Reporter: Vitor Fernandes <vitorfernandes87>
Component: MARC Authority data supportAssignee: George Veranis <gveranis>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: normal    
Priority: P5 - low CC: esther.melander, fridolin.somers, gveranis, jonathan.druart, joonas.kylmala, kyle, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11
Attachments: Bug 24698: Add plugin and template files for unimarc authority leader
Bug 24698: Add plugin and template files for unimarc authority leader
Bug 24698: Add plugin and template files for unimarc authority leader
Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced
Bug 24698: (QA follow-up) Remove debug info being outputted to the template
Bug 24698: (QA follow-up) Align variables with whitespace
Bug 24698: (QA follow-up) Remove dead code
Bug 24698: (QA follow-up) Fix formatting and typos
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter
Bug 24698: (QA follow-up) Make plugin script executable
Bug 24698: (QA follow-up) Use spaces instead of tabs
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1
Bug 24698: (QA follow-up) Don't specify script type explictly
Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced
Bug 24698: (QA follow-up) Remove debug info being outputted to the template
Bug 24698: (QA follow-up) Align variables with whitespace
Bug 24698: (QA follow-up) Remove dead code
Bug 24698: (QA follow-up) Fix formatting and typos
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter
Bug 24698: (QA follow-up) Make plugin script executable
Bug 24698: (QA follow-up) Use spaces instead of tabs
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1
Bug 24698: (QA follow-up) Don't specify script type explictly
Bug 24698: (follow-up) remove HTML select option for Series
Bug 24698: Add plugin and template files for unimarc authority leader
Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced
Bug 24698: (QA follow-up) Remove debug info being outputted to the template
Bug 24698: (QA follow-up) Align variables with whitespace
Bug 24698: (QA follow-up) Remove dead code
Bug 24698: (QA follow-up) Fix formatting and typos
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter
Bug 24698: (QA follow-up) Make plugin script executable
Bug 24698: (QA follow-up) Use spaces instead of tabs
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1
Bug 24698: (QA follow-up) Don't specify script type explictly
Bug 24698: (follow-up) remove HTML select option for Series

Description Vitor Fernandes 2020-02-20 12:44:28 UTC
The leader for authority record is different than for bibliographic record.
We need a plugin for UNIMARC Authorities leader.

Page 27 - https://www.ifla.org/files/assets/uca/unimarc-authorities-format.pdf
Comment 1 George Veranis 2021-03-12 12:24:00 UTC
Created attachment 118186 [details] [review]
Bug 24698: Add plugin and template files for unimarc authority leader

In Unimarc installations when adding/editing an authority record there is no
Tag Editor for the leader field ( 000 ).

This patch fixes that.

Test plan:

1) Try to catalogue a new authoritry and check if on field 000 you can find
the Tag Editor.
2) Apply the patch.
3) In the authorities framework view the subfields of field 000 and select for
plugin option the value unimarc_leader_authorities.pl.
4) Restart memcached / plack if needed.
5) Repeat step 1 and notice if the Tag Editor is visible and click it to open
new window in order to manage the field contents and press OK.
6) Check the value of the generated leader.
Comment 2 PTFS Europe Sandboxes 2021-09-02 19:57:04 UTC
Created attachment 124437 [details] [review]
Bug 24698: Add plugin and template files for unimarc authority leader

In Unimarc installations when adding/editing an authority record there is no
Tag Editor for the leader field ( 000 ).

This patch fixes that.

Test plan:

1) Try to catalogue a new authoritry and check if on field 000 you can find
the Tag Editor.
2) Apply the patch.
3) In the authorities framework view the subfields of field 000 and select for
plugin option the value unimarc_leader_authorities.pl.
4) Restart memcached / plack if needed.
5) Repeat step 1 and notice if the Tag Editor is visible and click it to open
new window in order to manage the field contents and press OK.
6) Check the value of the generated leader.

Signed-off-by: Esther <estherm@sodapsringsid.com>
Comment 3 Joonas Kylmälä 2021-10-03 12:32:47 UTC
Created attachment 125669 [details] [review]
Bug 24698: Add plugin and template files for unimarc authority leader

In Unimarc installations when adding/editing an authority record there is no
Tag Editor for the leader field ( 000 ).

This patch fixes that.

Test plan:

1) Try to catalogue a new authoritry and check if on field 000 you can find
the Tag Editor.
2) Apply the patch.
3) In the authorities framework view the subfields of field 000 and select for
plugin option the value unimarc_leader_authorities.pl.
4) Restart memcached / plack if needed.
5) Repeat step 1 and notice if the Tag Editor is visible and click it to open
new window in order to manage the field contents and press OK.
6) Check the value of the generated leader.

Signed-off-by: Esther <estherm@sodapsringsid.com>
Comment 4 Joonas Kylmälä 2021-10-03 12:32:51 UTC
Created attachment 125670 [details] [review]
Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced

The original patch "Bug 24698: Add plugin and template files for
unimarc authority leader" doesn't work without explictly importing the
methods from C4::Auth and C4::Output due to the default exports being
changed in those modules after the patch was made.
Comment 5 Joonas Kylmälä 2021-10-03 12:32:55 UTC
Created attachment 125671 [details] [review]
Bug 24698: (QA follow-up) Remove debug info being outputted to the template

This is only needed during development.
Comment 6 Joonas Kylmälä 2021-10-03 12:32:58 UTC
Created attachment 125672 [details] [review]
Bug 24698: (QA follow-up) Align variables with whitespace
Comment 7 Joonas Kylmälä 2021-10-03 12:33:02 UTC
Created attachment 125673 [details] [review]
Bug 24698: (QA follow-up) Remove dead code

These were left off from the copy&paste taken from
unimarc_field_100_authorities.pl
Comment 8 Joonas Kylmälä 2021-10-03 12:33:06 UTC
Created attachment 125674 [details] [review]
Bug 24698: (QA follow-up) Fix formatting and typos
Comment 9 Joonas Kylmälä 2021-10-03 12:33:10 UTC
Created attachment 125675 [details] [review]
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter

It should only be used when we want to override the default of auth
being required.
Comment 10 Joonas Kylmälä 2021-10-03 12:33:13 UTC
Created attachment 125676 [details] [review]
Bug 24698: (QA follow-up) Make plugin script executable
Comment 11 Joonas Kylmälä 2021-10-03 12:33:17 UTC
Created attachment 125677 [details] [review]
Bug 24698: (QA follow-up) Use spaces instead of tabs

This makes the QA script happy.
Comment 12 Joonas Kylmälä 2021-10-03 12:33:21 UTC
Created attachment 125678 [details] [review]
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS
Comment 13 Joonas Kylmälä 2021-10-03 12:33:25 UTC
Created attachment 125679 [details] [review]
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1

This is to make the QA script happy, in order to not to break
Bootstrap CSS rules, see Bug 28066 for more info
Comment 14 Joonas Kylmälä 2021-10-03 12:33:29 UTC
Created attachment 125680 [details] [review]
Bug 24698: (QA follow-up) Don't specify script type explictly

It's makes the QA script complain because the option doesn't have any
effect nowadays:

https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#warnings-for-obsolete-but-conforming-features
Comment 15 Joonas Kylmälä 2021-10-03 12:37:17 UTC
Don't mind the follow-ups ;D I'm willing to Pass QA after checking one thing that is unclear to me:

The spec from that ifla.org website only defines as possible values for "9 Type of entity" the letters a-l but here this adds the option for "Series" with an blank value (space). Is this supposed to be allowed? Where is it mentioned as being a possible value?
Comment 16 George Veranis 2021-10-04 10:34:15 UTC
No it is not allowed base ifla instructions you are right. I forgot to delete it.
Comment 17 Joonas Kylmälä 2021-10-04 16:51:08 UTC
(In reply to George Veranis from comment #16)
> No it is not allowed base ifla instructions you are right. I forgot to
> delete it.

Could you please send a follow-up for that and sign-off the ones I did? (even though they are pretty trivial – but many in count).
Comment 18 George Veranis 2021-10-08 08:16:46 UTC
Created attachment 125929 [details] [review]
Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced

The original patch "Bug 24698: Add plugin and template files for
unimarc authority leader" doesn't work without explictly importing the
methods from C4::Auth and C4::Output due to the default exports being
changed in those modules after the patch was made.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 19 George Veranis 2021-10-08 08:16:50 UTC
Created attachment 125930 [details] [review]
Bug 24698: (QA follow-up) Remove debug info being outputted to the template

This is only needed during development.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 20 George Veranis 2021-10-08 08:16:54 UTC
Created attachment 125931 [details] [review]
Bug 24698: (QA follow-up) Align variables with whitespace

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 21 George Veranis 2021-10-08 08:16:57 UTC
Created attachment 125932 [details] [review]
Bug 24698: (QA follow-up) Remove dead code

These were left off from the copy&paste taken from
unimarc_field_100_authorities.pl

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 22 George Veranis 2021-10-08 08:17:01 UTC
Created attachment 125933 [details] [review]
Bug 24698: (QA follow-up) Fix formatting and typos

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 23 George Veranis 2021-10-08 08:17:05 UTC
Created attachment 125934 [details] [review]
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter

It should only be used when we want to override the default of auth
being required.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 24 George Veranis 2021-10-08 08:17:09 UTC
Created attachment 125935 [details] [review]
Bug 24698: (QA follow-up) Make plugin script executable

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 25 George Veranis 2021-10-08 08:17:12 UTC
Created attachment 125936 [details] [review]
Bug 24698: (QA follow-up) Use spaces instead of tabs

This makes the QA script happy.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 26 George Veranis 2021-10-08 08:17:16 UTC
Created attachment 125937 [details] [review]
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 27 George Veranis 2021-10-08 08:17:20 UTC
Created attachment 125938 [details] [review]
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1

This is to make the QA script happy, in order to not to break
Bootstrap CSS rules, see Bug 28066 for more info

Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 28 George Veranis 2021-10-08 08:17:23 UTC
Created attachment 125939 [details] [review]
Bug 24698: (QA follow-up) Don't specify script type explictly

It's makes the QA script complain because the option doesn't have any
effect nowadays:

https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#warnings-for-obsolete-but-conforming-features
Signed-off-by: George Veranis <gveranis@dataly.gr>
Comment 29 George Veranis 2021-10-08 08:17:27 UTC
Created attachment 125940 [details] [review]
Bug 24698: (follow-up) remove HTML select option for Series

The IFLA authorities format specification defines only the letters a-l
as possible values for authority leader 000 character position 9 ("Type
of entity"). Therefore, the first option from the HTML select dropdown
menu (" - Series") must be removed.

Mentored-by: Andreas Roussos <a.roussos@dataly.gr>
Comment 30 George Veranis 2021-10-08 08:23:31 UTC
(In reply to Joonas Kylmälä from comment #17)
> (In reply to George Veranis from comment #16)
> > No it is not allowed base ifla instructions you are right. I forgot to
> > delete it.
> 
> Could you please send a follow-up for that and sign-off the ones I did?
> (even though they are pretty trivial – but many in count).

Hi Joonas, I did what you asked for , please check-it and tell me if you need something more . Thanks for your QA !
Comment 31 Joonas Kylmälä 2021-10-10 09:05:58 UTC
Created attachment 125998 [details] [review]
Bug 24698: Add plugin and template files for unimarc authority leader

In Unimarc installations when adding/editing an authority record there is no
Tag Editor for the leader field ( 000 ).

This patch fixes that.

Test plan:

1) Try to catalogue a new authoritry and check if on field 000 you can find
the Tag Editor.
2) Apply the patch.
3) In the authorities framework view the subfields of field 000 and select for
plugin option the value unimarc_leader_authorities.pl.
4) Restart memcached / plack if needed.
5) Repeat step 1 and notice if the Tag Editor is visible and click it to open
new window in order to manage the field contents and press OK.
6) Check the value of the generated leader.

Signed-off-by: Esther <estherm@sodapsringsid.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 32 Joonas Kylmälä 2021-10-10 09:06:02 UTC
Created attachment 125999 [details] [review]
Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced

The original patch "Bug 24698: Add plugin and template files for
unimarc authority leader" doesn't work without explictly importing the
methods from C4::Auth and C4::Output due to the default exports being
changed in those modules after the patch was made.

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 33 Joonas Kylmälä 2021-10-10 09:06:06 UTC
Created attachment 126000 [details] [review]
Bug 24698: (QA follow-up) Remove debug info being outputted to the template

This is only needed during development.

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 34 Joonas Kylmälä 2021-10-10 09:06:09 UTC
Created attachment 126001 [details] [review]
Bug 24698: (QA follow-up) Align variables with whitespace

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 35 Joonas Kylmälä 2021-10-10 09:06:13 UTC
Created attachment 126002 [details] [review]
Bug 24698: (QA follow-up) Remove dead code

These were left off from the copy&paste taken from
unimarc_field_100_authorities.pl

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 36 Joonas Kylmälä 2021-10-10 09:06:17 UTC
Created attachment 126003 [details] [review]
Bug 24698: (QA follow-up) Fix formatting and typos

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 37 Joonas Kylmälä 2021-10-10 09:06:20 UTC
Created attachment 126004 [details] [review]
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter

It should only be used when we want to override the default of auth
being required.

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 38 Joonas Kylmälä 2021-10-10 09:06:24 UTC
Created attachment 126005 [details] [review]
Bug 24698: (QA follow-up) Make plugin script executable

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 39 Joonas Kylmälä 2021-10-10 09:06:27 UTC
Created attachment 126006 [details] [review]
Bug 24698: (QA follow-up) Use spaces instead of tabs

This makes the QA script happy.

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 40 Joonas Kylmälä 2021-10-10 09:06:31 UTC
Created attachment 126007 [details] [review]
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 41 Joonas Kylmälä 2021-10-10 09:06:35 UTC
Created attachment 126008 [details] [review]
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1

This is to make the QA script happy, in order to not to break
Bootstrap CSS rules, see Bug 28066 for more info

Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 42 Joonas Kylmälä 2021-10-10 09:06:38 UTC
Created attachment 126009 [details] [review]
Bug 24698: (QA follow-up) Don't specify script type explictly

It's makes the QA script complain because the option doesn't have any
effect nowadays:

https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#warnings-for-obsolete-but-conforming-features
Signed-off-by: George Veranis <gveranis@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 43 Joonas Kylmälä 2021-10-10 09:06:42 UTC
Created attachment 126010 [details] [review]
Bug 24698: (follow-up) remove HTML select option for Series

The IFLA authorities format specification defines only the letters a-l
as possible values for authority leader 000 character position 9 ("Type
of entity"). Therefore, the first option from the HTML select dropdown
menu (" - Series") must be removed.

Mentored-by: Andreas Roussos <a.roussos@dataly.gr>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 44 Joonas Kylmälä 2021-10-10 09:07:11 UTC
(In reply to George Veranis from comment #30)
> Hi Joonas, I did what you asked for , please check-it and tell me if you
> need something more . Thanks for your QA !

Looks good now. Passing QA.
Comment 45 Jonathan Druart 2021-10-12 09:03:45 UTC
Follow-up patches will be squashed when pushed.
Comment 46 Jonathan Druart 2021-10-12 09:18:10 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 47 Kyle M Hall 2021-10-22 13:50:51 UTC
Pushed to 21.05.x for 21.05.05
Comment 48 Fridolin Somers 2021-10-23 01:39:10 UTC
Pushed to 20.11.x for 20.11.11
Comment 49 Victor Grousset/tuxayo 2021-10-26 01:02:45 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.