Active
Project:
Content moderation
Version:
6.x-1.9
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Mar 2011 at 01:22 UTC
Updated:
24 Mar 2011 at 01:22 UTC
It seems like a good idea to trigger a generic event when there has been any kind of state change. That way a rule could be set up to notify an admin or a content management role when there has been a state change, regardless of the content type or the new state.
To accomplish this only requires two additional lines of code.
1. At the bottom of _content_moderation_node_transition_matrix(), before the return statement:
$node_state_matrix["anynode_anystate_anystate"]= t("State of any node type changed to any other state");
2. Inside of _content_moderation_save_history(), in the last if statement:
if(module_exists('rules')) {
rules_invoke_event("{$node->type}_{$curstate}_{$nextstate}", $node);
rules_invoke_event("anynode_anystate_{$nextstate}", $node);
// NEW LINE TO ADD:
rules_invoke_event("anynode_anystate_anystate", $node);
}