You are here

function content_profile_update_6004 in Content Profile 6

Due to an old bug it may be that the $settings of a content type are '0'. As it should be an array this generates errors. This update fixes up those scrambled settings.

File

./content_profile.install, line 128
Content profile installation file.

Code

function content_profile_update_6004() {
  $ret = array();
  drupal_load('module', 'content_profile');
  foreach (node_get_types('names') as $type => $type_name) {
    $settings = variable_get('content_profile_' . $type, array());
    if (!is_array($settings)) {
      content_profile_set_settings($type, array());
    }
  }
  return $ret;
}