Commit 69e8ffed authored by webchick's avatar webchick

#932134 by catch: Fixed no upgrade path for MENU_CALLBACK API change.

parent 7faedbdd
......@@ -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'));
}
}
......@@ -2862,6 +2862,19 @@ function system_update_7062() {
db_add_index('system', 'system_list', array('status', 'bootstrap', 'type', 'weight', 'name'));
}
/**
* 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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment