On the Create FAQ page ive accidentally moved the Question details field so its above the Question field, and cant find a way to move it back down the order.

The error was made whilst re-ordering the fields under Content types > Edit FAQ > Manage fields

The field isnt available on this screen to re-order.

Comments

Archnemysis’s picture

Also looking for an answer to this.

Archnemysis’s picture

The weight for the "Question details (optional)" field, or detailed_question, is hardcoded into the module as "-1". This can be found on line 225 of faq.module:

  // Detailed question.
  $form['detailed_question'] = array(
    '#type' => 'textarea',
    '#title' => t('Question details (optional)'),
    '#default_value' => $node->detailed_question,
    '#weight' => -1,
    '#rows' => 3,
    '#description' => t('Longer question text.  This will be displayed in all layouts where the answer appears, in addition to the shorter question text.'),
  );

After reordering fields at admin/content/node-type/faq/fields, the values for all other fields except detailed_question are stored in the "variable" table in the "content_extra_weights_faq" field.

Table:
variable

Field:
content_extra_weights_faq

Value (example, yours will differ):
a:8:{
s:5:"title";s:2:"-5";
s:10:"body_field";s:2:"-4";
s:20:"revision_information";s:1:"0";
s:6:"author";s:2:"-2";
s:7:"options";s:2:"-1";
s:4:"menu";s:1:"1";
s:8:"taxonomy";s:2:"-3";
s:4:"path";s:1:"2";
}

In the above example, the weight of the "title" field (Question) is -5, the weight of the "body_field" field (Answer) is -4.

To get the display right, you will need to alter the weight value on line 225 of faq.module; change some of the weight values stored in the content_extra_weights_faq field of the variable table of your sites database; or some messy combination of both.

To solve my issue, I changed the weight of the "title" field to "-10" via phpmysql, and altered the weight value on line 225 of faq.module to be -6. After uploading the altered module, and saving the changes to the database I then flushed all caches and the display looked normal.

This way of doing it is really bad however. Since now whenever I update the FAQ module, or alter the order of fields for the FAQ content type, these changes will be undone. Anyone else have an idea for an easier (safer) way to do this?

Perhaps this should be a feature request?

stella’s picture

Category: support » feature
Status: Active » Fixed

Just committed a patch to allow users to re-order the position of that field via the 'manage fields' page of a content type.

Status: Fixed » Closed (fixed)

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

stella’s picture

Released in 6.x-1.12.