Commit 518ab58a authored by vincent baronnet's avatar vincent baronnet
Browse files

Issue #3201343 by willeaton: DomainNegotiator::getActiveDomain() null in domain_entity_get_domain

parent 75545735
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -112,7 +112,14 @@ function domain_entity_entity_field_access($operation, FieldDefinitionInterface
 *   The currently active domain.
 */
function domain_entity_get_domain() {
  return \Drupal::service('domain.negotiator')->getActiveDomain();
  $active_domain = \Drupal::service('domain.negotiator')->getActiveDomain();

  // @todo remove after https://www.drupal.org/project/domain/issues/3226427 is fixed?
  if (empty($active_domain)) {
    $active_domain = \Drupal::service('domain.negotiator')->getActiveDomain(TRUE);
  }

  return $active_domain;
}

/**