Skip to content

Commit

Permalink
Merge pull request #14302 from mlutfy/drupal19
Browse files Browse the repository at this point in the history
dev/drupal#19 Drupal8: fix bootstrap when used by the REST API
  • Loading branch information
eileenmcnaughton authored May 23, 2019
2 parents 7099e2c + c5a1e8d commit 8e4a28d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Utils/System/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ public function postURL($action) {
*/
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;
}

Expand Down Expand Up @@ -706,7 +706,7 @@ public function languageNegotiationURL($url, $addLanguagePart = TRUE, $removeLan
}

// Drupal might not be bootstrapped if being called by the REST API.
if (!class_exists('Drupal')) {
if (!class_exists('Drupal') || !\Drupal::hasContainer()) {
return NULL;
}

Expand Down

0 comments on commit 8e4a28d

Please sign in to comment.