Problem/Motivation

When using drush features-export on Drupal 6 to export additional configurations to an existing feature, the module fails to find existing features unless they are located directly inside sites/all/modules. The module does not find existing features that may be organized in subfolders such as sites/all/modules/custom_features/, and proceeds to recreate a "new" version of the same module and places it in sites/all/modules.

Proposed resolution

Leverage some of the existing code used in drush features-update to do better features detection, to look for existing features throughout the drupal codebase, before assuming the feature doesn't exist and creating it in sites/all/modules.

Remaining tasks

  1. Write Patch.
  2. Review Patch.
  3. Commit.

User interface changes

None.

API changes

None.

Data model changes

None.

Similar/related issues

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jwilson3 created an issue. See original summary.

jwilson3’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
639 bytes

This patch leverages similar code used in drush features-update to detect existing features before handing off to features-export.

    if (($feature = feature_load($name, TRUE)) && module_exists($name)) {
      _drush_features_export($stub, array(), $name, dirname($feature->filename));
    } else {
      _drush_features_export($stub, array(), $name);
    }
jwilson3’s picture

jwilson3’s picture

Needed to add an array_merge_recursive to merge new exports with existing exports.

jwilson3’s picture

For the moment, this solution does not work with wildcards. you have to specify each and every item you want to export completely.

Example 1: Does not work:

drush features-export myfeature variable:views_devel_%

Example 2: Does work:

drush features-export myfeature variable:views_devel_output variable:views_devel_region