Closed (duplicate)
Project:
Entity view modes
Version:
7.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Apr 2013 at 20:53 UTC
Updated:
3 Jul 2013 at 06:40 UTC
It appears that view modes and their configuration export fine through Features (2.x-dev) but the view modes are not actually registered when the feature is installed fresh (like in an install profile).
I searched up and down (and even tried the 2.x-dev + patch for EVM for Features) to no avail. In the end, I had to do this in the Feature module .install hook_enable that I made:
$entity_view_modes = array('node' => array('grid' => array('label' => 'Grid', 'custom settings' => TRUE), 'mini' => array('label' => 'Mini', 'custom settings' => TRUE)));
$modes = variable_get('entity_view_modes', array());
$modes = $modes + $entity_view_modes;
variable_set('entity_view_modes', $entity_view_modes);
// Clear the static entity info cache and rebuild the menu.
entity_info_cache_clear();
variable_set('menu_rebuild_needed', TRUE);
This made the View Modes available on the Manage Display screen of content types, and the view mode configuration was there and intact. Otherwise, the view modes would not show, requiring the user to 'recreate' it from the admin form.
Comments
Comment #1
dave reidFeatures support hasn't actually been added to this module yet, so I'm not quite sure what you're referring to. I think we should merge this issue with #1425620: Features Module Support?
Comment #2
kevinquillen commentedOkay, that would explain it. It was disorienting because I could export bundle/field settings and see the view mode configs, but the modes themselves didn't export.
Comment #3
joachim commentedLooks like we can close this as a duplicate.