From 505e133e1b49ddc7598f54e470cbb3c59008b636 Mon Sep 17 00:00:00 2001 From: olivierh65 Date: Wed, 7 Apr 2021 20:15:17 +0200 Subject: [PATCH] In Drupal8, CMS intergration don't show table mapping In Drupal8, CMS intergration don't show table mapping, because $database global variable is no more defined and can be retreived using Drupal\Core\Database\Database::getConnectionInfo() --- CRM/Admin/Form/Setting/UF.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/Setting/UF.php b/CRM/Admin/Form/Setting/UF.php index 9f5e618540..09e0123710 100644 --- a/CRM/Admin/Form/Setting/UF.php +++ b/CRM/Admin/Form/Setting/UF.php @@ -45,7 +45,13 @@ class CRM_Admin_Form_Setting_UF extends CRM_Admin_Form_Setting { } // find out if drupal has its database prefixed - global $databases; + if ($this->_uf == 'Drupal8') { + $databases['default'] = Drupal\Core\Database\Database::getConnectionInfo('default'); + } + else { + global $databases; + } + $drupal_prefix = ''; if (isset($databases['default']['default']['prefix'])) { if (is_array($databases['default']['default']['prefix'])) { -- 2.25.1