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:

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.

#1

deekayen - June 7, 2009 - 06:14
Status:active» needs review

Moving patch over here from my dup #433500: hook_form_alter() doesn't set name of workflow anymore

AttachmentSize
workflow_missing_form_name.patch 1.13 KB

#2

deekayen - June 7, 2009 - 06:23

#3

bobkepford - October 12, 2009 - 23:54

Subscribing

#4

srisin - December 4, 2009 - 09:06

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.

 
 

Drupal is a registered trademark of Dries Buytaert.