summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjpa2018-08-29 11:53:32 (GMT)
committerBojan Zivanovic2018-08-29 11:53:32 (GMT)
commit5d27521b778bb067f5143d640b3152d25dd02b50 (patch)
tree6df0bdeb2d5f7d30165d7145a9f2cbe25a7632cd
parent7b4d23491283cffec151d218991f0ecc0d7c3585 (diff)
Issue #2980217 by mjpa, bojanz: address_token_info() crashes if Token module is not present
-rw-r--r--address.tokens.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/address.tokens.inc b/address.tokens.inc
index 85dfaf9..d79f4f0 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) {