diff -u b/core/lib/Drupal/Core/Render/CacheableMetadataAwareUrlGenerator.php b/core/lib/Drupal/Core/Render/CacheableMetadataAwareUrlGenerator.php --- b/core/lib/Drupal/Core/Render/CacheableMetadataAwareUrlGenerator.php +++ b/core/lib/Drupal/Core/Render/CacheableMetadataAwareUrlGenerator.php @@ -83,12 +83,13 @@ $this->renderer->render($build); } else { - $request_policy = \Drupal::service('page_cache_request_policy'); - $request = \Drupal::requestStack()->getCurrentRequest(); - $request_is_cacheable = $request_policy->check($request) === RequestPolicyInterface::ALLOW; - if ($request_is_cacheable) { - throw new \LogicException('A generated URL affects cacheability, but has no render context into which to add that information.'); - } + // @todo + //$request_policy = \Drupal::service('page_cache_request_policy'); + //$request = \Drupal::requestStack()->getCurrentRequest(); + //$request_is_cacheable = $request_policy->check($request) === RequestPolicyInterface::ALLOW; + //if ($request_is_cacheable) { + // throw new \LogicException('A generated URL affects cacheability, but has no render context into which to add that information.'); + //} } } } diff -u b/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php --- b/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1475,7 +1475,7 @@ } if ($path instanceof Url) { - $path = $path->toString(); + $path = $path->toString(TRUE)->getGeneratedUrl(); } $verbose = 'GET request to: ' . $path .