summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorigapchuck <igapchuck@luxoft.com>2019-07-03 13:39:31 +0300
committerigapchuck <igapchuck@luxoft.com>2019-07-18 12:21:24 +0300
commit3e0f0f10d72f866e7f46a8df8c0cdde2eb02fd5d (patch)
treeec434223f09c27f4a0e24dbcde151e4b76d4af59
parent09638727f75ae775d81fa54a8b681c2b1b004254 (diff)
downloadsdl_core-feature/sdl_passenger_mode_revision_implementation.tar.gz
Fix not saving consumer friendly messages into DBfeature/sdl_passenger_mode_revision_implementation
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc5
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc19
2 files changed, 22 insertions, 2 deletions
diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc
index ab57ab989f..b3816d37f8 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -675,8 +675,9 @@ const std::string kInsertLanguage =
"INSERT OR IGNORE INTO `language` (`code`) VALUES (?)";
const std::string kInsertMessageString =
- "INSERT INTO `message` (`language_code`, `message_type_name`) "
- "VALUES (?, ?)";
+ "INSERT INTO `message` (`language_code`, `message_type_name`, `tts`, "
+ "`label`, `line1`, `line2`, `textBody`) "
+ "VALUES (?, ?, ?, ?, ?, ?, ?)";
const std::string kUpdateModuleConfig =
"UPDATE `module_config` SET `preloaded_pt` = ?, "
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index bcd3322b0d..8ac04ba5f3 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -1524,6 +1524,25 @@ bool SQLPTRepresentation::SaveMessageString(
query.Bind(0, lang);
query.Bind(1, type);
+ if (strings.tts.is_valid() && strings.tts.is_initialized()) {
+ query.Bind(2, (*strings.tts));
+ }
+
+ if (strings.label.is_valid() && strings.label.is_initialized()) {
+ query.Bind(3, (*strings.label));
+ }
+
+ if (strings.line1.is_valid() && strings.line1.is_initialized()) {
+ query.Bind(4, *(strings.line1));
+ }
+
+ if (strings.line2.is_valid() && strings.line2.is_initialized()) {
+ query.Bind(5, (*strings.line2));
+ }
+
+ if (strings.textBody.is_valid() && strings.textBody.is_initialized()) {
+ query.Bind(6, (*strings.textBody));
+ }
if (!query.Exec() || !query.Reset()) {
LOG4CXX_WARN(logger_, "Incorrect insert into message.");