Posted by Dave Reid on January 28, 2013 at 6:48am
2 followers
| Project: | Features |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Let's say I've got a custom module with the following code:
<?php
/**
* Implements hook_hook_info().
*/
function mymodule_hook_info() {
$info = array();
$info['mymodule_item_info'] = array('group' => 'mymodule');
$info['mymodule_item_info_alter'] = array('group' => 'mymodule');
return $info;
}
/**
* Implements hook_features_api().
*/
function mymodule_features_api() {
return array(
'mymodule_item' => array(
'name' => 'My module items',
'feature_source' => TRUE,
'default_hook' => 'mymodule_item_info',
'alter_hook' => 'mymodule_item_info',
),
);
}
?>The first hook allows all implementations of hook_mymodule_item_info and hook_mymodule_item_alter() to be placed in modulename.group-value.inc and be automatically included via module_invoke and module_invoke_all, which is awesome. It would be nice if Features could automatically tell that since I've provided my default hook, that it should attempt to set default_file to FEATURES_DEFAULTS_CUSTOM, and default_filename to the group string.
Comments
#1
#5
Sorry about the unrelated comments, posted in wrong issue. I deleted them.