Bugzilla – Attachment 33748 Details for
Bug 13308
The export tools is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 13308: The output format should be 'iso2709' instead of 'marc'
SIGNED-OFF-Bug-13308-The-output-format-should-be-i.patch (text/plain), 4.19 KB, created by
Owen Leonard
on 2014-11-20 16:48:47 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 13308: The output format should be 'iso2709' instead of 'marc'
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-11-20 16:48:47 UTC
Size:
4.19 KB
patch
obsolete
>From f7e9e9eb3d1521adfe6aa43e662ffefde330bbc0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 20 Nov 2014 15:13:28 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 13308: The output format should be > 'iso2709' instead of 'marc' >Content-Type: text/plain; charset="utf-8" > >In the template of the export tools, the value 'marc' is set for >the 'format' variable. >It should be 'iso2709'. > >There was a mess in the tools/export.pl script. >2 variables did the same thing: $format and $output_format > >This patch fixes that replacing $format with $output_format > >Test plan: >Try to export biblio in iso2709 and csv using the export tools and from >the checkout list. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Before applying the patch, attemping an MARC export from tools/export.pl >resulted in an error. After the patch the export works correctly. >Exports from the checkouts page also work correctly. >--- > .../intranet-tmpl/prog/en/modules/tools/export.tt | 2 +- > tools/export.pl | 15 ++++++++------- > 2 files changed, 9 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >index 0ac62d1..2e85732 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >@@ -128,7 +128,7 @@ $(document).ready(function() { > <ol><li> > <label for="output_format">File format: </label> > <select id="output_format" name="output_format"> >- <option value="marc">marc</option> >+ <option value="iso2709">marc</option> > <option value="xml">xml</option> > </select> > >diff --git a/tools/export.pl b/tools/export.pl >index 98b9ef9..bae6941 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -33,7 +33,6 @@ use C4::Record; > my $query = new CGI; > > my $clean; >-my $output_format; > my $dont_export_items; > my $deleted_barcodes; > my $timestamp; >@@ -44,7 +43,7 @@ my $op = $query->param("op") || ''; > my $filename = $query->param("filename") || 'koha.mrc'; > my $dbh = C4::Context->dbh; > my $marcflavour = C4::Context->preference("marcflavour"); >-my $format = $query->param("format") || $query->param("output_format") || 'iso2709'; >+my $output_format = $query->param("format") || $query->param("output_format") || 'iso2709'; > > # Checks if the script is called from commandline > my $commandline = not defined $ENV{GATEWAY_INTERFACE}; >@@ -94,7 +93,6 @@ _USAGE_ > } > > # Default parameters values : >- $output_format ||= 'marc'; > $timestamp ||= ''; > $dont_export_items ||= 0; > $deleted_barcodes ||= 0; >@@ -114,6 +112,11 @@ else { > > } > >+# Default value for output_format is 'iso2709' >+$output_format ||= 'iso2709'; >+# Retrocompatibility for the format parameter >+$output_format = 'iso2709' if $output_format eq 'marc'; >+ > my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( > { > template_name => "tools/export.tt", >@@ -142,7 +145,7 @@ if ( C4::Context->preference("IndependentBranches") > my $backupdir = C4::Context->config('backupdir'); > > if ( $op eq "export" ) { >- if ( $format eq "iso2709" or $format eq "xml" ) { >+ if ( $output_format eq "iso2709" or $output_format eq "xml" ) { > my $charset = 'utf-8'; > my $mimetype = 'application/octet-stream'; > binmode STDOUT, ':encoding(UTF-8)'; >@@ -163,8 +166,6 @@ if ( $op eq "export" ) { > ) unless ($commandline); > > $record_type = $query->param("record_type") unless ($commandline); >- $output_format = $query->param("output_format") || 'marc' >- unless ($commandline); > my $export_remove_fields = $query->param("export_remove_fields"); > my @biblionumbers = $query->param("biblionumbers"); > my @itemnumbers = $query->param("itemnumbers"); >@@ -433,7 +434,7 @@ if ( $op eq "export" ) { > > exit; > } >- elsif ( $format eq "csv" ) { >+ elsif ( $output_format eq "csv" ) { > my @biblionumbers = uniq $query->param("biblionumbers"); > my @itemnumbers = $query->param("itemnumbers"); > my $output = >-- >1.7.9.5
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 13308
:
33740
|
33742
|
33748
|
33763