I wrote a couple of actions for my Drupal page, but for some reason, Drupal isn't picking them up... Nevertheless, it's a copy/paste of the Drupal.org website...

   function publicatie_omgeving_action_info() {
      return array(
        'publicatie_omgeving_publish_action' => array(
          'type' => 'node', 
          'label' => t('A'), 
          'configurable' => FALSE, 
          'behavior' => array('changes_property'), 
          'triggers' => array('comment_presave', 'comment_insert', 'comment_update'),
        '_mijn_organisatie' => array(
          'type' => 'user', 
          'label' => t('AA'), 
          'configurable' => TRUE, 
          'behavior' => array('changes_property'), 
          'triggers' => array('comment_presave', 'comment_insert', 'comment_update'),
        'publicatie_omgeving_menu' => array(
          'type' => 'comment', 
          'label' => t('AAA'), 
          'configurable' => FALSE, 
          'triggers' => array('comment_insert', 'comment_update'),

I only get the first one, A. Is there something wrong with this code?

  • cleared the cache and tried? – rocky Dec 8 '11 at 16:15
  • Yep, I did. Still, no result – Michiel Dec 8 '11 at 16:16
  • where is this function documented? I checked google and found nothing. Is it meant to be overriding a drupal function or is it a custom function you made? Where is it being called? – rocky Dec 8 '11 at 16:21
  • It's the hook_action_info-hook...api.drupal.org/api/drupal/modules--system--system.api.php/… – Michiel Dec 8 '11 at 16:23
  • 1
    Knowing Drupal it's probably a naming convention issue, try prefixing the second action key with the module name, i.e. publicatie_omgeving_mijn_organisatie – Clive Dec 8 '11 at 16:41

It's my understanding that, by convention, an action function should start with modulename_ (to prevent namespace collisions) followed by a short description of what it does, eg publish, but in order to be found at all, it needs to end in _action.

So try naming all of your functions:

publicatie_omgeving _ SOMETHING _ action

and see what happens.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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