diff options
-rw-r--r-- | modules/simpletest/tests/upgrade/upgrade.test | 4 | ||||
-rw-r--r-- | modules/system/system.install | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test index 3d463c95f..4220faebb 100644 --- a/modules/simpletest/tests/upgrade/upgrade.test +++ b/modules/simpletest/tests/upgrade/upgrade.test @@ -381,5 +381,9 @@ class BasicUpgradePath extends UpgradePathTestCase { $this->assertText(t('Reports')); $this->assertText(t('Structure')); $this->assertText(t('Modules')); + + // Confirm that no {menu_links} entry exists for user/autocomplete. + $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField(); + $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete')); } } diff --git a/modules/system/system.install b/modules/system/system.install index eae01725f..9c9bc2d8c 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2863,6 +2863,19 @@ function system_update_7062() { } /** + * Delete {menu_links} records for 'type' => MENU_CALLBACK which would not appear in a fresh install. + */ +function system_update_7063() { + // For router items where 'type' => MENU_CALLBACK, {menu_router}.type is + // stored as 4 in Drupal 6, and 0 in Drupal 7. Fortunately Drupal 7 doesn't + // store any types as 4, so delete both. + $result = db_query('SELECT ml.mlid FROM {menu_links} ml INNER JOIN {menu_router} mr ON ml.router_path = mr.path WHERE ml.module = :system AND ml.customized = 0 AND mr.type IN(:callbacks)', array(':callbacks' => array(0, 4), ':system' => 'system')); + foreach ($result as $record) { + db_delete('menu_links')->condition('mlid', $record->mlid)->execute(); + } +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ |