Commit a62c75ed authored by catch's avatar catch
Browse files

Issue #1893372 by Crell: Move legacy flag for routes earlier in the process.

parent 7bfb63b9
...@@ -42,12 +42,6 @@ public function onKernelControllerLegacy(FilterControllerEvent $event) { ...@@ -42,12 +42,6 @@ public function onKernelControllerLegacy(FilterControllerEvent $event) {
// This BC logic applies only to functions. Otherwise, skip it. // This BC logic applies only to functions. Otherwise, skip it.
if (is_string($controller) && function_exists($controller)) { if (is_string($controller) && function_exists($controller)) {
// Flag this as a legacy request. We need to use this for subrequest
// handling so that we can treat older page callbacks and new routes
// differently.
// @todo Remove this line as soon as possible.
$request->attributes->set('_legacy', TRUE);
$new_controller = function() use ($router_item) { $new_controller = function() use ($router_item) {
return call_user_func_array($router_item['page_callback'], $router_item['page_arguments']); return call_user_func_array($router_item['page_callback'], $router_item['page_arguments']);
}; };
......
...@@ -111,6 +111,12 @@ public function matchRequest(Request $request) { ...@@ -111,6 +111,12 @@ public function matchRequest(Request $request) {
require_once DRUPAL_ROOT . '/' . $router_item['include_file']; require_once DRUPAL_ROOT . '/' . $router_item['include_file'];
} }
// Flag this as a legacy request. We need to use this for subrequest
// handling so that we can treat older page callbacks and new routes
// differently.
// @todo Remove this line as soon as possible.
$ret['_legacy'] = TRUE;
return $ret; return $ret;
} }
......
Markdown is supported
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