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 <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Janusz Kaczmarek 2025-01-31 21:35:34 +00:00 committed by Katrin Fischer
parent c6c36aa870
commit 82707f469e
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -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 {