Closed (fixed)
Project:
Actions
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2007 at 05:57 UTC
Updated:
24 Feb 2010 at 18:35 UTC
I have a situation where I want a node to be created by a user and put in to a 'review' workflow state. An editor will then later update the state to 'published'. What I want is for the node author to be changed to the editor who changed the workflow state.
I noticed that there is a similar action which allows changing a node author to a predetermined user but in my case I want the new author to be the user who changes the node state.
Is there currently some way to do this?
Thanks, :)
Comments
Comment #1
Soren Jones commentedThis is a modification of the function action_node_assign_owner() found in actions.inc that is working for me. I've wrapped it in a module called myactions.module.
Comment #2
MediaMunkey commentedHi,
Thanks for the helpful reply. Since posting this issue I've changed my mind in how to achieve the desired outcome. Instead of changing the user of the node I want to instead call up the editor who changed the workflow state using some sql querying in the node.tpl page. This will be used to simply make it appear that the owner of the node is the editor. I have yet to figure this one out though as I'm not able to code.
Again, thanks for the help anyway.
Comment #3
Bastlynn commentedEven if it wasn't helpful to the original poster - it was quite helpful to me - Thank you! :)
Comment #4
jonaliz55 commentedThis is exactly what I require - but does it work the same way in Drupal 6? -
I could not find the function action_node_assign_owner() in actions.inc.
If not, what modifications are need to make this work in Drupal 6?
Comment #5
jvandyk commentedIn Drupal 6: http://api.drupal.org/api/function/node_assign_owner_action/6
Comment #6
HenkBredell commentedThe link - In Drupal 6: http://api.drupal.org/api/function/node_assign_owner_action/6 appears to refer to the current standard code and not to new code.
I also need an action to change the author to the "current user" so that users are able to take on work by changing the author name and have the nodes appear in their own workspace views. Is a possible way to have an additional user reference in the action configuration dropdown - [current user]. When this selection is made it would always return the "current user" instead of a selected fixed user.
Is something like this possible within the current framework?
Thanks in advance
Henk
Comment #7
jonaliz55 commentedThanks to jvandyk for the node_assign_owner_action link, though I am not a programmer and would like some code which does what HenkBredell requested in #6 above.