From 9af21daf526ac4454811db9aade06eb3c6f61457 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 24 Oct 2016 11:04:39 +0200 Subject: [PATCH] Bug 16035: MARC default bibliographic framework Export fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch makes sure that, if there is no framework code, $frameworkcode is set to 'default'. This fixes the format issue. Then, if $frameworkcode = default, an empty string (rather than null) is passed to the ExportFramework method, as the framework code in the DB for default codes is "". To test: 1) Go to Admin -> MARC Bibliographic framework 2) Try to export default framework in all formats, notice the file is only exported as .ods and is an empty file. Notice warns in intranet error log. 3) Apply patch and refresh page 4) Confirm exporting default framework works in all formats and spreadsheet has data 5) Notice warns in error log are gone 6) Confirm export still works for other frameworks Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall (cherry picked from commit 705097f938ba9334c21b3e6f006bd7c9ba38763c) Signed-off-by: Frédéric Demians (cherry picked from commit 1de610bb63f70b9f4a1e3a8a5683de5d3bb7bb12) Signed-off-by: Julian Maurice --- admin/import_export_framework.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl index 41511b4d4f..c5058247a0 100755 --- a/admin/import_export_framework.pl +++ b/admin/import_export_framework.pl @@ -46,14 +46,18 @@ unless ($authenticated) { exit 0; } -my $frameworkcode = $input->param('frameworkcode') || ''; +my $frameworkcode = $input->param('frameworkcode') || 'default'; my $action = $input->param('action') || 'export'; ## Exporting if ($action eq 'export' && $input->request_method() eq 'GET') { my $strXml = ''; my $format = $input->param('type_export_' . $frameworkcode); - ExportFramework($frameworkcode, \$strXml, $format); + if ($frameworkcode == 'default') { + ExportFramework('', \$strXml, $format); + } else { + ExportFramework($frameworkcode, \$strXml, $format); + } if ($format eq 'csv') { # CSV file -- 2.39.5