There is a rule that comes with Commerce Paypal, commerce_payment_paypal_wpp, it implements an Action: “PayPal WPP – Credit Card”, which provides an admin interface to configuring the PayPal WPP, with API Username, password, etc. We’ve implemented our settings for this, as with other rules, as commerce_paypal_wpp.rules_defaults.inc.
The problem is that, in this case, commerce_paypal_wpp.rules_defaults.inc is not loaded for some reason when the rule is installed. After installation, we have to log in, navigate to that admin form, open it and press save, no changes, just press save.
We tried without success:
function MODULE_default_rules_configuration_alter(&$configs) { $configs['commerce_payment_paypal_wpp']->active = TRUE; $rule = rules_config_load('commerce_payment_paypal_wpp'); $rule->save; }
What do we need to do in code that would do the work of clicking that save button? This is the last obstacle to a zero-touch installation, would really like to get that in. Any ideas?