Commit 18ed8b32 authored by catch's avatar catch
Browse files

Issue #2200185 by BTMash, damiankloip: Router table is not cleared when modules are uninstalled.

parent 31dbc6a1
......@@ -759,6 +759,9 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
watchdog('system', '%module module uninstalled.', array('%module' => $module), WATCHDOG_INFO);
// Make sure any route data is also removed for this module.
\Drupal::service('router.dumper')->dump(array('provider' => $module));
drupal_get_installed_schema_version(NULL, TRUE);
......@@ -192,4 +192,13 @@ public function testControllerResolutionAjax() {
$this->assertRaw('abcde', 'Correct body was found.');
* Tests that routes no longer exist for a module that has been uninstalled.
public function testRouterUninstall() {
$route_count = \Drupal::database()->query('SELECT COUNT(*) FROM {router} WHERE provider = :provider', array(':provider' => 'router_test'))->fetchField();
$this->assertEqual(0, $route_count, 'All router_test routes have been removed on uninstall.');
Supports Markdown
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