commit dc653b4aa262043c2971f92cf8189184e0d87e4a Author: Matthew Radcliffe Date: Wed Mar 27 15:10:38 2013 -0400 Issue #1871700 by mradcliffe, podarok: Fix trailing whitespace at the end of comment. diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php index fb2a9de..d48fa05 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php @@ -10,7 +10,7 @@ /** * Tests upgrading a filled database with blocks. * - * Loads a standard installation of Drupal 7 and runs the upgrade process on + * Loads a standard installation of Drupal 7 and runs the upgrade process on * it. */ class BlockUpgradePathTest extends UpgradePathTestBase { commit 967d6026fab48e46007297b11ef2979250233a44 Author: Matthew Radcliffe Date: Wed Mar 27 15:13:45 2013 -0400 Issue #1871700 by mradcliffe: Change block mapping to be a bit better, but this does not solve system menu blocks or menu blocks. It also ignores contrib now. diff --git a/core/modules/block/block.install b/core/modules/block/block.install index 9c01bec..67114b5 100644 --- a/core/modules/block/block.install +++ b/core/modules/block/block.install @@ -62,55 +62,53 @@ function _update_8009_get_block_info() { $info = array( 'book' => array( 'navigation' => array( - 'id' => 'book_navigation', + 'plugin' => 'book_navigation', ), ), 'comment' => array( 'recent' => array( - 'id' => 'recent_comments', + 'plugin' => 'recent_comments', ), ), 'shortcut' => array( 'shortcuts' => array( - 'id' => 'shortcuts', + 'plugin' => 'shortcuts', ), ), 'system' => array( 'main' => array( - 'id' => 'system_main_block', + 'plugin' => 'system_main_block', ), 'help' => array( - 'id' => 'system_help_block', + 'plugin' => 'system_help_block', ), 'powered-by' => array( - 'id' => 'system_powered_by_block', + 'plugin' => 'system_powered_by_block', ), 'navigation' => array( - 'id' => 'system_menu_block', - 'new' => 'tools', + 'plugin' => 'system_menu_block:menu-tools', ), 'management' => array( - 'id' => 'system_menu_block', - 'new' => 'admin', + 'plugin' => 'system_menu_block:menu-admin', ), 'user-menu' => array( - 'id' => 'system_menu_block', - 'new' => 'account', + 'plugin' => 'system_menu_block:menu-account', ), 'main-menu' => array( - 'id' => 'system_menu_block', - 'new' => 'main', + 'plugin' => 'system_menu_block:menu-main', ), ), ); + /* $menus = menu_get_menus(FALSE); foreach ($menus as $menu_name => $label) { $info['menu'][$menu_name] = array( - 'id' => 'menu_menu_block', + 'plugin' => 'menu_menu_block:menu-' . $menu_name, ); } */ + return $info; } @@ -449,8 +447,8 @@ function block_update_8009() { foreach (array_keys($block_info[$block->module]) as $key) { if ($key == $block->delta) { - $plugin_id = $block_info[$block->module][$key]['id']; - $block->delta = isset($block_info[$block->module][$key]['new']) ? $block_info[$block->module][$key]['new'] : $block->delta; + $plugin_id = $block_info[$block->module][$key]['plugin']; + $settings = isset($block_info[$block->module][$key]['settings']) ? $block_info[$block->module][$key]['settings'] : array(); break; } } @@ -464,6 +462,7 @@ function block_update_8009() { else { // Fallback to consistent block plugin id: module, delta, block. $plugin_id = $block->module . '_' . str_replace('-', '_', $block->delta) . '_block'; + $settings = array(); } // @todo visibility @@ -476,7 +475,8 @@ function block_update_8009() { ->set('theme', $block->theme) ->set('region', $block->region) ->set('weight', $block->weight) - ->set('status', $block->status); + ->set('status', $block->status) + ->set('settings', $settings); $entity->save(); $sandbox['count'] += 1;