diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
index f1139fe..e765278 100644
--- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
@@ -270,7 +270,7 @@ public function getTasksBuild($current_route_name) {
         if ($access) {
           // Need to flag the list element as active for a tab for the current
           // route or if the plugin is set active (i.e. the parent tab).
-          $active = (($current_route_name == $route_name && (array_intersect_assoc($route_parameters, $this->request->attributes->all()) == $route_parameters)) || $child->getActive());
+          $active = (($current_route_name == $route_name && (array_intersect_assoc($route_parameters, $this->request->attributes->get('_raw_variables')->all()) == $route_parameters)) || $child->getActive());
           // @todo It might make sense to use menu link entities instead of
           //   arrays.
 
