I can't get my new Rules' condition to work.

I wrote the (simple) code below in includes/MYMODULE.rules.inc, and nothing appears in the condition list.

/**
 * Implementation of hook_rules_condition_info().
 */
function MYMODULE_rules_condition_info() {
    return array(
        'MYMODULE_rules_condition_MYCONDITION' => array(
            'label' => t('My label'),
            'group' => 'My very own group',
        )
    );
}

/**
 * Condition
 */
function MYMODULE_rules_condition_MYCONDITION() {
    // logic
    return TRUE;
}

I have already tried to flush the Drupal cache (as it seems to me that Rules uses a cache system).

link|improve this question

75% accept rate
feedback

1 Answer

Read Rules 2.x / Drupal 7; I think you can find what you want, there.

link|improve this answer
Thanks nourcy, but that's was my starting point. :-( – druvik Dec 23 '11 at 11:07
Update Drupal install. Get back my condition code to the main .module file. Submit modules page again. That's seems to work. (I don't know if i have to be happy or not) – druvik Dec 23 '11 at 11:15
1  
If your code works in the main module, but not in your custom module then is you custom module installed correctly? Is it enabled? Does the module do anything else that is working correctly? – Ashlar Dec 23 '11 at 16:11
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.