You are here

function custom_breadcrumbs_features_modules_installed in Custom Breadcrumbs Features 7.2

Implements hook_modules_installed().

Add machine_name field in newly installed breadcrumb tables.

File

./custom_breadcrumbs_features.install, line 37
Install file for custom_breadcrumbs_features.

Code

function custom_breadcrumbs_features_modules_installed($modules) {
  $cb_types = _custom_breadcrumbs_features_get_types();
  foreach ($cb_types as $table => $cb_type) {

    // Keep only modules newly installed.
    if (in_array($cb_type['module'], $modules) && !db_field_exists($table, 'machine_name')) {

      // Add field machine_name.
      $schema = drupal_get_schema($table);
      db_add_field($table, 'machine_name', $schema['fields']['machine_name']);
      db_add_unique_key($table, 'machine_name', $schema['unique keys']['machine_name']);
    }
  }
}