projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11ee29d
)
AllCoreTables - Fix getClassForTable in multilingual databases
author
Coleman Watts
<coleman@civicrm.org>
Wed, 24 Nov 2021 02:25:58 +0000
(21:25 -0500)
committer
Coleman Watts
<coleman@civicrm.org>
Wed, 24 Nov 2021 02:25:58 +0000
(21:25 -0500)
CRM/Core/DAO/AllCoreTables.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/DAO/AllCoreTables.php
b/CRM/Core/DAO/AllCoreTables.php
index febcb374a83cf9c00cea933e419b1fb693b5bbb3..670ce3e06ebbdd4d483862950f68f640bb78bfd9 100644
(file)
--- a/
CRM/Core/DAO/AllCoreTables.php
+++ b/
CRM/Core/DAO/AllCoreTables.php
@@
-364,6
+364,11
@@
class CRM_Core_DAO_AllCoreTables {
*/
public static function getEntityNameForTable(string $tableName) {
self::init();
+ // CRM-19677: on multilingual setup, trim locale from $tableName to fetch class name
+ if (CRM_Core_I18n::isMultilingual()) {
+ global $dbLocale;
+ $tableName = str_replace($dbLocale, '', $tableName);
+ }
$matches = CRM_Utils_Array::findAll(self::$entityTypes, ['table' => $tableName]);
return $matches ? $matches[0]['name'] : NULL;
}