From 73b7dae00657c93fedf26398849eaf79d1d2c5c3 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 5 Sep 2011 11:47:28 -0700 Subject: Issue #1231856 follow-up by marcingy: Fixed menu_update_7001() breaks if block module disabled. --- modules/menu/menu.install | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'modules/menu') diff --git a/modules/menu/menu.install b/modules/menu/menu.install index 3b75ad436..a7e43379e 100644 --- a/modules/menu/menu.install +++ b/modules/menu/menu.install @@ -166,18 +166,21 @@ function menu_update_7001() { * Rename the primary/secondary menu blocks to match previously renamed menus. */ function menu_update_7002(&$sandbox) { - $renamed_deltas = array( - 'menu' => array( - 'primary-links' => 'main-menu', - 'secondary-links' => 'secondary-menu', - ), - ); + // Check for the presence of old or new table names. + if (db_table_exists('blocks') || db_table_exists('block')) { + $renamed_deltas = array( + 'menu' => array( + 'primary-links' => 'main-menu', + 'secondary-links' => 'secondary-menu', + ), + ); - $moved_deltas = array( - 'menu' => array('main-menu' => 'system'), - ); + $moved_deltas = array( + 'menu' => array('main-menu' => 'system'), + ); - update_fix_d7_block_deltas($sandbox, $renamed_deltas, $moved_deltas); + update_fix_d7_block_deltas($sandbox, $renamed_deltas, $moved_deltas); + } } /** * @} End of "defgroup updates-7.x-extra" -- cgit v1.2.3