I am trying to insert a new event inside an already existing module. The module is Nodeaccess https://www.drupal.org/project/nodeaccess it's used to grant users edit/delete permissions to single nodes.
inside sites/all/modules/nodeaccess i have made the file nodeaccess.rules.inc which contains this code:
/**
* @file
* Rules integration.
*/
/**
* Implementation of hook_rules_event_info().
*/
function nodeaccess_rules_event_info() {
return array(
'nodeaccess_grant_permissions' => array(
'label' => t('Permissions are granted to a user'),
'group'=>t("NodeAccess"),
'variables' => array(
'granter' => array('type' => 'user', 'label' => t('The user who granted the permissions.')),
'granted' => array('type' => 'user', 'label' => t('The user who got the new permissions.')),
'node' => array('type' => 'node', 'label' => t('The node on which the permission has been granted.')),
),
),
);
}
Looking at different guides on the web it looks like this is all you have to do to get a new event but in the events list i can't find it. I have tried:
refreshing the cache
disabling/enabling nodeaccess module then refreshing the cache (and rebuilding permissions as it was requested)
disabling/enabling rules module then refreshing the cache
adding the rule entry in a *.rules.inc file i've seen it's being imported (namely the feeds.rules.inc file from the feeds module which already existed when i installed the rules module)
Nothing worked so far
EDIT: i have changed the function name and the entry name (both from "node_access" to "nodeaccess" ) but it's still not showing. I have discovered that if i add an entry on a file i know it's being imported and keep the prefix of the entry, then it shows up