Bug 14026

Summary: Deleting Authority record tag does not update bibliographic marc record
Product: Koha Reporter: Joy Nelson <1joynelson>
Component: MARC Authority data supportAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18019
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18070
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17950    
Bug Blocks: 17908    
Attachments: Bug 14026: First expose the problem in Merge.t
Bug 14026: Extend sub merge to remove fields for deleted authorities

Description Joy Nelson 2015-04-20 16:43:35 UTC
When an authority record that is linked to a bibliographic record has a subfield *deleted*, that deleted tag is *not* deleted from the linked bibliographic record(s).   note: edits and additions are reflected in the linked bibliographic records.  only deletions are not.


Steps to reproduce:
1. Create authority record with multiple subfields.  i.e. 110$a$v$x
2. Create new biblio record, 
   a. Select authority record created in step 1 to link the two together
3. Edit authority record by deleting a subfield  (i.e. 110$x)
4. View bibliographic record - the deleted authority subfield is still present in the bibliographic record

Note: wait for reindexing between steps
Comment 1 Owen Leonard 2016-06-21 16:07:34 UTC
Is this report specific to 3.18.x? If it is valid in master, please mark it as such.
Comment 2 Marcel de Rooy 2017-01-24 14:42:38 UTC
Pick this up in the course of omnibus bug 17908. Support appreciated.
Comment 3 Marcel de Rooy 2017-01-31 14:43:32 UTC
Created attachment 59684 [details] [review]
Bug 14026: First expose the problem in Merge.t

Adding a test where we delete an authority and prove that the linked
biblio still contains a reference to it.

Test plan:
[1] Run t/db_dependent/Authorities/Merge.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2017-01-31 14:43:36 UTC
Created attachment 59685 [details] [review]
Bug 14026: Extend sub merge to remove fields for deleted authorities

In order to accomplish this, we need to add some additional checks in
the merge routine. The actual change to remove the field, is quite
small.

Furthermore, we need to add a merge call in DelAuthority and adjust
the merge cron job accordingly.

The change is well supported by additional tests, including a simulation
of postponed removal via cron, if dontmerge is enabled.

Test plan:
[1] Run t/db_dependent/Authorities/Merge.t
[2] Look for an authority with a few linked biblios.
    Delete this authority: the quickest way currently is URL manipulation:
    /cgi-bin/koha/authorities/authorities-home.pl?op=delete&authid=[XXX]
    Now check the biblio records; the link should be removed.

Note: Since merge can handle deleting authorities now, we could consider
adding the option 'Delete' on the Actions menu for authorities having
linked biblios. The delete action also needs CSRF protection. Both should
be handled on new reports.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2017-01-31 14:56:06 UTC
(In reply to Joy Nelson from comment #0)
> When an authority record that is linked to a bibliographic record has a
> subfield *deleted*, that deleted tag is *not* deleted from the linked
> bibliographic record(s).   note: edits and additions are reflected in the
> linked bibliographic records.  only deletions are not.

Joy:
This subfield deletion problem is already fixed on bug 17913, patch Do not keep a cleared subfield in loose merge mode.
When I glanced through this report, I had a fix for deleting the complete authority record in mind. And so that should be fixed now too..
Comment 6 Marcel de Rooy 2017-02-07 08:53:07 UTC
For the abovementioned reason I close this report in favor of bug 17913 that solved the original issue.
Moving the functionality outside the original scope to a new report 18070.

*** This bug has been marked as a duplicate of bug 17913 ***