Hi,

I am creating a module to allow my site's members to post article, and then the article will go through a moderation process. I need to have Actions to set/unset the unsupport moderation flag in node.

These are the code in my module to define those actions:

<?php
function advnews_action_info() {
    return array(
'advnews_node_moderate_action' => array(
             
'type' => 'node',
           
'description' => t('Moderate post'),
           
'configurable' => FALSE,
           
'behavior' => array('changes_node_property'),
           
'hooks' => array(
                  
'nodeapi' => array('presave'),
                  
'comment' => array('insert', 'update'),
                   ),
            ),
            
'advnews_node_unmoderate_action' => array(
           
'type' => 'node',
           
'description' => t('Unmoderate post'),
           
'configurable' => FALSE,
           
'behavior' => array('changes_node_property'),
           
'hooks' => array(
                
'nodeapi' => array('presave'),
                
'comment' => array('delete', 'insert', 'update'),
                 ),
             ),
    );
}
/**
* Implementation of a Drupal action.
* Sets the status of a node to 0, meaning moderated.
*/
function advnews_node_moderate_action(&$node, $context = array()) {
   
$node->moderate = 0;
   
watchdog('action', t('Set @type %title to moderated.', array('@type' => node_get_types('name', $node), '%title' => $node->title)));
}
/*************************************************************************/
/**
* Implementation of a Drupal action.
* Sets the status of a node to 1, meaning unmoderated.
*/
function advnews_node_unmoderate_action(&$node, $context = array()) {
   
$node->moderate = 1;
   
watchdog('action', t('Set @type %title to unmoderated.', array('@type' => node_get_types('name', $node), '%title' => $node->title)));
}
?>

The defined actions show up in the Action list, I was able to assign them to my workflow. But when the workflow triggered, the moderate flag of the node does not change at all. it seems that the $node object has not been passed to the moderate/unmoderate action.

The Actions module I am using is 5.2x, one that has Drupal 6 action style. I have patch the Node module as required. Can anyone here help? That would be very much appreciated!

Thanks