For a user who can only create nodes in one state, the workflow fieldset on the node-edit form is automatically hidden, and that one state is passed on in a hidden form input. However, in the 6.x branch of the Workflow module, this hidden input is missing the proper name attribute that allows Drupal to retrieve its value. It looks like this:
<input type="hidden" name="" id="edit-" value="1" />
But it should look like this:
<input type="hidden" name="workflow" id="edit-workflow" value="1" />
Because the workflow_nodeapi function contains provisions for an empty "workflow" form value, this bug has gone unnoticed (I only found it while debugging another issue). I've attached a patch that fixes the problem. The patch moves the exception handler that generates the hidden input from workflow_node_form to workflow_form_alter. I believe the latter is correct since this exception only exists when the node-edit form is being generated (the Workflow tab will always have at least two states available, if any). Furthermore, this means one less function call to workflow_node_form when only a hidden input is needed.
| Comment | File | Size | Author |
|---|---|---|---|
| workflow_node_form_fix.patch | 2.7 KB | eromba |
Comments
Comment #1
ARray commentedsubscribe.
It is very critical for me :(
Comment #2
deekayen commented#364608: Node form element name regression