Bug 27943

Summary: MARC21 authorities not support 7XX on display
Product: Koha Reporter: George Veranis <gveranis>
Component: MARC Authority data supportAssignee: George Veranis <gveranis>
Status: Needs documenting --- QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: bugzilla, frank.hansen, fridolin.somers, paul.poulain
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:
Attachments: Bug 27943: add support for 7XX equal terms on authorities marc21 display
Bug 27943: add support for 7XX equal terms on authorities marc21 display
Bug 27943: (QA follow-up) Add missing TT filters
Bug 27943: (follow-up) Fix unit test, and use systempreference AuthoritySeparator
Bug 27943: (follow-up) Fix unit test, and use systempreference AuthoritySeparator
Bug 27943: add support for 7XX equal terms on authorities marc21 display
Bug 27943: (QA follow-up) Add missing TT filters
Bug 27943: (follow-up) Fix unit test, and use systempreference AuthoritySeparator
Bug 27943: (QA follow-up) Perltidy
Bug 27943: (QA follow-up) Alternate display in result lists

Description George Veranis 2021-03-12 13:47:03 UTC
If we add a field of 7XX in a MARC21 authority record, then on authority result the 7XX should shown as = value_of_heading_of_7XX next to the main heading of the authority as equal to that. https://www.loc.gov/marc/authority/ad7xx.html

That enchancement would be very useful for non latin catalogs where have the latin heading and the non latin equal heading. 

example : 
100	0#$aAugustine,$cSaint, Bishop of Hippo
[LAC English heading]
700	05$wa$aAugustin,$csaint, évêque d’Hippone.$0(CaOONL)0053A1978F#
[Corresponding LAC French heading]
Comment 1 George Veranis 2021-07-02 14:42:41 UTC
Created attachment 122549 [details] [review]
Bug 27943: add support for 7XX equal terms on authorities marc21 display

Currently when a MARC21 authority has 7XX field they do not display on
authority search result page. 7XX is equal term of 1XX based on LC rules.
Applying this patch will enable that feature, which is important for non latin
catalogues.

Test plan:
1) Add a new authority with 1XX and 7XX fields.
2) Try to search that authority and check if 7XX values are displayed
3) Apply this patch
4) Try to search that authority and you will see that 7XX values are displayed
   like "1XX = 7XX"

Sponsored-by: Keratsini-Drapetsona Municipal Library, Greece
Mentored-by: Andreas Roussos
Comment 2 Frank Hansen 2022-03-31 13:25:46 UTC
Created attachment 132778 [details] [review]
Bug 27943: add support for 7XX equal terms on authorities marc21 display

Currently when a MARC21 authority has 7XX field they do not display on
authority search result page. 7XX is equal term of 1XX based on LC rules.
Applying this patch will enable that feature, which is important for non latin
catalogues.

Test plan:
1) Add a new authority with 1XX and 7XX fields.
2) Try to search that authority and check if 7XX values are displayed
3) Apply this patch
4) Try to search that authority and you will see that 7XX values are displayed
   like "1XX = 7XX"

Sponsored-by: Keratsini-Drapetsona Municipal Library, Greece
Mentored-by: Andreas Roussos
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Works for me!
Comment 3 Katrin Fischer 2022-04-24 11:57:41 UTC
Created attachment 133712 [details] [review]
Bug 27943: (QA follow-up) Add missing TT filters
Comment 4 Katrin Fischer 2022-04-24 12:00:59 UTC
I have added a follow-up to fix the missing TT filters, but there are 2 issues that are a bit more than QA can fix:

1) Tests are failing

Changes to any core routines in C4 and Koha need to be accompanied by unit tests per the coding guidelines, but there is a little more here as the existing tests fail with the patches applied:

prove t/db_dependent/AuthoritiesMarc.t

t/db_dependent/AuthoritiesMarc.t .. 2/12 
#   Failed test 'test BuildSummary for MARC21'
#   at t/db_dependent/AuthoritiesMarc.t line 158.
#     Structures begin differing at:
#          $got->{equalterm} = ARRAY(0x563fe77a47f0)
#     $expected->{equalterm} = Does not exist

#   Failed test 'test BuildSummary for UNIMARC'
#   at t/db_dependent/AuthoritiesMarc.t line 202.
#     Structures begin differing at:
#          $got->{equalterm} = ARRAY(0x563fe36e6b00)
#     $expected->{equalterm} = Does not exist
Cannot determine authority type for record: 1710 at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 566.
t/db_dependent/AuthoritiesMarc.t .. 12/12 # Looks like you failed 2 tests of 12.
t/db_dependent/AuthoritiesMarc.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/12 subtests 

Test Summary Report
-------------------
t/db_dependent/AuthoritiesMarc.t (Wstat: 512 Tests: 12 Failed: 2)
  Failed tests:  6, 8
  Non-zero exit status: 2


2) Hardcode delimiter

This hardcodes the delimiter for subheadings to "--", but I believe it should be using the system preference AuthoritySeparator instead.


Please let us know if you need help in fixing those.
Comment 5 Katrin Fischer 2022-04-24 12:01:41 UTC
My testing record had 2 700 fields, as the field is repeatable. It works nicely for display.
Comment 6 George Veranis 2022-04-27 08:57:40 UTC
Hi Katrin, thanks for the review of that bug I will try to do the changes that you proposed . I'm not sure about the unit tests but I will check it to be compatible with that.
Comment 7 George Veranis 2023-02-20 11:11:41 UTC
Created attachment 146945 [details] [review]
Bug 27943: (follow-up) Fix unit test, and use systempreference AuthoritySeparator

Instead of hardcoding the separator we take the value from systempreference.
Also adjust the unit test to expect the "equalterm" array.
Test plan same as before.
Comment 8 Biblibre Sandboxes 2023-08-17 08:59:17 UTC
Created attachment 154502 [details] [review]
Bug 27943: (follow-up) Fix unit test, and use systempreference AuthoritySeparator

Instead of hardcoding the separator we take the value from systempreference.
Also adjust the unit test to expect the "equalterm" array.
Test plan same as before.

Signed-off-by: Christian Nelson <christian.nelson@uwasa.fi>
Comment 9 Katrin Fischer 2023-10-14 23:13:21 UTC
Created attachment 157173 [details] [review]
Bug 27943: add support for 7XX equal terms on authorities marc21 display

Currently when a MARC21 authority has 7XX field they do not display on
authority search result page. 7XX is equal term of 1XX based on LC rules.
Applying this patch will enable that feature, which is important for non latin
catalogues.

Test plan:
1) Add a new authority with 1XX and 7XX fields.
2) Try to search that authority and check if 7XX values are displayed
3) Apply this patch
4) Try to search that authority and you will see that 7XX values are displayed
   like "1XX = 7XX"

Sponsored-by: Keratsini-Drapetsona Municipal Library, Greece
Mentored-by: Andreas Roussos
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Works for me!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2023-10-14 23:13:24 UTC
Created attachment 157174 [details] [review]
Bug 27943: (QA follow-up) Add missing TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2023-10-14 23:13:27 UTC
Created attachment 157175 [details] [review]
Bug 27943: (follow-up) Fix unit test, and use systempreference AuthoritySeparator

Instead of hardcoding the separator we take the value from systempreference.
Also adjust the unit test to expect the "equalterm" array.
Test plan same as before.

Signed-off-by: Christian Nelson <christian.nelson@uwasa.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2023-10-14 23:13:30 UTC
Created attachment 157176 [details] [review]
Bug 27943: (QA follow-up) Perltidy

I have some trouble to get the tidyness test on
AuthoritiesMarc.pm passing. There are several outstanding
patches touching this file, so I didn't dare to perltidy
the whole file just yet.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2023-10-14 23:13:33 UTC
Created attachment 157177 [details] [review]
Bug 27943: (QA follow-up) Alternate display in result lists

The original display put the equivalent heading right after
the main heading with a = as separator. As the 7xx are repeatable
that could get croweded easily, also if the terms are longer
we might see not so nice breakage.

This puts every 7xx on its own line below the main heading
with some indentation.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Tomás Cohen Arazi (tcohen) 2023-10-30 12:03:02 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 15 Fridolin Somers 2023-11-08 08:17:51 UTC
Enhancement not pushed to 23.05.x