From what I can tell the UI version of recreate feature in features.admin.inc uses some checks after features_populate returns to make sure features_exclude is respected. The drush version (drush fd and drush fu) do not perform these checks, so anything added by the drupal_alter('features_export' ...) call in features_populate will remain.

This can be tested easily with the field_group module as its features_export_alter will add the parent field group for any field contained in the module, or with UUID by exporting a taxonomy term (the vocabulary will be added to the module even if it is in features_exclude for the module).

I feel like the check should be done in features_populate after features_exclude_alter gets called, that way the behavior would be consistant for all the functions that call it, like the different places in features.drush.inc and features_detect_overrides . As it is it seems like anything added by a module's features_exclude should get left out in this function, but the ones added by features_exclude_alter won't be, and I'm not sure that makes sense.

Files: 
CommentFileSizeAuthor
#4 features-features_exclude_for_features_export_alter-2097835-2.patch940 bytesIntegrity178B
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

Comments

jmuzz’s picture

Version:7.x-2.0-rc3» 7.x-2.x-dev
Status:Active» Needs review
StatusFileSize
new942 bytes
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

The patch adds the checks I think should be there. It seems to fix the problems I have with drush fd and drush fu without messing up the behavior of the UI.

jmuzz’s picture

Well, drush fd still seems to say the items will be added, but fu doesn't add them, which is the important part. It would be better if they were consistant though.

hefox’s picture

Issue summary:View changes
Status:Needs review» Needs work
+++ b/features.export.inc
@@ -23,9 +23,21 @@ function features_populate($info, $module_name) {
+    if (isset($export['features_exclude']['dependencies']) &&

The if (isse(export[features_exclude']['dpeendencies'] should proceed the foreach as no reason to foreach if not set (same with both areas)

Integrity178B’s picture

StatusFileSize
new940 bytes
PASSED: [[SimpleTest]]: [MySQL] 40 pass(es).
[ View ]

Good day, guys

I had the same issue. I have to use drush only, because the idea of my project is in building up a site with different configurations using cli, so I'm using drush site install and managing all features via drush.
Thanks a lot, jmuzz, your solution fixed this problem. Additionally, I have made the second version of patch according to hefox advice. Hope, this problem will be fixed in next version of feature module.

uladzimir.karol’s picture

Status:Needs work» Needs review