Very useful tool.

To get this to work for drupal 7 I changed these two lines in features_clone.class.inc;

$sql = "select filename from {system} where name='%s' and status=1";
$modulefile = db_result(db_query_range($sql, $this->src_feature, 0, 1));

to

$sql = "select filename from {system} where name=:name and status=:status";
$modulefile = db_query($sql, array('name' => $this->src_feature, 'status' => 1))->fetchField();

The clone seems to work but then you get a php error after the clone has finished;

PHP Fatal error: Call to undefined function module_exists() in ***/includes/cache.inc on line 170
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined function module_exists() in ***/includes/cache.inc, line 170

I don't know if this has an impact on anything because the clone still took place.

Comments

nedjo’s picture

The error is due to the bootstrap level specified in features_clone_drush_command(). Remove the line

'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_DATABASE,

and it should work.

thetoast’s picture

Thanks nedjo

webankit’s picture

Port this to D7

fl3a’s picture

Title: drupal 7 » Drupal 7 port
Status: Active » Needs review
StatusFileSize
new1.25 KB

Changed title to something more meaningfull and attached a corresponding patch which includes the lines from from description and comment 1.

elvis2’s picture

@ fl3a, worked great for me on 7.21. The one thing I noticed was that the feature needed to be enabled before running. This is fine but maybe the README should mention that.

Thanks for the patch.

geek-merlin’s picture

Issue summary: View changes

Thanks! Seems to work great!

  • fl3a committed fc1583d on 7.x-1.x
    Implemented changes from #1460008 including comment 1.
    
fl3a’s picture

Assigned: Unassigned » fl3a
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.