Problem/Motivation

The route below, have admin_menu dependency, however admin_menu was didn't continued to D8, and the path '/token/flush-cache', show the error: Page not found

token.flush_cache:
  path: '/token/flush-cache'
  defaults:
    _controller: '\Drupal\token\Controller\TokenCacheController::flush'
  requirements:
    _permission: 'flush caches'
    _csrf_token: 'TRUE'
    _module_dependencies: 'admin_menu'

Comments

thalles created an issue. See original summary.

tr’s picture

Status: Needs work » Active

The module dependency was added by:

commit 12023333c32049ce7175f93b6db76c55efa57def
Author: Sascha Grossenbacher <saschagros@gmail.com>
Date:   Tue Feb 3 23:59:28 2015 +0100

    Remove dead code, no longer needed fixes and old hooks

There is no issue for this, so it's not clear why that module dependency was added or even if it was an intentional addition. It seems to be a convenience route for use only during development.

Note also that the "flush caches" permission was a permission defined by admin_menu, and if the module dependency is removed then this route can still not be used because the permission will never be available.

Right now, the route and the controller flush() method are unused and unusable. To fix this requires maintainer input as to whether they are needed/wanted anymore. If this is to remain in Token, then the flush() method should probably be exposed as a button on the system.performance_settings page and we probably don't need the route anymore.

tr’s picture

Title: The broken route » The broken route token.flush_cache