Issue #2200185 by BTMash, damiankloip: Router table is not cleared when modules are uninstalled.
parent
31dbc6a137
commit
18ed8b32eb
|
@ -759,6 +759,9 @@ class ModuleHandler implements ModuleHandlerInterface {
|
|||
watchdog('system', '%module module uninstalled.', array('%module' => $module), WATCHDOG_INFO);
|
||||
|
||||
$schema_store->delete($module);
|
||||
|
||||
// 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 @@ class RouterTest extends WebTestBase {
|
|||
|
||||
$this->assertRaw('abcde', 'Correct body was found.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that routes no longer exist for a module that has been uninstalled.
|
||||
*/
|
||||
public function testRouterUninstall() {
|
||||
\Drupal::moduleHandler()->uninstall(array('router_test'));
|
||||
$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.');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue