In the drupal-5 version, the fieldgroup module had a higher weight in the system table. In the drupal-6 version, the update is missing.
Increasing the module weight has an big advantage, it simplifies altering fields in hook_form_alter() before they are moved into fieldgroups. Fields would always be directly accessible by their field name (e.g. $form['field_name']) instead of manually checking for fields nested in groups.

The following patch adds an update function (fieldgroup_update_6001()) which increases the module weight to 9 (as it was previously done in fieldgroup_update_4()).

#1 fieldgroup_weight_2.patch1.15 KBmh86
fieldgroup_weight.patch1.13 KBmh86


mh86’s picture

1.15 KB

updated patch, which fixes problems in the previous one. I added the update query, which sets the module weight, to the fieldgroup_install() function too.
Additionally I removed variable_set('fieldgroup_schema_version', 6000); from the install hook, because as far as I can see, the schema_version gets set automatically to the newest version this way or the other.

yched’s picture

Status: Needs review » Fixed

This was present in D5 fieldgroup_install(), not sure why this disappeared.
Fixed (not your exact patch, so be sure to update your code). Thanks.

Note : 'fieldgroup_schema_version' is a hack used to track internal schema changes - we leave it unchanged unless an update function changes the actual db structure for the module.

Side note : looking at this part of code, it seems we don't have any update function that changes table names from D5 node_group* to D6 content_group* ? Meaning we curently lose fieldgroup info on update ? I'll double check that...

Anonymous’s picture

Status: Fixed » Closed (fixed)

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