Commit 3f51e4ef authored by yched's avatar yched
Browse files

Properly handle 'default' and customized view modes

parent 4fdcfb1d
......@@ -663,11 +663,6 @@ function field_group_info_groups($entity_type = NULL, $bundle = NULL, $view_mode
if (isset($groups[$entity_type][$bundle][$view_mode])) {
return $groups[$entity_type][$bundle][$view_mode];
}
// @todo right assumption here ? (couldn't get anything else when looking at nodes
// unless I'd override the full content view mode also
elseif (isset($groups[$entity_type][$bundle]['default'])) {
return $groups[$entity_type][$bundle]['default'];
}
else {
return array();
}
......@@ -753,8 +748,13 @@ function field_group_field_attach_form($entity_type, $entity, &$form, &$form_sta
/**
* Implements hook_field_attach_view_alter().
*/
function field_group_field_attach_view_alter(&$output, $context) {
field_group_attach_groups($output, $context['view_mode']);
function field_group_field_attach_view_alter(&$element, $context) {
// Check whether the view mode uses custom display settings or the 'default'
// mode.
$view_mode_settings = field_view_mode_settings($element['#entity_type'], $element['#entity_type']);
$view_mode = $context['view_mode'];
$actual_mode = (!empty($view_mode_settings[$view_mode]['custom_settings']) ? $view_mode : 'default');
field_group_attach_groups($element, $actual_mode);
}
/**
......
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