Even once one adds support for rule-configs with #1314630: add support for profile2, rules, rules_link, og, commerce_products, features-override fails to work with Rules. The problem is that rule-configs are not simple data-objects, but classed objects including protected properties and Iteratores. e.g. doing a foreach over a rules-config doesn't give you all properties of it (but all nested actions).

Doing manually object-diffs for such objects like rule-configs won't ever work, so ideally one could just skip all the diff-magic and just export the overridden rule in a alter hook. That would work just fine in case of rules.

Maybe, it would be a good idea to allow people to choose whether overrides should behave that way anyway, as if mostly everything changed I'd prefer a complete override-export anyway as it is more stable, i.e. it won't break if the original export changes arbitrarily.

Comments

nedjo’s picture

nedjo’s picture

What would be needed to support the diffing approach for Rules? Would we need Rules to describe its iterator interfaces? Or to implement a specific method or iterator for this purpose?

fago’s picture

I don't think diffing makes much sense with rules, as if you slightly change a rule it might do already a lot different. Thus, for rules I think it would be already great to have just the "replace component" approach working.

hanoii’s picture

this is an old issue but one I am in the need right now, I wonder if there's anything new currently to handle diffing or working with rules overrides. I have a rule with settings that changes from dev to live, not the rules itself, but the content of some variables. A diffed rule configuration override would definitely help. Also this might be related to #1970474: Notice: Array to string conversion.

hanoii’s picture