How to reposition workflow fieldgroup in the edit form! Patch available here
edde42 - April 8, 2009 - 23:34
| Project: | Workflow |
| Version: | 6.x-1.1 |
| Component: | User interface |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
I have a CCK form that has 3 fieldgroups and then a text area. The workflow fieldgroup is placed after the CCK fieldgroups and before the text area. It isn't listed in the Manage Fields so I can move it there...

#1
as in http://drupal.org/node/441142
Here's my fix
workflow.module<?php/**
* Implementation of hook_content_extra_fields.
*
* Information for the positioning of non-CCK contrib fields
* @see content_extra_field_weight()
*
* Workflow inserts its widget into the node edit form low in the page, but cck
* then scrambles the node edit form when the 'body' is repositioned. Allow the
* CCK UI to fix that and place the widget where you want.
*/
function workflow_content_extra_fields($type_name) {
$extra = array();
if (!in_array('node', variable_get('workflow_' . $type_name, array('node')))) {
return;
}
$extra['workflow'] = array(
'label' => t('Workflow'),
'description' => t('The nodes workflow state'),
'weight' => 10,
);
return $extra;
}
?>
I'm on stable, non dev/CVS system right now, so no patch.
If I was to roll a patch it would also add the option to collapse that fieldset by default, and optionally hide the date picker, which is redundant and confusing to my current editors.
Would that sort of patch be welcome?
If not, just paste this at the bottom of workflow.module.
#2
#3
This works perfectly for me. I rolled it into a patch, just in case I needed to revert.
#4
Nice one dbman, worked perfect.
#5
Patch is harmless, and useful - bumping this status up a bit.
#6
Awesome! I would really love the option to collapse the fieldset by default. Any timeline for patch?
Thanks so much!!!
Damon
#7
Patch works as expected. Thanks dman.
#8
This fix was just what I needed, thanks!
#9
let's bump it up then. this is now a very well-tested patch!
#10
Subscribing.
I want this too, so I'm looking forward to this in a dev version.
#11
Subscribing
#12
jazzing up title
#13
Yesssss! Headaches gone. Thank you! :D