From 6ca279130eacb98c2eb7ea8c4559b5ef4fd51af8 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 25 Jun 2020 09:08:16 +1200 Subject: [PATCH] Bug 25861: Removing non-existent 'important' field from SQL Bug 17232 updated some SQL queries used when adding new MARC bibliographic frameworks. When backported to 19.11.x, it referenced a column `important` that does not exist in marc_tag_structure or marc_subfield_structure in 19.11.x. This patch removes the references to `important` so that adding new bibliographic frameworks works again. To test: 1) Ensure you have checked out 19.11.x branch 2) Go to Admin -> MARC bibliographic frameworks 3) Add a new framework and save 4) Go to Actions -> MARC structure for your new framework 5) Use the 'create framework using' dropdown to import the structure from an existing framework 6) Note that the structure does not populate, and there is now an error in the logs "Unknown column 'important'" 7) Apply this patch and restart services 8) Repeat steps 3-5 9) Confirm the structure is populated correctly and there is no error in the logs Sponsored-by: Catalyst IT Signed-off-by: Katrin Fischer Signed-off-by: Julian Maurice Signed-off-by: Aleisha Amohia --- admin/marctagstructure.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index 4d9b82e9fe..5c7de99eac 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -329,11 +329,11 @@ sub StringSearch { sub duplicate_framework { 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_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 ); - $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=? + $dbh->do(q|INSERT INTO marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,isurl,seealso,hidden,link,defaultvalue,maxlength) + SELECT ?,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,isurl,seealso,hidden,link,defaultvalue,maxlength from marc_subfield_structure where frameworkcode=? |, undef, $newframeworkcode, $oldframeworkcode ); } -- 2.39.5