Change workflow state

margie_s - July 6, 2007 - 19:45
Project:Views Actions Links
Version:5.x-1.0
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I am using views_actions_links to 'change workflow state of a node to next state'. However, it toggles between 2 of my 3 states and never gets to the 3rd. Do you know why?

Thanks.

#1

Morris Singer - July 11, 2007 - 21:54

I have not used the workflow module, so my response may be somewhat unenlightened. At the risk of asking a silly question, I should ask if you've configured the actions properly (independent of the views_actions_links) module. The reason I suspect it hasn't to do with this module is because all this module does is provide a field that contains a link to a MENU_CALLBACK that executes the necessary action.

I am sorry I cannot be of more help on this. If I have a chance, I will install Workflow on a test site and attempt to set up a similar situation.

#2

hkazemz - August 16, 2007 - 01:31

I implemented a patch to define a new action that would allow a change from a state to any state in the workflow. I noticed an issue with function views_actions_links_provide_link().

return l($action['description'], 'views_actions_links/action/' . $action['function'] . '/' . $nid, array(),

Note that the variable $action['function'] causes the name of the function representing a particular action to always be passed to Actions module actions_do() function.

The problem is that for configured actions with defined instances, the action id (actions.aid which is numeric) must be passed instead, otherwise the link won't work. I changed $action['function'] above to $action['aid'] which works for both configured and non-configured actions. If you make this change, you should also change Actions module actions_get_all_actions() to return the 'aid' field value of actions too.

 
 

Drupal is a registered trademark of Dries Buytaert.