From 1659dfb591cdd1a2134fc72469a474207592d68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Fri, 30 Oct 2026 10:59:54 -0400 Subject: [PATCH] fix php warning when body field absent, closes #51 $property['field'] may sometimes be non-empty, (eg. the "body" field of node entities) and at the same time not appear in $field_info_map instead of relying on the field property, examine $field_info_map directly to check if we can verify the field type --- entity_token.tokens.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity_token.tokens.inc b/entity_token.tokens.inc index e3a8efb..d6d9e5e 100644 --- a/entity_token.tokens.inc +++ b/entity_token.tokens.inc @@ -133,7 +133,7 @@ function entity_token_token_info_alter(&$info) { foreach (entity_plus_get_all_property_info($entity_name) as $name => $property) { // Skip touching the definitions for image and date fields, // as these are created in core. - if (!empty($property['field']) && in_array($field_info_map[$name]['type'], array('date', 'datetime', 'datestamp', 'image',))) { + if (array_key_exists($name, $field_info_map) && in_array($field_info_map[$name]['type'], array('date', 'datetime', 'datestamp', 'image',))) { continue; }