It would be nice to be able to clone rules in order to replicate similar rules quickly.

Comments

lahoosascoots created an issue. See original summary.

TR’s picture

Title: Add ability to clone rules. » Port ability to clone rules.
Category: Feature request » Task
sibustephen’s picture

Hi, I will be working on this issue, thank you.

TR’s picture

@sibustephen Thanks! This feature is already implemented in D8 Rules Essentials Please install that module and try it out. The cloning functionality works except for the problem I describe in #3064003-2: Export, Import and UUID. I would appreciate any help in solving that problem. Patches should be posted in the D8 Rules Essentials issue queue.

I put the cloning functionality in that project and not here because it's entangled in UI changes and improvements that are not easily separated. My intention is to get cloning and all the other features fully working in that project before putting those features into Rules.

milindk’s picture

Hi @TR, It is very difficult to find the functionality present in the rules module as you are maintaining a separate module for it. As I can see you are committing to rules module from the past few months, It will be good if we can merge D8 Rules Essentials functionality in rules modules itself.

milindk’s picture

@TR I checked D8 Rules Essentials clone functionality. I can see there are some issues with it when we are trying to save cloned rules and cache invalidation.
Also, the clone feature in D8 Rules Essentials module does not provide an option to change the title of the cloned rule, it directly clones it without any form as we have in D7 rules module.

Should I check the issue related with clone functionality in D8 Rules Essentials module and make it similar to D7 clone implementation?
Also, I was thinking to create a separate patch directly into the rules module for the clone feature by referring to D8 Rules Essentials module so that the clone feature will directly be available in D8 rules module.

TR’s picture

I'm away from my keyboard until next week. The clone function names the Rule "Clone of ..." - it's my recollection is that D7 Rules did the same thing, but I could be wrong. (EDIT: I was wrong, in D7 it does have an intermediate stage, with a name already picked out for you but which can be edited.) You can always edit the Rule and change the name later. Or if you think an intermediate stage where you pick a new name is better UX, then sure I'd like to see a patch for D8RE that does that.

The cache invalidation after changing a Rule is a problem with Rules, and I think there's an open issue for it but I can't search now. (EDIT: Yes, there's an open issue, it's #2769511: Cache is not invalidated when Rules are changed).

I would prefer to get clone working in D8RE first, then move all of that initial Rules at once. That would be a lot easier for me

TR’s picture

Issue tags: +D8RE

Tagging issues that will be fixed by code moved from D8RE.