Bugzilla – Attachment 58029 Details for
Bug 17196
Move marcxml out of the biblioitems table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 17196: Fix - Update metadata on update
SIGNED-OFF-Bug-17196-Fix---Update-metadata-on-upda.patch (text/plain), 2.87 KB, created by
Josef Moravec
on 2016-12-07 21:25:33 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17196: Fix - Update metadata on update
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-12-07 21:25:33 UTC
Size:
2.87 KB
patch
obsolete
>From 0683ba016447f5e3ef082941ef02e3457d389347 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Sep 2016 13:35:57 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 17196: Fix - Update metadata on update > >Signed-off-by: Mason James <mtj@kohaaloha.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Biblio.pm | 1 + > t/db_dependent/Biblio.t | 16 +++++++++++----- > 2 files changed, 12 insertions(+), 5 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 68d9482..6d1eb0f 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -3524,6 +3524,7 @@ sub ModBiblioMarc { > # FIXME To replace with ->find_or_create? > if ( my $m_rs = Koha::Biblio::Metadatas->find($metadata) ) { > $m_rs->metadata( $record->as_xml_record($encoding) ); >+ $m_rs->store; > } else { > my $m_rs = Koha::Biblio::Metadata->new($metadata); > $m_rs->metadata( $record->as_xml_record($encoding) ); >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index e6427f4..48ed72f 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -108,8 +108,7 @@ sub run_tests { > > # Generate a record with just the ISBN > my $marc_record = MARC::Record->new; >- my $isbn_field = create_isbn_field( $isbn, $marcflavour ); >- $marc_record->append_fields( $isbn_field ); >+ $marc_record->append_fields( create_isbn_field( $isbn, $marcflavour ) ); > > # Add the record to the DB > my( $biblionumber, $biblioitemnumber ) = AddBiblio( $marc_record, '' ); >@@ -119,6 +118,10 @@ sub run_tests { > is( $data->{ title }, undef, > '(GetBiblioData) Title field is empty in fresh biblio.'); > >+ my ( $isbn_field, $isbn_subfield ) = get_isbn_field(); >+ my $marc = GetMarcBiblio( $biblionumber ); >+ is( $marc->subfield( $isbn_field, $isbn_subfield ), $isbn, ); >+ > # Add title > my $field = create_title_field( $title, $marcflavour ); > $marc_record->append_fields( $field ); >@@ -127,6 +130,9 @@ sub run_tests { > is( $data->{ title }, $title, > 'ModBiblio correctly added the title field, and GetBiblioData.'); > is( $data->{ isbn }, $isbn, '(ModBiblio) ISBN is still there after ModBiblio.'); >+ $marc = GetMarcBiblio( $biblionumber ); >+ my ( $title_field, $title_subfield ) = get_title_field(); >+ is( $marc->subfield( $title_field, $title_subfield ), $title, ); > > my $itemdata = GetBiblioItemData( $biblioitemnumber ); > is( $itemdata->{ title }, $title, >@@ -320,19 +326,19 @@ sub create_issn_field { > } > > subtest 'MARC21' => sub { >- plan tests => 29; >+ plan tests => 31; > run_tests('MARC21'); > $dbh->rollback; > }; > > subtest 'UNIMARC' => sub { >- plan tests => 29; >+ plan tests => 31; > run_tests('UNIMARC'); > $dbh->rollback; > }; > > subtest 'NORMARC' => sub { >- plan tests => 29; >+ plan tests => 31; > run_tests('NORMARC'); > $dbh->rollback; > }; >-- >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 17196
:
54910
|
54911
|
54912
|
54913
|
54914
|
54918
|
55856
|
55857
|
55858
|
55859
|
55860
|
55904
|
55905
|
55906
|
55907
|
55908
|
55921
|
55922
|
55950
|
55951
|
56038
|
57835
|
57836
|
57837
|
57838
|
57839
|
57840
|
57841
|
57842
|
58000
|
58007
|
58008
|
58023
|
58024
|
58025
|
58026
|
58027
|
58028
|
58029
|
58030
|
58031
|
58032
|
58037
|
58038
|
58039
|
58040
|
58041
|
58042
|
58043
|
58044
|
58045
|
58046
|
58047
|
58048
|
58504
|
58505
|
58506
|
58507
|
58508
|
58509
|
58510
|
58511
|
58512
|
58513
|
58514
|
58516
|
58517
|
58923
|
58924
|
58925
|
58926
|
58927
|
58928
|
58929
|
58930
|
58931
|
58932
|
58933
|
58934
|
58935
|
58936
|
58937
|
58938
|
58939
|
58943
|
58946
|
58947