Skip to content
Snippets Groups Projects
Commit 71b0e2dd authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #52324 by chx: fixed warnings when inserting locale strings.

parent c54a0f57
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -167,7 +167,7 @@ function locale($string) { ...@@ -167,7 +167,7 @@ function locale($string) {
// We have no such translation // We have no such translation
if ($obj = db_fetch_object($result)) { if ($obj = db_fetch_object($result)) {
if ($locale) { if ($locale) {
db_query("INSERT INTO {locales_target} (lid, locale) VALUES (%d, '%s')", $obj->lid, $locale); db_query("INSERT INTO {locales_target} (lid, locale, translation) VALUES (%d, '%s', '')", $obj->lid, $locale);
} }
} }
// We have no such source string // We have no such source string
...@@ -175,7 +175,7 @@ function locale($string) { ...@@ -175,7 +175,7 @@ function locale($string) {
db_query("INSERT INTO {locales_source} (location, source) VALUES ('%s', '%s')", request_uri(), $string); db_query("INSERT INTO {locales_source} (location, source) VALUES ('%s', '%s')", request_uri(), $string);
if ($locale) { if ($locale) {
$lid = db_fetch_object(db_query("SELECT lid FROM {locales_source} WHERE source = '%s'", $string)); $lid = db_fetch_object(db_query("SELECT lid FROM {locales_source} WHERE source = '%s'", $string));
db_query("INSERT INTO {locales_target} (lid, locale) VALUES (%d, '%s')", $lid->lid, $locale); db_query("INSERT INTO {locales_target} (lid, locale, translation) VALUES (%d, '%s', '')", $lid->lid, $locale);
} }
} }
// Clear locale cache in DB // Clear locale cache in DB
......
...@@ -167,7 +167,7 @@ function locale($string) { ...@@ -167,7 +167,7 @@ function locale($string) {
// We have no such translation // We have no such translation
if ($obj = db_fetch_object($result)) { if ($obj = db_fetch_object($result)) {
if ($locale) { if ($locale) {
db_query("INSERT INTO {locales_target} (lid, locale) VALUES (%d, '%s')", $obj->lid, $locale); db_query("INSERT INTO {locales_target} (lid, locale, translation) VALUES (%d, '%s', '')", $obj->lid, $locale);
} }
} }
// We have no such source string // We have no such source string
...@@ -175,7 +175,7 @@ function locale($string) { ...@@ -175,7 +175,7 @@ function locale($string) {
db_query("INSERT INTO {locales_source} (location, source) VALUES ('%s', '%s')", request_uri(), $string); db_query("INSERT INTO {locales_source} (location, source) VALUES ('%s', '%s')", request_uri(), $string);
if ($locale) { if ($locale) {
$lid = db_fetch_object(db_query("SELECT lid FROM {locales_source} WHERE source = '%s'", $string)); $lid = db_fetch_object(db_query("SELECT lid FROM {locales_source} WHERE source = '%s'", $string));
db_query("INSERT INTO {locales_target} (lid, locale) VALUES (%d, '%s')", $lid->lid, $locale); db_query("INSERT INTO {locales_target} (lid, locale, translation) VALUES (%d, '%s', '')", $lid->lid, $locale);
} }
} }
// Clear locale cache in DB // Clear locale cache in DB
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment