I'm running into scenarios where anonymous users might create a new workflow state, but do not have permission to cause transition state changes. Therefore, they do not have any options, as stated in workflow-7.x-1.x-dev:
// @TODO: Some users, like anonymous, may not be allowed
// to cause transitions, so there will be no choices.
$keys = array_keys($choices);
I am running migrations via drush, and my current workaround is to supply drush an authenticated --user argument. Any advice for a workflow patch, to get rid of this @TODO?
Comments
Comment #1
nancydruI'm not clear on your point here. If anonymous users can create a node, then that user is "author" and must be allowed to transition to at least one state (usually the first one).
I will look at that note and see if I can remember why I put it there.
Comment #2
nancydruWell, it's no longer there in my code. How long ago did you download?
Comment #3
bdone commentedI'm seeing it on line 47 of workflow.tokens.inc using 7.x-1.x (HEAD).
Comment #4
nancydruAh, that 'splains it.
So, please explain the situation so a blond (me) can understand it. I allowed an anonymous user to create a node and it flowed through with no problem.
Comment #5
bdone commentedRegarding #1, I'm setting node authors programmatically during migration, and running the migration as anonymous (via drush). So in that case, maybe an edge case admittedly, i can't depend on the global $user in workflow_field_choices().
Comment #6
nancydruPlease test if this patch solves your issue.
Comment #7
nancydruOops, missed some
Comment #8
bdone commentednot having any luck with patch in #7. drush errors that migrate captures come from workflow.tokens.inc:
i'll continue debugging.
Comment #9
nancydruCould you give this a try, please?
Comment #10
nancydrucommitted