diff --git a/core/lib/Drupal/Core/Routing/RequestHelper.php b/core/lib/Drupal/Core/Routing/RequestHelper.php index b060e47..25138bb 100644 --- a/core/lib/Drupal/Core/Routing/RequestHelper.php +++ b/core/lib/Drupal/Core/Routing/RequestHelper.php @@ -49,6 +49,11 @@ class RequestHelper { */ public static function duplicate(Request $original_request, $uri, $method = 'GET', $parameters = array(), array $query = NULL, array $post = NULL, array $attributes = NULL, array $cookies = NULL, array $files = NULL, array $server = NULL) { $request = $original_request->duplicate($query, $post, $attributes, $cookies, $files, $server); + // Request::duplicate() clones the attributes, but we want to re-populate + // them from scratch when using this method. + if (empty($attributes)) { + $request->attributes->replace(array()); + } $server = array(); diff --git a/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php b/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php index f93cb6f..c3b3200 100644 --- a/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php +++ b/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php @@ -163,8 +163,8 @@ public function build(array $attributes) { // https://drupal.org/node/2076085. $title = str_replace(array('-', '_'), ' ', Unicode::ucfirst(end($path_elements))); } - // @todo Replace with a #type => link render element or use the link - // generator. + // @todo Replace with a #type => link render element so that the alter + // hook can work with the actual data. $links[] = l($title, $route_request->attributes->get('_system_path')); } }