function block_update_8004

Rename default menu names.

Related topics

File

drupal/core/modules/block/block.install, line 333
Install, update and uninstall functions for the block module.

Code

function block_update_8004() {

  // System menu's new block deltas are prefixed with 'menu-'.
  $map = array(
    'navigation' => 'menu-tools',
    'management' => 'menu-admin',
    'user-menu' => 'menu-account',
    'main-menu' => 'menu-main',
  );
  foreach ($map as $old => $new) {
    db_update('block')
      ->condition('module', 'system')
      ->condition('delta', $old)
      ->fields(array(
      'delta' => $new,
    ))
      ->execute();
    db_update('block_language')
      ->condition('module', 'system')
      ->condition('delta', $old)
      ->fields(array(
      'delta' => $new,
    ))
      ->execute();
    db_update('block_role')
      ->condition('module', 'system')
      ->condition('delta', $old)
      ->fields(array(
      'delta' => $new,
    ))
      ->execute();
  }
}