Not sure if this will "just work" if you update the field in the associated Features content type definitions, or if you'll also need to include a hook_updateN function.

Comments

troynt’s picture

Status: Active » Closed (fixed)
seanberto’s picture

Troy does this "just work" if you change the feature definition in code or does it require a DB migration on existing installs?

seanberto’s picture

Status: Closed (fixed) » Needs review
troynt’s picture

Assigned: troynt » seanberto

So I changed all the feature content field_sidebar definitions from 600 to 3000 ( will effect new installs )

Then I added a update function to correct it for current installs.

/**
 * Increased "sidebar content" field character limit restriction (from 600 characters to 3000 characters)
 * See http://drupal.org/node/1022324
 */
function wn_common_update_6002( &$sandbox ) {
  //update the description
  $result = db_query("SELECT * FROM {content_node_field_instance} WHERE field_name = 'field_sidebar'");
  while ($field = db_fetch_array($result)) {
    $field['description'] = str_replace('600','3000',$field['description']);
    db_query("UPDATE {content_node_field_instance} SET description='%s' WHERE field_name='%s' AND type_name='%s'", $field['description'], $field['field_name'], $field['type_name']);
  }

  //increase the maxlength from 600 to 3000
  $result = db_query("SELECT * FROM {content_node_field} WHERE field_name = 'field_sidebar'");
  while ($field = db_fetch_array($result)) {
    $new_settings = unserialize($field['global_settings']);
    $new_settings['max_length'] = 3000;
    db_query("UPDATE {content_node_field} SET global_settings='%s' WHERE field_name='field_sidebar'", serialize($new_settings));
  }

  return array(); //return empty array so Drupal does not throw errors
}
seanberto’s picture

Assigned: seanberto » troynt

Have you tested this on an already installed copy?

troynt’s picture

Assigned: troynt » seanberto

Yes, it worked.

seanberto’s picture

Status: Needs review » Closed (fixed)