You are here

function field_weight_field_collection_requirements in Field display weights (per node) 7.2

Implements hook_enable().

File

modules/field_weight_field_collection.install, line 86

Code

function field_weight_field_collection_requirements($phase) {
  $t = get_t();
  switch ($phase) {
    case 'install':
      $requirement = array(
        'field_weight_field_collection' => array(
          'title' => $t('Field collection item weights is not migrated yet'),
          'description' => $t('This module has been superseded by Multiple-Value Field Weights (field_weight_multiple) and will not be enabled.'),
          'severity' => REQUIREMENT_ERROR,
        ),
      );

      // Don't interfere if they have not migrated yet.
      if (module_exists('field_weight_field_collection') && (int) drupal_get_installed_schema_version('field_weight_field_collection') < 7201) {
        return array();
      }
      return $requirement;
  }
  return array();
}