After cloning a Rule with RulesConditional elements everything can go crazy due to that cloned elements has wrong parent — they stick to the old parents instead of acquiring new ones. This leads to unpredictable results but here are some symptoms:

* Rules occasionally rolls back to some old states
* When you save an element in a rule, new elements suddenly appear from nowhere (and those are - some old previously deleted elements
* Your rule doesn't work as expected

I'm yet to discover the reason of why RulesConditional doesn't update parent correctly when cloning.

Dear Taihao, do you read this? :)

Comments

OnkelTem’s picture

Assigned: Unassigned » OnkelTem
Status: Active » Needs work
StatusFileSize
new964 bytes

Ok, let's try this one.

Please test.

OnkelTem’s picture

Title: Cloning a rule/component with RulesConditionalIf's doesn't set new parent » Cloning a rule/component with RulesConditional elements doesn't update their parent correctly
bretbenziger’s picture

This patch worked for me, but I could not simply apply the patch, as the lines didn't line up correctly. I did add the code to the correct place though and it worked.

OnkelTem’s picture

Thanks for the feedback @bretbenziger!
Let me guess — you haven't updated Rules Conditional to dev version? If so, please do, this is required.
But I'm glad it helped!