Commit 0918975a authored by bdriesen's avatar bdriesen Committed by Joel Muzzerall
Browse files

Issue #2042015 by BramDriesen: Implementing hook_field_collection_item_view...

Issue #2042015 by BramDriesen: Implementing hook_field_collection_item_view now returns a correct $langcode
parent 3556e304
......@@ -915,7 +915,7 @@ function field_collection_field_formatter_view($entity_type, $entity, $field, $i
$view_mode = !empty($display['settings']['view_mode']) ? $display['settings']['view_mode'] : 'full';
foreach ($items as $delta => $item) {
if ($field_collection = field_collection_field_get_entity($item)) {
$element[$delta]['entity'] = $field_collection->view($view_mode);
$element[$delta]['entity'] = $field_collection->view($view_mode, $langcode);
$element[$delta]['#theme_wrappers'] = array('field_collection_view');
$element[$delta]['#attributes']['class'][] = 'field-collection-view';
$element[$delta]['#attributes']['class'][] = 'clearfix';
......@@ -948,7 +948,7 @@ function field_collection_field_formatter_view($entity_type, $entity, $field, $i
$view_mode = !empty($display['settings']['view_mode']) ? $display['settings']['view_mode'] : 'full';
foreach ($items as $delta => $item) {
if ($field_collection = field_collection_field_get_entity($item)) {
$element[$delta]['entity'] = $field_collection->view($view_mode);
$element[$delta]['entity'] = $field_collection->view($view_mode, $langcode);
}
}
break;
......
Supports Markdown
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