Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Archnemysis CreditAttribution: Archnemysis commentedAlso looking for an answer to this.
Comment #2
Archnemysis CreditAttribution: Archnemysis commentedThe 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:
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?
Comment #3
stella CreditAttribution: stella commentedJust committed a patch to allow users to re-order the position of that field via the 'manage fields' page of a content type.
Comment #5
stella CreditAttribution: stella commentedReleased in 6.x-1.12.