Bug 35452 - Provide more info when using automatic authorities linking
Summary: Provide more info when using automatic authorities linking
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Adolfo Rodríguez Taboada
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-30 12:34 UTC by Adolfo Rodríguez Taboada
Modified: 2024-05-23 08:22 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds more useful information to the automatic authority link results when editing a record and using "Link authorities automatically". It now includes the value you used for each authority entry (such as 650$a and $700$a), so you know which ones to look at. Previously, it only included the field number, such as 650, and not the term. Example of new automatic authority link results: - 650 - Biologie. - More than one local match found. Possibly a duplicate authority! - 650 - Biology. - More than one local match found. Possibly a duplicate authority! - 700 - Aristophanes. - More than one local match found. Possibly a duplicate authority! - 700 - Beckett, Samuel, 1906-1989. - More than one local match found. Possibly a duplicate authority!
Version(s) released in:


Attachments
Fix - Bug 35452 - Provide more info when using Link authorities automatically (7.77 KB, patch)
2023-11-30 14:12 UTC, Adolfo Rodríguez Taboada
Details | Diff | Splinter Review
Fix - Bug 35452 - Provide more info when using Link authorities automatically (7.82 KB, patch)
2023-11-30 18:08 UTC, David Nind
Details | Diff | Splinter Review
Bug 35452: Provide more info when using Link authorities automatically (7.87 KB, patch)
2024-01-05 19:50 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adolfo Rodríguez Taboada 2023-11-30 12:34:29 UTC
There are records with many entries that can be linked to authorities, be it secondary authors (7xx) or subjects (6xx)

As it is, when you use "Automatic authority link" the results list only indicate the field number, so you see something like this.

 * 650 - More than one local match found. Possibly a duplicate authority!
 * 650 - More than one local match found. Possibly a duplicate authority!
 * 650 - More than one local match found. Possibly a duplicate authority!
 * 700 - No matching authority found.
 * 700 - No matching authority found.
 * 700 - No matching authority found.

To figure out which are the entries the results refer to you have to manually check the fields in the record. I think this could improved by adding info about the entries.

Something like this.

 * 650 - Rock music. - More than one local match found. Possibly a duplicate authority!
 * 650 - Alternative rock music. - More than one local match found. Possibly a duplicate authority!
 * 650 - Country music. - More than one local match found. Possibly a duplicate authority!
 * 700 - Ikeda, Elaiza - No matching authority found.
 * 700 - Okada, Nana - No matching authority found.
 * 700 - Tsuchiya, Anna - No matching authority found.
Comment 1 Adolfo Rodríguez Taboada 2023-11-30 14:12:43 UTC
Created attachment 159408 [details] [review]
Fix - Bug 35452 - Provide more info when using Link authorities automatically

Test plan
1 Edit a record and add several 7xx and 6xx
2 Click on Link authorities automatically and check that the result only shows the field numbers
3 Apply patch, restart services
4 Click on Link authorities automatically and check that the result shows the field numbers and the info of the entry
Comment 2 David Nind 2023-11-30 18:08:26 UTC
Created attachment 159416 [details] [review]
Fix - Bug 35452 - Provide more info when using Link authorities automatically

Test plan
1 Edit a record and add several 7xx and 6xx
2 Click on Link authorities automatically and check that the result only shows the field numbers
3 Apply patch, restart services
4 Click on Link authorities automatically and check that the result shows the field numbers and the info of the entry

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2023-11-30 18:21:36 UTC
This is a nice enhancement!

I've added an assignee and some release notes.

Testing notes (using koha-testing-docker (KTD)):

1. Paste these terms in new 650$a or 700$a fields for a record, instead of using the tag editor:
   - 650$a: Biologie.
   - 650$a: Biology.
   - 700$a: Aristophanes.
   - 700$a: Beckett, Samuel, 1906-1989.

2. After the patch is applied, you get a more useful message of where to look to fix things up:

   Automatic authority link results:
   - 650 - Biologie. - More than one local match found. Possibly a duplicate authority!
   - 650 - Biology. - More than one local match found. Possibly a duplicate authority!
   - 700 - Aristophanes. - More than one local match found. Possibly a duplicate authority!
   - 700 - Beckett, Samuel, 1906-1989. - More than one local match found. Possibly a duplicate authority!
Comment 4 Nick Clemens (kidclamp) 2024-01-05 19:50:15 UTC
Created attachment 160590 [details] [review]
Bug 35452: Provide more info when using Link authorities automatically

Test plan
1 Edit a record and add several 7xx and 6xx
2 Click on Link authorities automatically and check that the result only shows the field numbers
3 Apply patch, restart services
4 Click on Link authorities automatically and check that the result shows the field numbers and the info of the entry

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Katrin Fischer 2024-03-19 16:53:37 UTC
I am sorry, but this change breaks the unit tests, please provide a follow-up:

prove t/Biblio.t t/db_dependent/Biblio.t
t/Biblio.t ............... ok     
t/db_dependent/Biblio.t .. 11/20 
    #   Failed test 'The heading was not linked'
    #   at t/db_dependent/Biblio.t line 812.
    #     Structures begin differing at:
    #          $got->{data} = 'Duplicated'
    #     $expected->{data} = Does not exist

    #   Failed test 'When AutoCreateAuthorities is enabled, multiple results are reported'
    #   at t/db_dependent/Biblio.t line 826.
    #     Structures begin differing at:
    #          $got->{data} = 'Duplicated'
    #     $expected->{data} = Does not exist
    # Looks like you failed 2 tests of 5.
Comment 6 Adolfo Rodríguez Taboada 2024-04-24 08:55:23 UTC
I don't think this change is the one breaking that test as it only adds info in the result. It doesn't affect in the search of the authority.

It should be the change made in the bug 31185. Before that change, link authorities automatically didn't detect duplicate authorities and the result you got in those case was that the authority wasn't found. I think it's exactly the discrepancy you are seeing in the test, as it expects "Does not exist" and gets "Duplicated"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31185
Comment 7 Adolfo Rodríguez Taboada 2024-05-23 08:22:09 UTC
I think the bug 36938 covers the errors detected in the unit tests
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36938