Needs work
Project:
Features
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2010 at 12:54 UTC
Updated:
21 Jun 2012 at 23:45 UTC
Hi,
when i call features_revert() function with no params, i'm attending to revert all components of my feature:
But, only certains components is reverted in this 2 categories (classics and others)
The problem is due to a miss in _features_restore() when features_get_component_states() is calling when parameter $items are empty:
if (empty($items)) {
$states = features_get_component_states();
foreach ($states as $module_name => $components) {
...
the 2nd params ($rebuild_only) of features_get_component_states() function is TRUE by default so here this parameter depends of the value $op (rebuild or revert)
Here is a patch that should fix the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| feature_revert_no_params.patch | 776 bytes | atouchard |
Comments
Comment #1
atouchard commentedWhat do you think to pass these parameters for a better rebuild ?
Comment #2
hefox commentedThis doesn't quite seem like a bug, rather assumption on how function works (perhaps documentation needed).
I'm personally very hesitant to change how the function works at to such an extreme as others are likely using it as it currently works.
Comment #3
atouchard commentedYes you are right, this change is radical and side effects are important.
But, you don't have the same behaviour with equivalent in drush (features_command_revert()). In this function, you don't have the issue because the function iterates for each module (perhaps the developper of this code have seen this problem).
So if you revert with features_revert() with no parameters or you type drush fra, you don't have the same result.
Comment #4
atouchard commentedOk, documentation is a good point to explain how features_revert() behave with extensions like feature_extra, strongarm, ...
Empty value means to revert only original components of "Features".
Perhaps, add a shortcut to features_revert() 's argument to revert all features and extensions. The code will be inspired by features_command_revert_all() in features.export.inc.
Also, there is no side effects ...
Comment #5
hefox commentedIf this is done, it should be done in d7 first and then decided whether it should be backported.
Comment #6
becw commentedPerhaps the first step is documentation? #1651330: features_revert() missing docblock (patch)