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...

Comments

dman’s picture

StatusFileSize
new30.9 KB
new63.3 KB

as in http://drupal.org/node/441142

If you use CCK to 'manage fields' and drag the 'body' around anywhere (or make any change at all AFAIK) there's a good chance that the form 'weights' set when form_alter added its field will become totally nonsensical.

Here's my fix
workflow.module


/**
 * 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.

dman’s picture

Status: Active » Needs review
benedictsteele’s picture

StatusFileSize
new1.2 KB

This works perfectly for me. I rolled it into a patch, just in case I needed to revert.

tsvenson’s picture

Nice one dbman, worked perfect.

dman’s picture

Status: Needs review » Reviewed & tested by the community

Patch is harmless, and useful - bumping this status up a bit.

Colorful Tones’s picture

Awesome! I would really love the option to collapse the fieldset by default. Any timeline for patch?

Thanks so much!!!
Damon

jhedstrom’s picture

Patch works as expected. Thanks dman.

dboulet’s picture

This fix was just what I needed, thanks!

dman’s picture

Category: support » task

let's bump it up then. this is now a very well-tested patch!

brisath’s picture

Subscribing.

I want this too, so I'm looking forward to this in a dev version.

csc4’s picture

Subscribing

dman’s picture

Title: How to move workflow fieldgroup in the form? » How to reposition workflow fieldgroup in the edit form! Patch available here

jazzing up title

owntheweb’s picture

Yesssss! Headaches gone. Thank you! :D

alan d.’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

Bumping up

alan d.’s picture

StatusFileSize
new847 bytes

Patch re-rolled against 6.x-1.x-dev with a small clean up.

jvandyk’s picture

Status: Reviewed & tested by the community » Fixed

Fixed. Thanks.

jcisio’s picture

Great news! Thank you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz’s picture

Version: 6.x-1.x-dev » 6.x-1.4
Category: task » feature
StatusFileSize
new2.15 KB

Patch for feature requested in comment #6 (http://drupal.org/node/428376#comment-1824934)

This patch adds a checkbox in the Workflow Edit form along with the other two Comment Option Checkboxes. The new option is labeled "Show comment field as collapsed by default" and by checking the box it hides the Comment Fieldset within the Node Edit Form.

This patch has been tested against Drupal 6.19 and Workflow 6.x-1.4.

dboulet’s picture

Hi JoshuaPowell, this issue has been closed for quite a few months now, you would probably be better off creating a new issue for your patch.

udvranto’s picture

JoshuaPowell,
It was very helpful! Thanks!