DB Error: no such field after enabling Multiple Languages option
We've a single language installation with CiviCRM 5.6.1 & Drupal 7
After we've enabled the "Multiple Language" option under "Multiple Languages Support" section in the config page:
https://www.domain.org/civicrm/admin/setting/localization?reset=1
We have the following error:
Initialization Error
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => simpleHandler
)
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] =>
SELECT v.label as label ,v.name as value, v.grouping as grouping
FROM civicrm_option_value v,
civicrm_option_group g
WHERE v.option_group_id = g.id
AND g.name = 'languages'
AND g.is_active = 1 AND v.is_active = 1 AND ( v.component_id IS NULL OR v.component_id IN (SELECT id FROM civicrm_component WHERE name IN ("CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign")) ) ORDER BY v.weight [nativecode=1054 ** Unknown column 'v.label' in 'field list']
[type] => DB_Error
[user_info] =>
SELECT v.label as label ,v.name as value, v.grouping as grouping
FROM civicrm_option_value v,
civicrm_option_group g
WHERE v.option_group_id = g.id
AND g.name = 'languages'
AND g.is_active = 1 AND v.is_active = 1 AND ( v.component_id IS NULL OR v.component_id IN (SELECT id FROM civicrm_component WHERE name IN ("CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign")) ) ORDER BY v.weight [nativecode=1054 ** Unknown column 'v.label' in 'field list']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info="
SELECT v.label as label ,v.name as value, v.grouping as grouping
FROM civicrm_option_value v,
civicrm_option_group g
WHERE v.option_group_id = g.id
AND g.name = 'languages'
AND g.is_active = 1 AND v.is_active = 1 AND ( v.component_id IS NULL OR v.component_id IN (SELECT id FROM civicrm_component WHERE name IN ("CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign")) ) ORDER BY v.weight [nativecode=1054 ** Unknown column 'v.label' in 'field list']"]
)
To solve this issue, we've hacked the DAO.php file to set the global var: $dbLocale
@@ -423,10 +423,8 @@ class CRM_Core_DAO extends DB_DataObject {
global $dbLocale, $_DB_DATAOBJECT;
+ if (!$dbLocale) {$dbLocale = '_en_US';}
+
if (empty($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
// Will force connection to be populated per CRM-20541.
new CRM_Core_DAO();
Do you have an idea about this?