From 6d916c330c757604c6fe0919eb9bb7cb02fe02bc Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Fri, 31 Jan 2025 21:35:34 +0000 Subject: [PATCH] Bug 39012: Koha fails to import default MARC bibliographic framework Test plan: ========== 1. In Administration > MARC bibliographic, from framework menu on the right, prepare a csv file with framework export. 2. Try to import the fili into Default framework. 3. This should fail, with a redirect to a strange looking page, and with lots of errors in the logs. 4. Apply the patch ; restart all. 5. Repeat p. 2. You should succeed and you should be able to see the differences in the framework (if you exported from a different framework). Signed-off-by: Phil Ringnalda --- admin/import_export_framework.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl index 363a5217b9..af4c543b23 100755 --- a/admin/import_export_framework.pl +++ b/admin/import_export_framework.pl @@ -84,11 +84,12 @@ if ( $op eq 'export' ) { my $uploadFd = $input->upload($fieldname); if ( $uploadFd && !$input->cgi_error ) { my $tmpfilename = $input->tmpFileName( scalar $input->param($fieldname) ); - $filename = $tmpfilename . '.' . $extension; # rename the tmp file with the extension + $filename = $tmpfilename . '.' . $extension; # rename the tmp file with the extension + $frameworkcode = '' if $frameworkcode eq 'default'; $ok = ImportFramework( $filename, $frameworkcode, 1, 'biblio' ) if ( rename( $tmpfilename, $filename ) ); } } - if ( $ok >= 0 ) { # If everything went ok go to the framework marc structure + if ( $ok >= 0 ) { # If everything went ok go to the framework marc structure print $input->redirect( -location => '/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=' . $frameworkcode ); } else { -- 2.39.5