Most people won't really care about this, but I found an inconsistency starting in CVS revision 1.75 of node.module, which leads to the node form array containing an element whose name is an empty string, like: $form['workflow'][''].

Have a look at:

CVS diff

In workflow_form_alter, this code is used:

workflow_node_form($form, $form_state, $name, $name, $current, $choices, $timestamp, $comment);

but, starting in 1.75, $name is undefined. Prior to this version, it was set to:

$name = check_plain(workflow_get_name($wid));

I think the solution would be to add this line back in somewhere before the call to workflow_node_form.

Comments

deekayen’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB
deekayen’s picture

kepford’s picture

Subscribing

srisin’s picture

I'm using Version 6.x-1.3 and $name being empty string has caused the workflow options to NOT be rendered in the node edit form.
Thanks to deekayen's patch, it's now working as expected.

I hope this problem will be fixed in future release(s) so I wouldn't have to patch the workflow.module file.

crea’s picture

Subs

peterpoe’s picture

StatusFileSize
new2.96 KB

New patch:
- The form array key is changed from '[workflow][$name]' to '[workflow][workflow_choices]'. This is really not important because the values are directly passed to the parent 'workflow' key.
- The duplicate argument $name is removed from workflow_node_form().
- The 2 calls to workflow_node_form() are adjusted accordingly.
I think it's RTBC!

jvandyk’s picture

Status: Needs review » Fixed

I've committed a modified version of deekayen's patch. Restoring this behavior changes the appearance of the workflow section of the node editing form. With $name being a blank string, the title of the workflow was not shown. With it being restored, the workflow name is now shown as the title of the fieldset and as the title. Some people may think this is redundant. So I've added an option on the edit form for the workflow: a checkbox that determines whether the name of the workflow is shown on the form as the title or not. Will appear in 6.x-1.5.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.