Hello
Need to get rule settings for my custom module. Try to call rules_config_load('RULE_NAME') but it doesn't work as expected.It returns only array containing basic information (Id, name etc), "settings" array is empty.

What's wrong?

Comments

mlsamuelson’s picture

I had the same issue. The posting at http://stackoverflow.com/questions/7023863/how-to-get-drupal-rules-settings helped.

Essentially you load the config:

$rule_config = rules_config_load('your_rule'); // Look in {rules_config} table if you're unsure of the name.

Then call the actions() method on the $rule_config object in a foreach to build an array of the settings:

foreach ($rule_config->actions() as $action) {
  $settings[] = $action->settings;
}
TR’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)