diff --git a/token.tokens.inc b/token.tokens.inc index cd08cd1..1a0e1e7 100755 --- a/token.tokens.inc +++ b/token.tokens.inc @@ -1389,6 +1389,14 @@ function field_token_info_alter(&$info) { // definitions include $fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions($entity_type_id) + \Drupal::service('entity_field.manager')->getFieldStorageDefinitions($entity_type_id); + + // Bundles can define their own base field definitions so add those to the + // field list too. + // @see hook_entity_bundle_field_info_alter(). + foreach (\Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type_id) as $bundle_name => $bundle) { + $fields += \Drupal::service('entity_field.manager')->getFieldDefinitions($entity_type_id, $bundle_name); + } + foreach ($fields as $field_name => $field) { // If a token already exists for this field, then don't add it. if (isset($info['tokens'][$token_type][$field_name])) {