When using cck in conjunction with drigg, the scoop summary/description always displays on the very top of the submission form, above the title, no matter the ordering or weight of the fields.

When cck is disabled, the ordering is correct.

Comments

philbar’s picture

In drigg.module, I change the weight from "-6" to "2" in the following code snippet and the field was moved to under the title.

  $form['body'] = array(
    '#type' => 'textarea',
    '#title' => $type->body_label, 
    '#default_value' => $node->body,
    '#weight' => 2, 
    '#required' => FALSE,
  ); 

Is there a way to make drigg more friendly to CCK?

philbar’s picture

As a quick and dirty fix, I opened the "manage fields" configuration page for scoops with javascript disabled. This disabled the core tabledrag.js script that handles drag-n-drop weight assignment. I set the "title" and "body" fields to match drigg's, which is "-7" and "-6" respectively. I saved the modifications, and it should work now.

Without this modification, the title fields were assigned the weights "1" and "2" by CCK, which seemed to conflict with drigg's code.

CCK is a pretty popular module and I think drigg should work well with it. So again, is there a way to make drigg more friendly to CCK?

yoshimi’s picture

Here is what I did to fix the issue:

In drigg.module Changed:

  $form['body'] = array(
    '#type' => 'textarea',
    '#title' => $type->body_label, 
    '#default_value' => $node->body,
    '#weight' => -6
    '#required' => FALSE,
  ); 

To:

  $form['body'] = array(
    '#type' => 'textarea',
    '#title' => $type->body_label, 
    '#default_value' => $node->body,
    '#weight' => variable_get('drigg_body_weight', -6), 
    '#required' => FALSE,
  ); 

In config_forms.inc Changed:

  $form['drigg_body_minimum_length'] = array(
    '#type' => 'textfield',
    '#title' => t("The description's minimum length"),
    '#size' => 5,
    '#maxlength' => 5,
    '#required' => TRUE,
    '#default_value' => variable_get('drigg_body_minimum_length', '50'),
  );
  
  $form['drigg_body_maximum_length'] = array(
    '#type' => 'textfield',
    '#title' => t("The description's maximum length"),
    '#size' => 5,
    '#maxlength' => 5,
    '#required' => TRUE,
    '#default_value' => variable_get('drigg_body_maximum_length', '400'),
  );
  

To:

  $form['drigg_body']['drigg_body_minimum_length'] = array(
    '#type' => 'textfield',
    '#title' => t("The description's minimum length"),
    '#size' => 5,
    '#maxlength' => 5,
    '#required' => TRUE,
    '#default_value' => variable_get('drigg_body_minimum_length', '50'),
  );
  
  $form['drigg_body']['drigg_body_maximum_length'] = array(
    '#type' => 'textfield',
    '#title' => t("The description's maximum length"),
    '#size' => 5,
    '#maxlength' => 5,
    '#required' => TRUE,
    '#default_value' => variable_get('drigg_body_maximum_length', '400'),
  );
  
  $form['drigg_body']['drigg_body_weight'] = array(
    '#type' => 'weight',
    '#title' => t("The description's weight"),
    '#delta' => 10, 
    '#description' => t('In the form, the heavier items will sink and the lighter items will be positioned nearer the top.'),
    '#required' => TRUE,
    '#default_value' => variable_get('drigg_body_weight', -6),
  );

This allows the admin to go to admin/settings/drigg and change the weight. I used a delta of 10 which may need to change. In reality, every form field should be change to allow the admin to set the weight.