From c5a1e8d2b69ffc33db64092124338b7f67b064ad Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Wed, 22 May 2019 19:59:28 -0400 Subject: [PATCH] dev/drupal#19 Drupal8: fix bootstrap when used by the REST API --- CRM/Utils/System/Drupal8.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index f1df28970a..b832eee682 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -659,7 +659,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { */ public function getCurrentLanguage() { // Drupal might not be bootstrapped if being called by the REST API. - if (!class_exists('Drupal')) { + if (!class_exists('Drupal') || !\Drupal::hasContainer()) { return NULL; } @@ -706,7 +706,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { } // Drupal might not be bootstrapped if being called by the REST API. - if (!class_exists('Drupal')) { + if (!class_exists('Drupal') || !\Drupal::hasContainer()) { return NULL; } -- 2.25.1