Bug 24221: Improve atomic update
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
bc135ba1e1
commit
7adebc4a81
1 changed files with 7 additions and 6 deletions
|
@ -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'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue