From: Katrin Fischer Date: Tue, 14 Apr 2020 10:45:01 +0000 (+0000) Subject: Bug 17232: Make sure all fields are copies when creating a new framework from another X-Git-Tag: v20.05.00~416 X-Git-Url: http://git.equinoxoli.org/?p=koha.git;a=commitdiff_plain;h=a852fae89a8d358f314d93dc7554dea72492e285 Bug 17232: Make sure all fields are copies when creating a new framework from another Some digging revealed that when you create a new framework and use an old framework as the base, some information would not be copied to the new framework as they were missing from the SQL command used here. - Tag: Important - Subfield: - Important - Default value - Max length - Is a URL - Link To test: - Pick one of the existing frameworks and change the fields listed above. Take note of what you changed. - Create a new framework - Go to "Marc structure" of the new framework - You are offered the option to copy an existing framework - Use your prepared framework - Verify the fields weren't copied - your config was lost - Apply patch - Create another new framework - Repeat the duplication and tests - Verify that now all fields have been copied correctly Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index b5d7004..d6b7d14 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -335,13 +335,13 @@ sub StringSearch { # the sub used to duplicate a framework from an existing one in MARC parameters tables. # sub duplicate_framework { - my ($newframeworkcode,$oldframeworkcode) = @_; - my $dbh = C4::Context->dbh; - $dbh->do(q|INSERT INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, ind1_defaultvalue, ind2_defaultvalue, frameworkcode) - SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value, ind1_defaultvalue, ind2_defaultvalue, ? from marc_tag_structure where frameworkcode=?|, undef, $newframeworkcode, $oldframeworkcode ); + my ($newframeworkcode,$oldframeworkcode) = @_; + my $dbh = C4::Context->dbh; + $dbh->do(q|INSERT INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, important, authorised_value, ind1_defaultvalue, ind2_defaultvalue, frameworkcode) + SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,important,authorised_value, ind1_defaultvalue, ind2_defaultvalue, ? from marc_tag_structure where frameworkcode=?|, undef, $newframeworkcode, $oldframeworkcode ); - $dbh->do(q|INSERT INTO marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden) - SELECT ?,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden from marc_subfield_structure where frameworkcode=? + $dbh->do(q|INSERT INTO marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,important,kohafield,tab,authorised_value,authtypecode,value_builder,isurl,seealso,hidden,link,defaultvalue,maxlength) + SELECT ?,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,important,kohafield,tab,authorised_value,authtypecode,value_builder,isurl,seealso,hidden,link,defaultvalue,maxlength from marc_subfield_structure where frameworkcode=? |, undef, $newframeworkcode, $oldframeworkcode ); }