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

8.0.x
Nathaniel Catchpole 2014-02-28 10:08:39 +00:00
parent 31dbc6a137
commit 18ed8b32eb
2 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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.');
}
}