Bug 28573 - Replace authority record with Z39.50/SRU creates new authority record
Summary: Replace authority record with Z39.50/SRU creates new authority record
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All Linux
: P3 major (vote)
Assignee: George Veranis
QA Contact: Testopia
URL:
Keywords: Academy
: 26776 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-06-16 14:11 UTC by Sebastian Krieg
Modified: 2021-10-20 17:51 UTC (History)
7 users (show)

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


Attachments
Bug28573: Replace authority record with Z39.50/SRU creates new authority record (2.49 KB, patch)
2021-10-12 21:13 UTC, George Veranis
Details | Diff | Splinter Review
Bug28573: Replace authority record with Z39.50/SRU creates new authority record (2.56 KB, patch)
2021-10-13 11:48 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug28573: Replace authority record with Z39.50/SRU creates new authority record (2.61 KB, patch)
2021-10-20 17:51 UTC, Eric Phetteplace
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Krieg 2021-06-16 14:11:53 UTC
When replacing an authority record with Z39.50/SRU you get a new record and no update of the upgrading record.

Test instance: Catalyst IT Ltd. (New Zealand)
(https://koha-community.org/demo/)

example record: #13 (name: Plato)

Steps to reproduce:
1. Menu "Home > Authorities > Details for authority #13 (Personal Name)"
2. Form: https://demo-intra.mykoha.co.nz/cgi-bin/koha/authorities/detail.pl?authid=13
3. Menu "Edit > Replace record via Z39.50/SRU"
4. Field "Name(any)": Homer >> Click "search"
5. choose the second entry "Aschmann, Homer, 1920-" >> click "import"

Expected solution:
- replace the record #13 with the search data "Aschmann, Homer, 1920-"
- Form: https://demo-intra.mykoha.co.nz/cgi-bin/koha/authorities/detail.pl?authid=13

Error:
- Menu "Home > Authorities > Adding authority Personal Name"
- form: https://demo-intra.mykoha.co.nz/cgi-bin/koha/authorities/authorities.pl?breedingid=58824&authtypecode=PERSO_NAME&index=
- Save the record as Record #14
- Menu "Home > Authorities > Details for authority #14 (Personal Name)"

Note: I found this error in release 21.05., I use a instance 20.11. to reproduce the error.
Comment 1 Sebastian Krieg 2021-06-18 07:27:53 UTC
Specify the fields "Hardware" and "Importance".
Comment 2 Volkan Sonmez 2021-07-02 12:16:35 UTC
That is because authid parameter is missing in z3950_auth_search.tt. So authorities.pl think that this is new authority file but not modification. if you change

<li><a href="/cgi-bin/koha/authorities/authorities.pl?breedingid=[% breeding_loo.breedingid | uri %]&authtypecode=[% breeding_loo.heading_code | uri %]&index=[% index | uri %]" class="chosen" title="Import"><i class="fa fa-download"></i> Import</a></li>

line with

<li><a href="/cgi-bin/koha/authorities/authorities.pl?breedingid=[% breeding_loo.breedingid | uri %]&authtypecode=[% breeding_loo.heading_code | uri %]&authid=[% breeding_loo.authid | uri %]&index=[% index | uri %]" class="chosen" title="Import"><i class="fa fa-download"></i> Import</a></li>

in 

cataloguing/z3950_auth_search.tt

file it will work.
Comment 3 Sebastian Krieg 2021-07-05 06:24:46 UTC
Thank you for this workaround, it work's. Will this workaround include in the a next release?
Comment 4 Katrin Fischer 2021-07-05 06:30:01 UTC
Hi, if you change NEW to ASSIGNED this indicates that you plan on providing a patch for this issue. Better to leave it as new to alert devs there is still someone needed to fix this here.

If you intend to provide a patch, please change back and also fill in the "Assignee" field.

Right now this needs a developer to take it up in order to make it into a release. As the solution is already provided and tested, I am marking it Academy (easy ones for grab) and upping severity a bit as this would be likely to create unwanted duplicates.
Comment 5 Sebastian Krieg 2021-07-05 08:02:41 UTC
Hello, thanks for this information. It's OK. Thank you.
Comment 6 George Veranis 2021-10-12 20:57:08 UTC
*** Bug 26776 has been marked as a duplicate of this bug. ***
Comment 7 George Veranis 2021-10-12 21:13:16 UTC
Created attachment 126130 [details] [review]
Bug28573: Replace authority record with Z39.50/SRU creates new authority record

When trying to replace an authority record with Z39.50/SRU then a new authority
record is created without deleting the old one and not link the new one with
any record.

This patch fixes that.

Test plan:

1) Try to catalogue a new authority record from cataloguing form.
2) Try to replace that authority record with Z39.50/SRU, then a new authority
record is created and also you have that one that you tried to replace.
3) Apply the patch.
4) Try to replace the authority from step1 with Z39.50/SRU, then is working as
expected.
Comment 8 Florian 2021-10-13 10:27:39 UTC Comment hidden (obsolete)
Comment 9 Andrew Fuerste-Henry 2021-10-13 11:48:01 UTC
Created attachment 126178 [details] [review]
Bug28573: Replace authority record with Z39.50/SRU creates new authority record

When trying to replace an authority record with Z39.50/SRU then a new authority
record is created without deleting the old one and not link the new one with
any record.

This patch fixes that.

Test plan:

1) Try to catalogue a new authority record from cataloguing form.
2) Try to replace that authority record with Z39.50/SRU, then a new authority
record is created and also you have that one that you tried to replace.
3) Apply the patch.
4) Try to replace the authority from step1 with Z39.50/SRU, then is working as
expected.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 10 Andrew Fuerste-Henry 2021-10-13 11:51:26 UTC
(In reply to Florian from comment #8)
> Does not seem to work. When replacing created authority with Z39.50/SRU
> after patch, it does replace the details of the authority but it does not
> change its title.

I'm not sure I understand the issue you ran into. I tested this with a topical term subject authority. When my replace-via-z39.50 changed the 150$a in my authority, its title changed as expected. Or did you mean something other than the title of the authority itself?
Comment 11 Florian 2021-10-13 12:43:20 UTC
My apologies, it seems part of the testing plan got lost in translation on my side! Disregard my previous comment.

(In reply to Andrew Fuerste-Henry from comment #10)
> (In reply to Florian from comment #8)
> > Does not seem to work. When replacing created authority with Z39.50/SRU
> > after patch, it does replace the details of the authority but it does not
> > change its title.
> 
> I'm not sure I understand the issue you ran into. I tested this with a
> topical term subject authority. When my replace-via-z39.50 changed the 150$a
> in my authority, its title changed as expected. Or did you mean something
> other than the title of the authority itself?
Comment 12 Eric Phetteplace 2021-10-20 17:51:57 UTC
Created attachment 126594 [details] [review]
Bug28573: Replace authority record with Z39.50/SRU creates new authority record

When trying to replace an authority record with Z39.50/SRU then a new authority
record is created without deleting the old one and not link the new one with
any record.

This patch fixes that.

Test plan:

1) Try to catalogue a new authority record from cataloguing form.
2) Try to replace that authority record with Z39.50/SRU, then a new authority
record is created and also you have that one that you tried to replace.
3) Apply the patch.
4) Try to replace the authority from step1 with Z39.50/SRU, then is working as
expected.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>