Bugzilla – Attachment 192091 Details for
Bug 24679
Allow to apply a MARC modification template in export tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24679: Tidy
c4c5179.patch (text/plain), 5.48 KB, created by
Julian Maurice
on 2026-01-27 09:53:40 UTC
(
hide
)
Description:
Bug 24679: Tidy
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2026-01-27 09:53:40 UTC
Size:
5.48 KB
patch
obsolete
>From c4c517976bf76b11d2a41ad874d1b5c8f316c43d Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 27 Jan 2026 09:42:10 +0000 >Subject: [PATCH] Bug 24679: Tidy > >--- > C4/MarcModificationTemplates.pm | 2 +- > C4/Record.pm | 12 +++++++++--- > Koha/Exporter/Record.pm | 20 ++++++++++---------- > tools/export.pl | 2 +- > 4 files changed, 21 insertions(+), 15 deletions(-) > >diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm >index e633cc10821..4dff449dbed 100644 >--- a/C4/MarcModificationTemplates.pm >+++ b/C4/MarcModificationTemplates.pm >@@ -112,7 +112,7 @@ sub AddModificationTemplate { > my $sth = $dbh->prepare("INSERT INTO marc_modification_templates ( name ) VALUES ( ? )"); > $sth->execute($template_name); > >- my $template_id = $dbh->last_insert_id(undef, undef, 'marc_modification_templates'); >+ my $template_id = $dbh->last_insert_id( undef, undef, 'marc_modification_templates' ); > > if ($template_id_copy) { > my @actions = GetModificationTemplateActions($template_id_copy); >diff --git a/C4/Record.pm b/C4/Record.pm >index be7023e9e35..2dce3b3b22a 100644 >--- a/C4/Record.pm >+++ b/C4/Record.pm >@@ -446,12 +446,18 @@ sub marc2csv { > for my $itemnumber (@$itemnumbers) { > my $item = Koha::Items->find($itemnumber); > my $biblionumber = $item->biblio->biblionumber; >- $output .= marcrecord2csv( $biblionumber, $id, $firstpass, $csv, $fieldprocessing, [$itemnumber], $marc_modification_template_id ) // ''; >+ $output .= marcrecord2csv( >+ $biblionumber, $id, $firstpass, $csv, $fieldprocessing, [$itemnumber], >+ $marc_modification_template_id >+ ) // ''; > $firstpass = 0; > } > } else { > foreach my $biblio (@$biblios) { >- $output .= marcrecord2csv( $biblio, $id, $firstpass, $csv, $fieldprocessing, undef, $marc_modification_template_id ) // ''; >+ $output .= marcrecord2csv( >+ $biblio, $id, $firstpass, $csv, $fieldprocessing, undef, >+ $marc_modification_template_id >+ ) // ''; > $firstpass = 0; > } > } >@@ -495,7 +501,7 @@ sub marcrecord2csv { > return unless $record; > > if ($marc_modification_template_id) { >- C4::MarcModificationTemplates::ModifyRecordWithTemplate($marc_modification_template_id, $record); >+ C4::MarcModificationTemplates::ModifyRecordWithTemplate( $marc_modification_template_id, $record ); > } > > # Getting the framework >diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm >index 6a9cb43696f..42a288ae34b 100644 >--- a/Koha/Exporter/Record.pm >+++ b/Koha/Exporter/Record.pm >@@ -159,14 +159,14 @@ sub _get_biblio_for_export { > sub export { > my ($params) = @_; > >- my $record_type = $params->{record_type}; >- my $record_ids = $params->{record_ids} || []; >- my $format = $params->{format}; >- my $itemnumbers = $params->{itemnumbers} || []; # Does not make sense with record_type eq auths >- my $export_items = $params->{export_items}; >- my $dont_export_fields = $params->{dont_export_fields}; >- my $csv_profile_id = $params->{csv_profile_id}; >- my $output_filepath = $params->{output_filepath}; >+ my $record_type = $params->{record_type}; >+ my $record_ids = $params->{record_ids} || []; >+ my $format = $params->{format}; >+ my $itemnumbers = $params->{itemnumbers} || []; # Does not make sense with record_type eq auths >+ my $export_items = $params->{export_items}; >+ my $dont_export_fields = $params->{dont_export_fields}; >+ my $csv_profile_id = $params->{csv_profile_id}; >+ my $output_filepath = $params->{output_filepath}; > my $marc_modification_template_id = $params->{marc_modification_template_id}; > > if ( !$record_type ) { >@@ -197,7 +197,7 @@ sub export { > } > > if ($marc_modification_template_id) { >- C4::MarcModificationTemplates::ModifyRecordWithTemplate($marc_modification_template_id, $record); >+ C4::MarcModificationTemplates::ModifyRecordWithTemplate( $marc_modification_template_id, $record ); > } > > print $record->as_usmarc(); >@@ -214,7 +214,7 @@ sub export { > next unless $record; > > if ($marc_modification_template_id) { >- C4::MarcModificationTemplates::ModifyRecordWithTemplate($marc_modification_template_id, $record); >+ C4::MarcModificationTemplates::ModifyRecordWithTemplate( $marc_modification_template_id, $record ); > } > > print MARC::File::XML::record($record); >diff --git a/tools/export.pl b/tools/export.pl >index c5ae274ec21..96921482ae1 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -236,7 +236,7 @@ if ( $op eq "cud-export" ) { > csv_profile_id => $csv_profile_id, > export_items => ( not $dont_export_items ), > only_export_items_for_branches => $only_export_items_for_branches, >- marc_modification_template_id => scalar $query->param('marc_modification_template_id'), >+ marc_modification_template_id => scalar $query->param('marc_modification_template_id'), > } > ); > } elsif ( $record_type eq 'db' or $record_type eq 'conf' ) { >-- >2.47.3 >
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 24679
:
99175
|
99304
|
99700
|
111519
|
111520
|
111521
|
186343
|
186344
|
186345
|
192051
|
192052
|
192053
| 192091