Node form element name regression
Gribnif - January 26, 2009 - 20:42
| Project: | Workflow |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
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:
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.

#1
Moving patch over here from my dup #433500: hook_form_alter() doesn't set name of workflow anymore
#2
This might also fix #453808: Small error if updating a node with no valid workflow states
#3
Subscribing
#4
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.