Bugzilla – Attachment 165272 Details for
Bug 35993
AddBiblio should add 005 just like ModBiblio updates it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35993: Apply new routine to ModBiblioMarc
Bug-35993-Apply-new-routine-to-ModBiblioMarc.patch (text/plain), 2.83 KB, created by
Marcel de Rooy
on 2024-04-22 11:43:59 UTC
(
hide
)
Description:
Bug 35993: Apply new routine to ModBiblioMarc
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-04-22 11:43:59 UTC
Size:
2.83 KB
patch
obsolete
>From 0a310f3a6344ce78d145169e608ede2971fb463b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 5 Feb 2024 13:36:21 +0000 >Subject: [PATCH] Bug 35993: Apply new routine to ModBiblioMarc >Content-Type: text/plain; charset=utf-8 > >Now both AddBiblio and ModBiblio will insert 005 if not present. > >Test plan: >Run t/db_dependent/Biblio.t >Add biblio record via acquistion order. Check 005 in the table >biblio_metadata. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > C4/Biblio.pm | 8 +++----- > t/db_dependent/Biblio.t | 17 ++++++++++++++++- > 2 files changed, 19 insertions(+), 6 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index d9e43b7dba..f0a133fda2 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -113,6 +113,7 @@ use Koha::Plugins; > use Koha::RecordProcessor; > use Koha::SearchEngine; > use Koha::SearchEngine::Indexer; >+use Koha::SimpleMARC; > use Koha::Libraries; > use Koha::Util::MARC; > >@@ -2850,12 +2851,9 @@ sub ModBiblioMarc { > } > } > >- #enhancement 5374: update transaction date (005) for marc21/unimarc >+ # Insert/update transaction time (005) for marc21/unimarc > if($encoding =~ /MARC21|UNIMARC/) { >- my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++; >- # YY MM DD HH MM SS (update year and month) >- my $f005= $record->field('005'); >- $f005->update(sprintf("%4d%02d%02d%02d%02d%04.1f",@a)) if $f005; >+ Koha::SimpleMARC::update_last_transaction_time( { record => $record } ); > } > > if ( C4::Context->preference('StripWhitespaceChars') ) { >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index e8813b78cd..395d726311 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 21; >+use Test::More tests => 22; > use Test::MockModule; > use Test::Warn; > use List::MoreUtils qw( uniq ); >@@ -1058,6 +1058,21 @@ subtest 'UpdateTotalIssues on Invalid record' => sub { > }; > > >+subtest 'AddBiblio/ModBiblio calling ModBiblioMarc for field 005' => sub { >+ plan tests => 2; >+ >+ my $marc_record = MARC::Record->new; >+ my ($biblionumber) = C4::Biblio::AddBiblio( $marc_record, '' ); >+ my $biblio = Koha::Biblios->find($biblionumber); >+ >+ my $field = $biblio->metadata->record->field('005'); >+ ok( $field && $field->data, 'Record contains field 005 after AddBiblio' ); >+ $marc_record = MARC::Record->new; >+ C4::Biblio::ModBiblio( $marc_record, $biblionumber, '' ); >+ $field = $biblio->metadata->record->field('005'); >+ ok( $field && $field->data, 'Record contains field 005 after ModBiblio' ); >+}; >+ > # Cleanup > Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); > $schema->storage->txn_rollback; >-- >2.30.2
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 35993
:
161761
|
161762
|
161776
|
161777
|
161778
|
161805
|
161992
|
161993
|
161994
|
161995
|
165271
|
165272
|
165370
|
165371
|
165746
|
165748
|
166063