Bug 11652 - merging authority records does not correct biblios
Summary: merging authority records does not correct biblios
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Janusz Kaczmarek
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 12579
  Show dependency treegraph
 
Reported: 2014-01-31 15:27 UTC by Janusz Kaczmarek
Modified: 2015-06-04 23:30 UTC (History)
4 users (show)

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


Attachments
proposed patch (1.46 KB, patch)
2014-01-31 15:29 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 11652: merging authority records does not correct biblios (1.49 KB, patch)
2014-02-01 20:38 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 11652: merging authority records does not correct biblios (1.67 KB, patch)
2014-02-02 12:41 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2014-01-31 15:27:22 UTC
When merging authority records in librarian interface biblio records
linked to deleted authority are not being corrected (i.e. have still
old heading and orpaned link in $9).

Test scenario:
1. Have two authorities in the catalogue, linked to biblio records.
2. Merge them with the new merge facility (cf. Bug 5202).
3. Have a look a the biblio record(s) previously linked to the removed
   authority. It should still have the old heading AND orpaned authority
   link in $9.
Comment 1 Janusz Kaczmarek 2014-01-31 15:29:59 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-02-01 20:38:18 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-02-02 11:49:05 UTC
Janusz, I am working on this - could you check if merging 2 records from different frameworks works ok for you? I tried merging one "default" and "personal name" but the merge screen comes up empty?
Comment 4 Katrin Fischer 2014-02-02 12:39:24 UTC
I am sorry, but this doesn't seem to work for me. I merged to person authority records, each linked to 2 records. After the merge, it only shows 2 linked records, while I think it should be 4. Adding Jared here cc as he is module maintainer for autorities.
Comment 5 Katrin Fischer 2014-02-02 12:40:28 UTC
Aha - wrote the last comment too soon - reindexing fixed it.
Comment 6 Katrin Fischer 2014-02-02 12:41:46 UTC
Created attachment 24983 [details] [review]
[PASSED QA] Bug 11652: merging authority records does not correct biblios

When merging authority records in librarian interface biblio records
linked to deleted authority are not being corrected (i.e. have still
old heading and orpaned link in $9).

Test plan:
1. Have two authorities in the catalogue, linked to biblio records.
2. Merge them with the new merge facility (cf. Bug 5202).
3. Have a look a the biblio record(s) previously linked to the removed
   authority. It should still have the old heading AND orpaned authority
   link in $9.

4. Apply the patch.
5. Refresh the test records (or use another set).
6. Repeat 1-3. Headings should be refreshed and the correct authid link
   should be in $9 now.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Note: new record count on the authority record will show
      after reindexing.
Comment 7 Katrin Fischer 2014-02-02 12:44:50 UTC
Another note about comment 3: I think this might have been a data problem, retested with other records and it worked ok.
Comment 8 Galen Charlton 2014-02-04 18:32:00 UTC
This is pending review by Jared.
Comment 9 Jared Camins-Esakov 2014-02-12 16:53:36 UTC
Regardless of my setting for dontmerge, this patch does not seem to do anything. Are there other system preferences I should be looking at?
Comment 10 Janusz Kaczmarek 2014-02-12 17:27:54 UTC
Jared, this patch does not depend on dontmerge, nor, most probably, on any other pref.

I will try to be as straightforward as I can -- sorry if this will be too straightforward.

First of all, the play is around biblio records. Authorities are OK. 

Now, how does you standard master Koha behave when you merge *two*different*authority* records *from*librarian*interface* (just in case: not from merge_authority.pl script) -- what do you see as $9 in the heading field in *biblio* rec. that was previously linked to the authority which has just been merged (i.e. deleted)? 

In my case it is the "old" $9 (of the merged = deleted authority) which is now "orphaned", i.e. there is no authority record with this authid. Which is wrong.

This patch should correct this -- after applying it you should see "new" authid in $9 (and the heading field itself should be accordingly changed).
Comment 11 Jared Camins-Esakov 2014-02-12 17:36:21 UTC
(In reply to Janusz Kaczmarek from comment #10)
> In my case it is the "old" $9 (of the merged = deleted authority) which is
> now "orphaned", i.e. there is no authority record with this authid. Which is
> wrong.
> 
> This patch should correct this -- after applying it you should see "new"
> authid in $9 (and the heading field itself should be accordingly changed).

I was seeing the old authid both before and after applying this patch, but I just realized that my git repo did not have a hook to restart Plack. This works fine now that I've restarted Plack.
Comment 12 Jared Camins-Esakov 2014-02-12 17:46:20 UTC
Pushed to the bug_11652 branch mm/jcamins for merging into master.
Comment 13 Janusz Kaczmarek 2014-02-12 18:07:50 UTC
Awesome! :)
Comment 14 Galen Charlton 2014-02-13 03:04:05 UTC
Pushed to master.  Thanks, Janusz!
Comment 15 Fridolin Somers 2014-05-19 13:56:07 UTC
Pushed to 3.14.x, will be in 3.14.07.