summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorigapchuck <igapchuck@luxoft.com>2019-07-03 13:39:31 +0300
committerigapchuck <igapchuck@luxoft.com>2019-07-24 10:26:36 +0300
commit2c83332223342252286f7d33520b83070259ef20 (patch)
tree7b9384f59d2c6a59d0e298eb4a3d046949ca5314
parentf0928e7c0023ca77011c9906edb0accc1962480a (diff)
downloadsdl_core-feature/sdl_passenger_mode.tar.gz
Fix not saving consumer friendly messages into DBfeature/sdl_passenger_mode
-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.");