Cakephp: Router::$_urlFilters empty with route caching enabled

Created on 15 Jun 2018  路  3Comments  路  Source: cakephp/cakephp

This is a (multiple allowed):

  • [x] bug
  • [ ] enhancement
  • [ ] feature-discussion (RFC)

  • CakePHP Version: 3.6.5

What you did

Added a Router::addUrlFilter rule, this rule is a callable and is defined in my routes.php file.

What happened

When route cache is enabled in the RoutingMiddleware and routes are returned from cache the Router::$_urlFilters array is empty so the rule is never executed.

defect routing

Most helpful comment

If you put your URL filters in your application's bootstrap it should 'just work' :tm:

All 3 comments

You'll have to either move where you define your URL filters or not use route caching :smile:

Fair enough 馃槒

If you put your URL filters in your application's bootstrap it should 'just work' :tm:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

micdobro picture micdobro  路  3Comments

nrother picture nrother  路  3Comments

jorisvaesen picture jorisvaesen  路  3Comments

gtrias picture gtrias  路  4Comments

Code-Working picture Code-Working  路  3Comments