From fcf972cb90af0bf4ae078ab3a28533194a77cf5f Mon Sep 17 00:00:00 2001 From: Mark Hanna Date: Mon, 7 Aug 2023 14:46:31 -0500 Subject: [PATCH] port to 4.0.x from 436: Include dblocale table names in list of civicrm entity info --- src/SupportedEntities.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/SupportedEntities.php b/src/SupportedEntities.php index 9bb86fd6..943e1f98 100644 --- a/src/SupportedEntities.php +++ b/src/SupportedEntities.php @@ -715,6 +715,22 @@ public static function getInfo() { if (!in_array($entity_info['civicrm entity name'], $api_entity_types)) { unset($civicrm_entity_info[$entity_type]); } + // Insert dblocale table names + $multilingual = \CRM_Core_I18n::isMultilingual(); + if ($multilingual) { + // @codingStandardsIgnoreStart + global $dbLocale; + // @codingStandardsIgnoreEnd + if ($dbLocale) { + $tables = \CRM_Core_I18n_Schema::schemaStructureTables(); + if (in_array($entity_type, $tables)) { + $locale_table_name = $entity_type . $dbLocale; + if (strlen($locale_table_name) <= 32) { + $civicrm_entity_info[$locale_table_name] = $entity_info; + } + } + } + } } return $civicrm_entity_info; }