Specifically ksort($choices) on line 151 doesn't like it when $choices isn't an array.

It leads to a design question, though: What should the module do if no workflow transition choices are available.

CommentFileSizeAuthor
#3 workflow.module.patch781 bytesAlex Reisner

Comments

jvandyk’s picture

We could either bail out or just display the current state.

I guess it depends on how much you want the user to be informed of the current state.

I'd lean towards bailing out and not displaying workflow in that case. You?

merlinofchaos’s picture

I agree; I'd bail and not display the state.

Note that this can also cause issues if there is no valid creation state for the role, and a new node is being created. In that case, I think that the module should somehow try to guess what an acceptable creation state would be. Not quite sure how to go about doing that, though.

Alex Reisner’s picture

StatusFileSize
new781 bytes

The attached patch gets rid of the line 151 error. A function (workflow_field_choices) was returning the wrong data type.

I also agree with you guys about not displaying any info about the state if there aren't any transitions possible. Often this will be for a user who doesn't/shouldn't know about workflow.

jvandyk’s picture

Assigned: Unassigned » jvandyk
Status: Active » Fixed

Applied patch and changed workflow_field_form() to bail out.

Anonymous’s picture

Status: Fixed » Closed (fixed)