Bug 34889: (follow-up) Revise database update following Bug 31383
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
c2b4115d9c
commit
660ae805ad
|
|
@ -16,13 +16,19 @@ return {
|
|||
if ($patronselfregistrationadditionalinstructions) {
|
||||
|
||||
# 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', 'PatronSelfRegistrationAdditionalInstructions', 'PatronSelfRegistrationAdditionalInstructions', NULL, ?, ?, ?, CAST(NOW() AS date) )",
|
||||
undef, "PatronSelfRegistrationAdditionalInstructions $lang",
|
||||
$patronselfregistrationadditionalinstructions, $lang
|
||||
);
|
||||
}
|
||||
$dbh->do(
|
||||
"INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'PatronSelfRegistrationAdditionalInstructions', 'PatronSelfRegistrationAdditionalInstructions', NULL, CAST(NOW() AS date) )"
|
||||
);
|
||||
|
||||
my ($insert_id) = $dbh->selectrow_array(
|
||||
"SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'PatronSelfRegistrationAdditionalInstructions' AND location = 'PatronSelfRegistrationAdditionalInstructions' LIMIT 1",
|
||||
{}
|
||||
);
|
||||
|
||||
$dbh->do(
|
||||
"INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'PatronSelfRegistrationAdditionalInstructions default', ?, 'default' )",
|
||||
undef, $insert_id, $patronselfregistrationadditionalinstructions
|
||||
);
|
||||
|
||||
# Remove old system preference
|
||||
$dbh->do("DELETE FROM systempreferences WHERE variable='PatronSelfRegistrationAdditionalInstructions'");
|
||||
|
|
|
|||
Loading…
Reference in New Issue