module_invoke_all doesn't pass arguments by reference.
Patch fixes the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| rules_import.patch | 712 bytes | xen |
module_invoke_all doesn't pass arguments by reference.
Patch fixes the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| rules_import.patch | 712 bytes | xen |
Comments
Comment #1
fagoThat was never intended to be possible, what's your use case for that?
Comment #2
xen commentedECommerce uses rules for transaction workflow and in my payment gateway I need to add another state for authorized but not yet captured payments. Apart from defining some additional rules in my module, I need to add a condition to one of the rules defined by ECommerce.
Alternatively, I would have to disable the ECommerce rule and redefine it in my module, but I don't think there's a straitforward way to do that. Correct me if I'm wrong, it's been a while since I looked at the code.
ECommerce is complex enough as it is, I'd rather avoid having to instruct users on how to alter the relevant rules when installing my payment gateway.
Views has a views_default_views_alter hook that allows for something along the same lines, so I think it makes sense if rules has too.
Comment #3
fagoI see, thanks for explaining. However the import is for something different: it allows modules to react on added certain rules being there and is currently used by the rules_forms module to activate used events. This hook is invoked also when you import using the UI.
So I see your use-case and it makes sense, but we just need a separate _alter() hook for default rules. But be aware that user might have the rules of ec already overridden, in that case your changes won't appear in the overridden rule.
Comment #4
xen commentedAn alter hook doesn't quite solve my problem, but I realize I've been barking up the wrong tree. If the user has modified the eC rule manually, I still need to ensure that my alteration gets applied, as without it, orders that haven't been captured would be marked as completed.
I'll be better off trying to get the condition in eC instead of trying to modify the existing installation.
Doesn't mean that an default_rules_alter wouldn't be generally useful though.
Comment #5
xen commentedOriginal patch in now.