Currently you can enable or disable a rule via drush but it would be good to add delete and revert.

Technically they will both do the same thing however it would be good to have both as commands as it is useful to know the intention from the command.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rcross’s picture

+1 anyone got an alternative way to delete or revert a rule programmatically?

rooby’s picture

I use this:

<?php
    if ($rules_config = rules_config_load('my_rule')) {
      $rules_config->delete();
    }
?>
luizsgpetri’s picture

I did rules_config_delete(array('rules_test_add_to_cart'));

TR’s picture

Provide a patch and we can add this feature...

TR’s picture

Issue tags: +Novice
TR’s picture

Status: Active » Needs review
FileSize
2.96 KB

OK, this was easy so I just did it myself. Too bad someone didn't contribute this years ago - it only took 10 minutes to code and test but could have saved a lot of people a lot of time.

  • TR committed c164c27 on 7.x-2.x
    Issue #2507187 by TR: Add rules revert and delete drush commands
    
TR’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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