From 7adebc4a81fbdd8c6c52186a31ad097b23eeef9b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 22 Mar 2022 13:19:24 +0100 Subject: [PATCH] Bug 24221: Improve atomic update Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- ..._move-opacmysummarynote-to-addtional-contents.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl b/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl index 61ca95d94e..76c1751797 100644 --- a/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl +++ b/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl @@ -11,13 +11,14 @@ return { SELECT value FROM systempreferences WHERE variable='OPACMySummaryNote'; |); if( $opacmysummarynote ){ - # Insert any values found from system preference into additional_contents - foreach my $lang ( 'default' ) { - $dbh->do( "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OpacMySummaryNote', 'OpacMySummaryNote', NULL, ?, ?, ?, CAST(NOW() AS date) )", undef, "OpacMySummaryNote $lang", $opacmysummarynote, $lang ); - } + $dbh->do(q{ + INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) + VALUES ('html_customizations', 'OpacMySummaryNote', 'OpacMySummaryNote', NULL, ?, ?, ?, CAST(NOW() AS date) ) + }, undef, "OpacMySummaryNote default", $opacmysummarynote, 'default'); # Remove old system preference - $dbh->do("DELETE FROM systempreferences WHERE variable='OPACMySummaryNote'"); - say $out "Bug 24221 update done"; + $dbh->do(q{ + DELETE FROM systempreferences WHERE variable='OPACMySummaryNote' + }); } } }