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
Comment #1
deekayen commentedMoving patch over here from my dup #433500: hook_form_alter() doesn't set name of workflow anymore
Comment #2
deekayen commentedThis might also fix #453808: Small error if updating a node with no valid workflow states
Comment #3
kepford commentedSubscribing
Comment #4
srisin commentedI'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.
Comment #5
crea commentedSubs
Comment #6
peterpoe commentedNew 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!
Comment #7
jvandyk commentedI'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.