Bugzilla – Attachment 59972 Details for
Bug 18070
Support clean removal of authority records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18070: Deleting an authority should update the linked biblio records
Bug-18070-Deleting-an-authority-should-update-the-.patch (text/plain), 2.31 KB, created by
Marcel de Rooy
on 2017-02-07 09:18:18 UTC
(
hide
)
Description:
Bug 18070: Deleting an authority should update the linked biblio records
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-02-07 09:18:18 UTC
Size:
2.31 KB
patch
obsolete
>From 26b7a3b6dd78c7afc8dd278788c3f6a94c077552 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 31 Jan 2017 11:46:21 +0100 >Subject: [PATCH] Bug 18070: Deleting an authority should update the linked > biblio records >Content-Type: text/plain; charset=utf-8 > >Adding a test where we delete an authority and prove that the linked >biblio still contains a reference to it. > >Note: Currently, the interface does not allow you to delete an authority >that still has linked biblio records. Especially, if security bug 18019 >has been pushed. This report will add a maintenance script that allows >you to delete such records and cleanup the biblios. This is a first >step. > >Test plan: >[1] Run t/db_dependent/Authorities/Merge.t > Last test should fail: not ok 1 - Field 609 should be gone too > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Authorities/Merge.t | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Authorities/Merge.t b/t/db_dependent/Authorities/Merge.t >index 3102695..2725b19 100755 >--- a/t/db_dependent/Authorities/Merge.t >+++ b/t/db_dependent/Authorities/Merge.t >@@ -4,7 +4,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > > use MARC::Record; > use Test::MockModule; >@@ -224,6 +224,26 @@ subtest 'Test merge A1 to B1 (changing authtype)' => sub { > 'Check 612x' ); > }; > >+subtest 'Merging authorities should handle deletes (BZ 18070)' => sub { >+ plan tests => 1; >+ >+ # Add authority and linked biblio, delete authority >+ my $auth1 = MARC::Record->new; >+ $auth1->append_fields( MARC::Field->new( '109', '', '', 'a' => 'DEL')); >+ my $authid1 = AddAuthority( $auth1, undef, $authtype1 ); >+ my $bib1 = MARC::Record->new; >+ $bib1->append_fields( >+ MARC::Field->new( '245', '', '', a => 'test DEL' ), >+ MARC::Field->new( '609', '', '', a => 'DEL', 9 => "$authid1" ), >+ ); >+ my ( $biblionumber ) = C4::Biblio::AddBiblio( $bib1, '' ); >+ DelAuthority( $authid1 ); >+ >+ # See what happened >+ my $marc1 = C4::Biblio::GetMarcBiblio( $biblionumber ); >+ is( $marc1->field('609'), undef, 'Field 609 should be gone too' ); >+}; >+ > sub set_mocks { > # Mock ZOOM objects: They do nothing actually > # Get new_record_from_zebra to return the records >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18070
:
59972
|
59973
|
59977
|
59978
|
60251
|
60252
|
60253
|
60254
|
60392
|
60393
|
60394
|
60395
|
60557
|
60558
|
60559
|
60560