Commit 7bed3fd8 authored by yched's avatar yched

#111862 (followup) - lost 'view' value in node array.

parent aeec5a6a
......@@ -602,7 +602,7 @@ function _content_field_invoke_default($op, &$node, $teaser = NULL, $page = NULL
/**
* Format field output based on display settings.
*/
function _content_field_view($node, $teaser = NULL, $page = NULL) {
function _content_field_view(&$node, $teaser = NULL, $page = NULL) {
$type_name = is_string($node) ? $node : (is_array($node) ? $node['type'] : $node->type);
$type = content_types($type_name);
$field_types = _content_field_types();
......@@ -619,19 +619,24 @@ function _content_field_view($node, $teaser = NULL, $page = NULL) {
$module = $field_types[$field['type']]['module'];
$callbacks = module_invoke($module, 'field_settings', 'callbacks', $field);
if (isset($callbacks['view']) && $callbacks['view']) {
$value = module_invoke($module, 'field', 'view', $node, $field, $node_field, $teaser, $page);
$function = $module .'_field';
if (function_exists($function)) {
$value = $function('view', $node, $field, $node_field, $teaser, $page);
}
}
if (empty($value)) {
$items = array();
foreach ($node_field as $delta => $item) {
$items[$delta] = $item;
$items[$delta]['view'] = content_format($field, $item, $formatter, $node);
$node->$field['field_name'] = $items;
$node_field[$delta]['view'] = content_format($field, $item, $formatter, $node);
}
$value = theme('field', $node, $field, $items, $teaser, $page);
$value = theme('field', $node, $field, $node_field, $teaser, $page);
}
}
$return[$field['field_name']] = $value;
// test for values in $node_field in case modules added items
if (isset($node->$field['field_name']) || count($node_field)) {
$node->$field['field_name'] = $node_field;
}
}
}
return $return;
......
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