diff --git a/address.tokens.inc b/address.tokens.inc index 85dfaf9c86f97e46140ee3c80bc45295f3932846..d79f4f0bba1ffc5fa9cea1b496079b5316d350d9 100644 --- a/address.tokens.inc +++ b/address.tokens.inc @@ -12,6 +12,10 @@ use Drupal\Core\Entity\ContentEntityInterface; * Implements hook_token_info(). */ function address_token_info() { + if (!\Drupal::hasService('token.entity_mapper')) { + return; + } + $types = []; $tokens = []; foreach (\Drupal::entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) {