You are here

function commerce_system_info_alter in Commerce Core 7

Implements hook_system_info_alter().

Drupal's Field module doesn't allow field type providing modules to be disabled while fields and instances of those types exist in the system. See http://drupal.org/node/943772 for further explanation.

That approach doesn't work for Commerce, creating circular dependencies and making uninstall impossible. This function removes the requirement, allowing Commerce to implement its own workaround.

See also

commerce_delete_field()

File

./commerce.module, line 69
Defines features and functions common to the Commerce modules.

Code

function commerce_system_info_alter(&$info, $file, $type) {
  $modules = array(
    'commerce_product_reference',
    'commerce_price',
    'commerce_customer',
    'commerce_line_item',
  );
  if ($type == 'module' && in_array($file->name, $modules)) {
    unset($info['required']);
    unset($info['explanation']);
  }
}