You are here

function custom_breadcrumbs_taxonomy_update_6000 in Custom Breadcrumbs 7.2

Same name and namespace in other branches
  1. 6.2 custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.install \custom_breadcrumbs_taxonomy_update_6000()

Implements hook_update_N().

Sets weight of custom_breadcrumbs_taxonomy to be greater than taxonomy, views, and custom_breadcrumbs.

File

custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.install, line 222
Install file for the custom_breadcrumbs_taxonomy module.

Code

function custom_breadcrumbs_taxonomy_update_6000() {
  $tax_weight = (int) db_query("SELECT weight FROM {system} WHERE name = :name", array(
    ':name' => 'taxonomy',
  ))
    ->fetchField();
  $views_weight = (int) db_query("SELECT weight FROM {system} WHERE name = :name", array(
    ':name' => 'views',
  ))
    ->fetchField();
  $cb_weight = (int) db_query("SELECT weight FROM {system} WHERE name = :name", array(
    ':name' => 'custom_breadcrumbs',
  ))
    ->fetchField();
  $cb_tax_weight = max($tax_weight, $views_weight, $cb_weight) + 2;
  db_update('system')
    ->fields(array(
    'weight' => $cb_tax_weight,
  ))
    ->condition('type', 'module')
    ->condition('name', 'custom_breadcrumbs_taxonomy')
    ->execute();
  return t('Adjusted the custom_ breadcrumbs_taxonomy module weight to be greater than custom_breadcrumbs, taxonomy and views.');
}