From 4d16a7e17da3a8f8256b1e3426fa37c47dc7c4af Mon Sep 17 00:00:00 2001 From: David Snopek Date: Mon, 30 Oct 2017 23:30:54 -0500 Subject: [PATCH] CRM-21372: Fix fatal error adding profile on Drupal 8 --- CRM/Core/BAO/UFGroup.php | 11 ++++------- CRM/Utils/System/Drupal8.php | 7 +++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 77400aeeeb..493ec603ec 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -1542,13 +1542,10 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) ); CRM_Core_DAO::executeQuery($query, $p); - // do a menu rebuild if we are on drupal, so it gets all the new menu entries - // for user account - $config = CRM_Core_Config::singleton(); - if ($menuRebuild && - $config->userSystem->is_drupal - ) { - menu_rebuild(); + // Do a menu rebuild, so it gets all the new menu entries for user account + if ($menuRebuild) { + $config = CRM_Core_Config::singleton(); + $config->userSystem->updateCategories(); } } diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index b4b725ef3e..8b63762170 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -546,6 +546,13 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { return TRUE; } + /** + * @inheritDoc + */ + public function updateCategories() { + // @todo Is anything necessary? + } + /** * @inheritDoc */ -- 2.25.1