Bugzilla – Attachment 104698 Details for
Bug 22437
Subsequent authority merges in cron may cause biblios to lose authority information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22437: Add test case to Merge.t
Bug-22437-Add-test-case-to-Merget.patch (text/plain), 2.26 KB, created by
Jonathan Druart
on 2020-05-11 13:29:27 UTC
(
hide
)
Description:
Bug 22437: Add test case to Merge.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-11 13:29:27 UTC
Size:
2.26 KB
patch
obsolete
>From bac9734c6377f9207be065666f6b44de1a4c91e5 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 6 Apr 2020 13:44:46 +0000 >Subject: [PATCH] Bug 22437: Add test case to Merge.t > >Test proves now that a 'destructive merge' is removed by >DelAuthority. > >Test plan: >Run t/db_dependent/Authority/Merge.t. Should fail when you >do not apply the other two patches and pass with them. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Amended-patch: Fix spelling dont ==> don't >--- > t/db_dependent/Authority/Merge.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Authority/Merge.t b/t/db_dependent/Authority/Merge.t >index 3634250cb4..bf25a913fc 100755 >--- a/t/db_dependent/Authority/Merge.t >+++ b/t/db_dependent/Authority/Merge.t >@@ -288,7 +288,7 @@ subtest 'Merging authorities should handle deletes (BZ 18070)' => sub { > }; > > subtest "Test some specific postponed merge issues" => sub { >- plan tests => 4; >+ plan tests => 6; > > my $authmarc = MARC::Record->new; > $authmarc->append_fields( MARC::Field->new( '109', '', '', 'a' => 'aa', b => 'bb' )); >@@ -328,6 +328,19 @@ subtest "Test some specific postponed merge issues" => sub { > $restored_mocks->{auth_mod}->unmock_all; > $biblio = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); > is( $biblio->subfield('109', '9'), $id, 'If the 109 is no longer present, another modify merge would not bring it back' ); >+ >+ # Bug 22437 now removes older postponed A->A merges in DelAuthority >+ $id = AddAuthority( $authmarc, undef, $authtype1 ); >+ my $merge = Koha::Authority::MergeRequest->new({ authid => $id })->store; >+ DelAuthority({ authid => $id, skip_merge => 1 }); >+ $merge->discard_changes; >+ is( $merge->in_storage, 0, 'Older merge should be removed' ); >+ # And even if we don't pass skip_merge >+ $id = AddAuthority( $authmarc, undef, $authtype1 ); >+ $merge = Koha::Authority::MergeRequest->new({ authid => $id })->store; >+ DelAuthority({ authid => $id }); >+ $merge->discard_changes; >+ is( $merge->in_storage, 0, 'Older merge should be removed again' ); > }; > > subtest "Graceful resolution of missing reporting tag" => sub { >-- >2.20.1
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 22437
:
95836
|
95848
|
102338
|
102444
|
102445
|
103298
|
103299
|
104557
|
104558
|
104559
| 104698 |
104699
|
104700