Bugzilla – Attachment 138078 Details for
Bug 29697
Replace GetMarcBiblio occurrences with $biblio->metadata->record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29697: Fix t/db_dependent/Exporter/Record.t
Bug-29697-Fix-tdbdependentExporterRecordt.patch (text/plain), 2.56 KB, created by
Jonathan Druart
on 2022-07-25 12:27:25 UTC
(
hide
)
Description:
Bug 29697: Fix t/db_dependent/Exporter/Record.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-25 12:27:25 UTC
Size:
2.56 KB
patch
obsolete
>From 309305d1c47358063acf6e3110dc8f8b588fa54c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 25 Jul 2022 14:26:27 +0200 >Subject: [PATCH] Bug 29697: Fix t/db_dependent/Exporter/Record.t > >Not sure about the warn, we shouldn't need it as we are raising an >exception. But better (for now) than introducing regressions. >--- > C4/Record.pm | 5 ++++- > Koha/Biblio/Metadata.pm | 1 + > Koha/Exporter/Record.pm | 12 ++++++++---- > 3 files changed, 13 insertions(+), 5 deletions(-) > >diff --git a/C4/Record.pm b/C4/Record.pm >index 3de35a27fca..69a60f3520f 100644 >--- a/C4/Record.pm >+++ b/C4/Record.pm >@@ -460,7 +460,10 @@ sub marcrecord2csv { > # Getting the record > my $biblio = Koha::Biblios->find($biblionumber); > return unless $biblio; >- my $record = $biblio->metadata->record({ embed_items => 1, itemnumbers => $itemnumbers }); >+ my $record = eval { >+ $biblio->metadata->record( >+ { embed_items => 1, itemnumbers => $itemnumbers } ); >+ }; > return unless $record; > # Getting the framework > my $frameworkcode = $biblio->frameworkcode; >diff --git a/Koha/Biblio/Metadata.pm b/Koha/Biblio/Metadata.pm >index ad451797e51..78361ab261d 100644 >--- a/Koha/Biblio/Metadata.pm >+++ b/Koha/Biblio/Metadata.pm >@@ -111,6 +111,7 @@ sub record { > my $marcxml_error = $@; > chomp $marcxml_error; > unless ($record) { >+ warn $marcxml_error; > Koha::Exceptions::Metadata::Invalid->throw( > id => $self->id, > biblionumber => $self->biblionumber, >diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm >index 1716e9c9a13..e678c36ee1b 100644 >--- a/Koha/Exporter/Record.pm >+++ b/Koha/Exporter/Record.pm >@@ -127,10 +127,14 @@ sub _get_biblio_for_export { > return if $@ or not defined $record; > > if ($export_items) { >- C4::Biblio::EmbedItemsInMarcBiblio({ >- marc_record => $record, >- biblionumber => $biblionumber, >- item_numbers => $itemnumbers }); >+ Koha::Biblio::Metadata->record( >+ { >+ record => $record, >+ embed_items => 1, >+ biblionumber => $biblionumber, >+ item_numbers => $itemnumbers, >+ } >+ ); > if ($only_export_items_for_branches && @$only_export_items_for_branches) { > my %export_items_for_branches = map { $_ => 1 } @$only_export_items_for_branches; > my ( $homebranchfield, $homebranchsubfield ) = GetMarcFromKohaField( 'items.homebranch' ); >-- >2.25.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 29697
:
129757
|
129758
|
129759
|
129760
|
129761
|
131868
|
131869
|
131870
|
131871
|
131872
|
131873
|
134066
|
134067
|
134068
|
134069
|
134070
|
134071
|
135574
|
135575
|
135576
|
135577
|
135578
|
135579
|
135580
|
135662
|
135663
|
135664
|
135665
|
135666
|
135667
|
135668
|
135669
|
135670
|
135671
|
135672
|
135673
|
135797
|
135798
|
135799
|
135800
|
135801
|
135802
|
135978
|
135979
|
135980
|
135981
|
135982
|
137835
|
137836
|
137837
|
137838
|
137839
|
137840
|
137894
|
137918
|
137919
|
137920
|
137921
|
137922
|
137923
|
137924
|
137948
|
138057
|
138076
|
138077
| 138078 |
138079
|
138080
|
138081
|
138089
|
138090
|
138804
|
139127
|
140007
|
140008