Implementation of hook_content_fieldapi() in fieldgroup.module looks for 'delete', however the correct operation is 'delete instance'.

Attached patch fixes this, and also fixes the function comment from "Implementation of hook_fieldapi()" to "Implementation of hook_content_fieldapi()".

CommentFileSizeAuthor
fieldgroup.fieldapi.patch525 bytesmarkus_petrux
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Status: Needs review » Fixed

Right - committed to 6.x-2.x (along with an update function to remove orphaned records).
Thx !

Status: Fixed » Closed (fixed)

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

markus_petrux’s picture

Status: Closed (fixed) » Active

Reopening since the update function contains a little bug that cause an error when using table prefix.

The following SQL statement does not use table name delimiters for the table in the SELECT part:

  $ret[] = update_sql("DELETE FROM {content_group_fields} WHERE (field_name, type_name) NOT IN (SELECT field_name, type_name FROM content_node_field_instance)");

Instead, it should look like this:

  $ret[] = update_sql("DELETE FROM {content_group_fields} WHERE (field_name, type_name) NOT IN (SELECT field_name, type_name FROM {content_node_field_instance})");
markus_petrux’s picture

Status: Active » Needs review

No patch, but code can still be reviewed. Please, let me know if you prefer this in patch form.

yched’s picture

Status: Needs review » Fixed

Right, fixed. Thanks !
Added the correct version as a new update, to be sure everyone gets it right.

Status: Fixed » Closed (fixed)

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