From 3abab0f817e676a6eb352bd5cf33aeb9e2a66170 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 3 Sep 2016 09:46:15 +1000 Subject: [PATCH] CRM-19291 Fix up eileen's fix for multilingual use practice from 4.6.0 to use first locale for name --- CRM/Core/BAO/SchemaHandler.php | 6 +++--- CRM/Upgrade/Incremental/php/FourSeven.php | 4 ---- CRM/Upgrade/Incremental/sql/4.7.11.mysql.tpl | 4 ++++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index 5b664f7b9d..3cc3e3e482 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -370,13 +370,13 @@ ALTER TABLE {$tableName} /** * @param string $tableName * @param string $columnName - * @param bool $l10n + * @param bool $l18n * */ - public static function dropColumn($tableName, $columnName, $l10n = FALSE) { + public static function dropColumn($tableName, $columnName, $l18n = FALSE) { if (self::checkIfFieldExists($tableName, $columnName)) { $sql = "ALTER TABLE $tableName DROP COLUMN $columnName"; - if ($l10n) { + if ($l18n) { CRM_Core_DAO::executeQuery($sql); } else { diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index 1bfbe1068d..9d820e8a0b 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -796,10 +796,6 @@ FROM `civicrm_dashboard_contact` JOIN `civicrm_contact` WHERE civicrm_dashboard_ CRM_Core_BAO_SchemaHandler::dropColumn('civicrm_dashboard', 'is_minimized'); CRM_Core_BAO_SchemaHandler::dropColumn('civicrm_dashboard', 'column_no'); CRM_Core_BAO_SchemaHandler::dropColumn('civicrm_dashboard', 'weight'); - if ($domain->locales) { - $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales); - CRM_Core_I18n_Schema::rebuildMultilingualSchema($locales, NULL); - } CRM_Core_DAO::executeQuery('UPDATE civicrm_dashboard SET url = REPLACE(url, "&snippet=5", ""), fullscreen_url = REPLACE(fullscreen_url, "&snippet=5", "")'); diff --git a/CRM/Upgrade/Incremental/sql/4.7.11.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.11.mysql.tpl index 7337da12b0..d0eeed5ce4 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.11.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.11.mysql.tpl @@ -15,7 +15,11 @@ UPDATE civicrm_dashboard SET name = 'allCases' WHERE (name IS NULL OR name = '') UPDATE civicrm_dashboard SET name = 'casedashboard' WHERE (name IS NULL OR name = '') AND url LIKE "civicrm/dashlet/casedashboard?%"; -- CRM-19291 Fix names on dashlets where name is an empty string +{if $multilingual} +UPDATE civicrm_dashboard SET name = label_{$locales.0} WHERE name = ''; +{else} UPDATE civicrm_dashboard SET name = label WHERE name = ''; +{/if} -- CRM-18508 Display State/Province in event address in registration emails {include file='../CRM/Upgrade/4.7.11.msg_template/civicrm_msg_template.tpl'} -- 2.25.1