Posted by tmetzger on February 5, 2009 at 7:36pm
When I call workflow_allowed_transitions( $sid, 'to', $user->roles ) I don't get all the correct transitions back. Not sure why! I have checked that the correct roles are going into the function. I have checked the transition definitions. I've even traced through the source code and can't see anything wrong.
Perhaps array_intersect in workflow_transition_allowed is broken??
Any help much appreciated. I've resorted to using 'ALL' for the time being, but that will not do.
Tom
Comments
Ghost town...
Wow, this forum is a ghost town... where did everybody go?? Is workflow dead at this point?
how is that function be used?
I ask because I'd very much like to create a block that has workflow transitions on it -- a shortcut so to speak, so that the user would NOT have to either edit the node in order to change the workflow state via the widget, or use the workflow page (via the workflow tab -- I may want to hide the workflow tab for some users). Rather, I'd like to just have links for workflow state changes that I can style, etc (of course, the block needs logic to build a list of links based on available state changes for the active user.)
Can you point me to anything that spells out how workflow functions are used creatively?
Re: Ghost Town... when I dove into drupal a month ago I had hopes the forums and groups would be a place to get great insights on code tricks, methods, and lots of help for a newbie... but that hasn't been the case.
Sorry I can't offer anything to your question...
Just busted...
Thanks for the reply. I'm beginning to think workflow is just busted. At least I have all the code, so in theory I can figure out why.
I did install the "workflow-access" module just now, so I'll see if that helps. Documentation is sparse, so it's trial-and-error time I guess.
Tom
Workflow is pretty solid...
I think Workflow is pretty solid. With little drupal experience I've built a multi-user site with all the access rules you'd expect: each user is partitioned into their own workspace, content goes through a review process, get's published by a specific role, etc.
The big revelation I had was realizing that everything must be "published" from creation, and letting the Workflow module handle node access. So I now refer to making nodes visible to other users as "Posting".
What bothers me about drupal and workflow is that I can't seem to find a place where lots of code snippets are put into context. I have a few developer books but they deal only with either surface drupal-interface tools or down deep into function API's. But not much in the way of, well... let's say I want to place a button on the bottom of a node-type edit page that executes 'save this node and create another node of a specific alternate type'. How can I do that?!