You are here

function cck_blocks_update_6101 in CCK Blocks 6

Implementation of hook_update_N().

In previous versions, all fields were exposed as blocks. In this version, fields are not exposed by default, but can be added manually in the field configuration page. This update sets globabl preferences to retain the availability of all custom fields as blocks, to avoid confusing existing users.

File

./cck_blocks.install, line 20

Code

function cck_blocks_update_6101() {
  $ret = array();
  $fields = module_invoke('content', 'fields');
  if (count($fields)) {
    foreach ($fields as $field_name => $field_info) {
      variable_set('cck_blocks_' . $field_info['field_name'] . '_block_availability', 2);
    }
  }
  return $ret;
}