Bugzilla – Attachment 140502 Details for
Bug 27981
Add option to automatically set the 001 control number to the biblionumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27981: (QA follow-up) GetMarcBiblio was removed from codebase
Bug-27981-QA-follow-up-GetMarcBiblio-was-removed-f.patch (text/plain), 2.34 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-09-12 18:29:42 UTC
(
hide
)
Description:
Bug 27981: (QA follow-up) GetMarcBiblio was removed from codebase
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-09-12 18:29:42 UTC
Size:
2.34 KB
patch
obsolete
>From f60a9c50dca74bf68510f53e144b62f12175b3c4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 12 Sep 2022 15:28:08 -0300 >Subject: [PATCH] Bug 27981: (QA follow-up) GetMarcBiblio was removed from > codebase > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Biblio.t | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 5f1313a2ae..3973aa541b 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -826,23 +826,28 @@ subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { > }; > > subtest 'autoControlNumber tests' => sub { >+ > plan tests => 3; > > t::lib::Mocks::mock_preference('autoControlNumber', 'OFF'); > > my $record = MARC::Record->new(); >- my ($biblionumber) = C4::Biblio::AddBiblio($record, ''); >- $record = GetMarcBiblio({biblionumber => $biblionumber}); >+ my ($biblio_id) = C4::Biblio::AddBiblio($record, ''); >+ my $biblio = Koha::Biblios->find($biblio_id); >+ >+ $record = $biblio->metadata->record; > is($record->field('001'), undef, '001 not set when pref is off'); > > t::lib::Mocks::mock_preference('autoControlNumber', 'biblionumber'); >- C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); >- $record = GetMarcBiblio({biblionumber => $biblionumber}); >- is($record->field('001')->as_string(), $biblionumber, '001 set to biblionumber when pref set and field is blank'); >+ C4::Biblio::ModBiblio($record, $biblio_id, "", { skip_record_index => 1, disable_autolink => 1 }); >+ $biblio->discard_changes; >+ $record = $biblio->metadata->record; >+ is($record->field('001')->as_string(), $biblio_id, '001 set to biblionumber when pref set and field is blank'); > > $record->field('001')->update('Not biblionumber'); >- C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); >- $record = GetMarcBiblio({biblionumber => $biblionumber}); >+ C4::Biblio::ModBiblio($record, $biblio_id, "", { skip_record_index => 1, disable_autolink => 1 }); >+ $biblio->discard_changes; >+ $record = $biblio->metadata->record; > is($record->field('001')->as_string(), 'Not biblionumber', '001 not set to biblionumber when pref set and field exists'); > > }; >-- >2.34.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 27981
:
118461
|
118513
|
119704
|
119705
|
119717
|
121805
|
122280
|
122301
|
122344
|
122356
|
122672
|
122674
|
122675
|
124279
|
124280
|
124281
|
128223
|
128224
|
128225
|
132034
|
132035
|
132036
|
134536
|
134537
|
134538
|
134539
|
136022
|
140092
|
140093
|
140094
|
140095
|
140096
|
140097
| 140502