Commit bbecae57 authored by yched's avatar yched

#739490 by foripepe: Token integration - fix notices during token generation

parent a7e660d9
......@@ -13,6 +13,7 @@ CCK 6.x-2.x
- #986612 by Dave Reid: Token integration - fix variable name clash (harmless in normal cases)
- #435520 by yched, sun: Fix text fields rendered as 'n/a' in some cases
- #1008184 by merlinofchaos, bojanz, dereine, yched: Adapt to Views 3 "semantic views" feature (backwards compatible with Views 2)
- #739490 by foripepe: Token integration - fix notices during token generation
CCK 6.x-2.8
===========
......
......@@ -39,13 +39,13 @@ function content_token_values($type, $object = NULL, $options = array()) {
content_alter($node);
$field_types = _content_field_types();
foreach ($content_type['fields'] as $field) {
$items = $node->{$field['field_name']};
foreach ($content_type['fields'] as $field_name => $field) {
$items = isset($node->{$field_name}) ? $node->{$field_name} : array();
$function = $field_types[$field['type']]['module'] . '_token_values';
if (!empty($items) && function_exists($function)) {
$token_values = $function('field', $items, $options);
$token_values = (array) $function('field', $items, $options);
foreach ($token_values as $token => $value) {
$tokens[$field['field_name'] .'-'. $token] = $value;
$tokens[$field_name .'-'. $token] = $value;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment