Posted by salientknight on February 1, 2011 at 11:18pm
I am SO close it hurts. I have a flag on my node/#submission/#/edit page that only admin can access. I need to assign a role to the user who created the submission when the admin clicks the "approved" flag. I get all the way to "User whos roles should be changed" and the only user option is the flagging user. Does anyone know how to get the submitting user in this drop down box, so that the person who submitted the form's roles might be changed on approval?
Thanks!

Comments
Load content author?
I'm not sure of your exact setup here, but have you tried to load the content author? Doing this should allow that user to be chosen when configuring the "modify user role" setting.
Content Author
I guess that is exactly what I am asking how to do :)
It should be simple...
From Rules, in the "Do" section, click on "Add an Action". Then select "Load the content author", click Next. Update the Label if you wish, and change the "machine readable variable name" to content_author or something other than just "author" which it defaults to. (I believe "author" is already taken, so it will throw an error at you if you don't change it.)
Click Save and then "Add an Action" again. This time choose "Modify user roles" and click Next. In the User drop down, select the "content author" that you just created, select the roles from the Add Roles/Remove Roles config options and Save again. This should get you the desired functionality you are looking for.
Not going to work
Load the content author Unavailable argument: Content
any other thoughts?
what is your..
What is the event that your rule is initially triggered on?
Flag
On the flag. The whole process needs to go something like this:
1) The user fills out and submits a form
2) The Admin reads and flags the form as approved
3) When the approve flag is clicked, a rule is trigger that modifies the roles for the user who authored the form
Here is where I am with this problem.
I have a webform, broken out into a CCK type (or attached to it however you want to think of it)
I have a flag on the submit form using jackinloadup-Flag-Webform-Submissions-6eb961b
I have a rule triggered by the flag -- but thats the sticking point... I cannot access the submitting user from the rule, only the flagging user.
I'm not that familiar with
I'm not that familiar with the Flag module, so this might not work, but if the flag component becomes a part of a node, couldn't you trigger the rule on Content is updated, instead of content is flagged? You could include a condition to only trigger if someone with a certain role or user name updates it, but then you could have the content author available to you.
Hmm I'll try that...
So are you saying,
1)make an admin only check box on the form
2) Make a rule on node edit for the submitted node
3) if that field is checked add role?
I'll try that. Is that what you mean?
Well that's not exactly what
Well that's not exactly what I meant, but that would work too.
This is where my inexperience with the flag module comes in, but if you have a node with a flag on it, and you change the flag, and then save the node, does the node say it is updated? If it does, you should be able to trigger the rule on node update.
But to your point, you could add a cck checkbox field to the node type, name it approved, make it only available to admin role, and setup your rule so that if that field is checked, then it updates the role of the node author. Does that make sense?
It does... but neither of
It does... but neither of those things works... :( What I really need is access to submitting user or node author with the on flag click event.
I use rules like this all the time
I use rules like this all the time, so I know they work. When I add rules like this it goes something like this:
Add a new Rule>Give it a Label>Choose Event "After Updating existing content">Save
Add a condition>Content has type>Next>Choose your content type from the list>Save
Add a condition>Field has value>Next>Choose your field from the list>Continue>Specify value>Save
Add an action>Load the content author>Next>give the machine readable variable name a unique name>Save
Add an action>Modify user roles>Next>choose updated content's author from list>select roles from config options>Save
What is different in your setup that prevents you from using these?
None of my content types are
None of my content types are showing up in the list. Only a bunch of content types from other forms. I don't know if its because I have this webform as a CCK type ... actually, I cannot access any of the fields in views either... in fact, I cannot access any of the fields I've made for any of my webforms... even the ones I have broken out int o CCK types.
Do I need to create the web forms as CCK types and skip the nice webform tool all together?
I followed your directions step by step, and when I got to the content drop down box, there were a number of field_ options but not one for my form.
When you say webforms, do you mean forms you've
made using the webforms module or forms that you've made as custom content types with CCK? IF you are using the webforms module to create webforms, then that is your problem. Webforms submissions are not nodes, so you can't access their authors.
If you are really using cck to build your forms, then I can't think of any reason why you wouldn't have access to them using rules or views.
I build them with the
I build them with the webforms module and then converted them to CCK using node conversion module. These forms are SO big. I dont want to have to re-create them sigh
Going to do a sample with CCK type and see if I can make that float.
Thanks.
Oh...that stinks!
I'd like to check out the node conversion module to see what it does exactly...can you possibly put the link on here? Maybe I'll find something useful.
I re built them with CCK and
I re built them with CCK and got everything working great! Thank you so much for all your help with this :)
-=Sal=-
Glad everything worked out!
Glad everything worked out for you!
You can reuse webform submission data now
Tutorial over here:http://nodeone.se/blogg/finally-webform-submission-data-in-views
/* Mikke Schirén, https://digitalist/ */
how to flag a node using rules
Hello
Sorry if this a dummy question, I'm starting now with drupal and I'm just unable to find documentation about this on drupal.org or the handbooks..
I need to have a node automatically flagged only if the author has certain roles. I'm not capable of finding a way of setting the action "flag node" under the possible actions on the rules creation section. I'm using D7.
Any help highly appreciated!
Screencast
There's a screencast video on how to flag a node using Rules from NodeOne at Learn Flag with NodeOne, part 7: Setting flags with Rules, but it's possible that it doesn't work yet. (There's a crash at 7:00)
As that video is quite new, this is pretty much state of the art right now, D7 is a few months old and most modules are still trying to catch up.
There's a "user has role(s)" condition in Rules, so I suppose that is not your problem.
not yet
Thanks bartl for the info, but something still going wrong for me
I tried with the 7.x-2.x-dev version of Flag module, and also tried patching the module according to http://drupal.org/node/875366, but still I have no FLAG group of actions when defining a rule.
And yes, you are right, the condition is not the problem, what I cannot find is the action to "Flag a node" when the condition is true.
My doubt now is if i'm patching correctly (I'm using cygwin, because I have no ssh access to my server), because according to the screencast after appling the patch the FLAG actions should be available, and they are not for me...
I'll keep investigating, thanks anyway for the help