Stumbled upon this using views bulk operations to give many nodes with my custom state 'published' the lower custom state 'draft' again using the views bulk operation 'Change workflow state of post to next state'. A transition from custom state 'published' to 'draft' exists.

Though highest states can have a transition to a lower state, the action 'select next state' will not work on the highest state because the foreach loop in function workflow_select_next_state_action will not set the new state if the current state is the last in the loop. The flag is set when the state is met but after that the loop is exited and the new state is not set.
I consider this a bug, because if there is a transition for the 'highest' (last) state, the action change to next state should be possible.

Comments

mattsplatw’s picture

I have a workflow with states "(create)," "review," and "publish." I cannot get a state change from the highest state to the next lowest state (publish -> review) to work. Workflow goes into a semi-infinite loop of review -> publish -> review -> publish, etc. Is this the same bug you're citing here? My workflow actions defined for this state change are the following...

Actions for publish -> review:
1. Change workflow state of post to next state
2. Remove post from front page
3. Save post

When you say "highest states can have a transition to a lower state," is there a way to do it without hitting this bug? Or will this never work?

Bastlynn’s picture

Status: Active » Closed (won't fix)

Since this request is over a year old, I'm going to assume a solution was found or you've moved on. If not, please get updated to the latest versions of all modules and make a request for it against Drupal 7 and I'll be glad to take a look at it.