Running rules-6.x-1.3. If a triggered rule is related to a flag and the name of that flag is changed, then the rule breaks and following error appears in 'admin/rules/trigger':
"event_flag_{flag action}_{flag name} can't be found. Probably the providing module has been deactivated."
Quote from the help text of the 'flag name' field: "The machine-name for this flag. ... It will be used in URLs and in all API calls. Change this value only with great care."
Still, it would be better, if the rule wouldn't brake.

Comments

quicksketch’s picture

I don't think this will be fixed. Other things that cannot be automatically corrected like function names, templates, exported views or rules would always break regardless. Some modules like Views don't allow you to change the machine name at all once it's been set.

mooffie’s picture

Category: bug » support

That's not a bug.

That Rules doesn't let you re-connect this rule to some other event should be considered a bug in Rules.

However, there's a simple fix for this. I added it to the handbook:
Fixing a rule that "breaks" after renaming a flag

not_Dries_Buytaert’s picture

Title: When changing 'flag name' Rule should not break » Changed machine names should not break rules or else broken rules should remain editable
Project: Flag » Rules
Component: Rules integration » Provided Rules integration
Category: support » feature
Priority: Minor » Normal

Instead of the current behavior of Rules (like I described in the startpost of this issue) that module could:
1) accept the changed flag name or else
2) show a link to edit broken/ dangling rules (avoiding the need to manually export, change and import).

Apparently, this issue is more general and specific to Rules (not Flag).

mitchell’s picture

Version: 6.x-1.3 » 7.x-2.x-dev
Status: Active » Closed (fixed)
mitchell’s picture

Component: Provided Rules integration » Provided Module Integrations

Updated component.