From 070191d77ffb69b70f7061f630816e316ddf5fe3 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 25 Oct 2023 14:53:25 +0000 Subject: [PATCH] Bug 34889: (follow-up) Revise database update following Bug 31383 --- ...AdditionalInstructions-to-additional-contents.pl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl index 442092df37..e4b68490c0 100755 --- a/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl +++ b/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl @@ -18,8 +18,17 @@ return { # 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", + "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 ( ?, ?, ?, ? )", + undef, $insert_id, "PatronSelfRegistrationAdditionalInstructions $lang", $patronselfregistrationadditionalinstructions, $lang ); } -- 2.30.2