Project:Voting Actions
Version:5.x-2.0b2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hey there,

I was debugging my site this afternoon and realised that the new voting_actions.module does not add the "touch node creation date" and 'touch updated date". You still have to intall votingAPI_actions.module also. Is this normal or all actions should be in the new voting_actions.module?

Thanks

Comments

#1

Title:Not adding the new actions?» Not adding some actions?

Changing title to something that makes more sense...

#2

I installed Voting Actions and Voting API -- and cannot find the "touch node creation date" and "touch node updated date" actions. I would like to use these actions (more than the voting mechanism) to affect an RSS feed connected to my Drupal nodes.

Can someone please explain how I can get the two actions mentioned above to appear in the list of "Actions available to Drupal" or in the pulldown list of "configurable actions"?

Thank You. -Peter

#3

Seems that you need to add votingAPI actions as well as voting actions, or something like that...It's been a long time I installed this, but I know I have enabled to really similar modules...

Voting actions is still in beta, so that might be why, one thing is for sure, once you install the right module the actions will be there, so all is good ;)

Patchak

#4

So I looked around for the actual functions that create the Touch node created and Touch node modified actions. I couldn't find them anywhere in the Voting Action module files. But I did find this file which provides the function call for both actions:

/**
* Implementation of a Drupal action.
* Sets the status of a node to 1, meaning published.
*
*/
function action_node_touch_created($op, $edit = array(), &$node) {
switch($op) {
case 'do':
$node->created = time();
if (!$edit['defer']) {
node_save($node);
}
watchdog('action', t('Touched creation date of node id %id', array('%id' => intval($node->nid))));
break;

case 'metadata':
return array(
'description' => t('Touch node creation date'),
'type' => t('Node'),
'batchable' => true,
'configurable' => false,
);

// return an HTML config form for the action
case 'form':
return '';

// validate the HTML form
case 'validate':
return TRUE;

// process the HTML form to store configuration
case 'submit':
return '';
}
}

/**
* Implementation of a Drupal action.
* Sets the status of a node to 1, meaning published.
*
*/
function action_node_touch_changed($op, $edit = array(), &$node) {
switch($op) {
case 'do':
$node->changed = time();
if (!$edit['defer']) {
node_save($node);
}
watchdog('action', t('Touched change date of node id %id', array('%id' => intval($node->nid))));
break;

case 'metadata':
return array(
'description' => t('Touch node change date'),
'type' => t('Node'),
'batchable' => true,
'configurable' => false,
);

// return an HTML config form for the action
case 'form':
return '';

// validate the HTML form
case 'validate':
return TRUE;

// process the HTML form to store configuration
case 'submit':
return '';
}
}

I added these functions to the action.inc file in /sites/all/modules/actions and then reloaded the Actions module. The two actions now appear in my list of available actions. I'm going to test the actions. If they work in the new location, I'll possibly disable the Voting Actions module.

Any thoughts on why the two function calls are missing in the current Voting Actions module files?

#5

Tested. The two actions can live comfortably in the actions.inc file mentioned above. I see these two actions as very useful to the workflow / actions combo, especially when paired with the Scheduled Actions module. I'll post about this in the actions module area. For now, I've disabled Voting Actions.

nobody click here