core/core.services.yml | 2 +- core/includes/batch.inc | 2 +- core/includes/form.inc | 4 ++-- .../EarlyRenderingControllerWrapperSubscriber.php | 17 +++-------------- .../system/src/Controller/DbUpdateController.php | 8 ++++---- core/modules/system/system.routing.yml | 4 ---- 6 files changed, 11 insertions(+), 26 deletions(-) diff --git a/core/core.services.yml b/core/core.services.yml index bb90099..10ed704 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -1413,7 +1413,7 @@ services: arguments: ['@controller_resolver', '@theme.manager', '@plugin.manager.element_info', '@render_cache', '@request_stack', '%renderer.config%'] early_rendering_controller_wrapper_subscriber: class: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber - arguments: ['@controller_resolver', '@renderer', '@current_route_match'] + arguments: ['@controller_resolver', '@renderer'] tags: - { name: event_subscriber } email.validator: diff --git a/core/includes/batch.inc b/core/includes/batch.inc index 4e47471..7aa8ee7 100644 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@ -165,7 +165,7 @@ function _batch_progress_page() { $query_options['op'] = $new_op; $batch['url']->setOption('query', $query_options); - $url = $batch['url']->toString(); + $url = $batch['url']->toString(TRUE)->getGeneratedUrl(); $build = array( '#theme' => 'progress_bar', diff --git a/core/includes/form.inc b/core/includes/form.inc index 8170820..81c6406 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -810,7 +810,7 @@ function batch_process($redirect = NULL, Url $url = NULL, $redirect_callback = N $query_options['op'] = 'finished'; $error_url->setOption('query', $query_options); - $batch['error_message'] = t('Please continue to the error page', array('@error_url' => $error_url->toString())); + $batch['error_message'] = t('Please continue to the error page', array('@error_url' => $error_url->toString(TRUE)->getGeneratedUrl())); // Clear the way for the redirection to the batch processing page, by // saving and unsetting the 'destination', if there is any. @@ -840,7 +840,7 @@ function batch_process($redirect = NULL, Url $url = NULL, $redirect_callback = N $function($batch_url->toString(), ['query' => $query_options]); } else { - return new RedirectResponse($batch_url->setAbsolute()->toString()); + return new RedirectResponse($batch_url->setAbsolute()->toString(TRUE)->getGeneratedUrl()); } } else { diff --git a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php index b8cae4f..0acda56 100644 --- a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php @@ -75,26 +75,16 @@ class EarlyRenderingControllerWrapperSubscriber implements EventSubscriberInterf protected $renderer; /** - * The current route match object. - * - * @var \Drupal\Core\Routing\RouteMatchInterface - */ - protected $routeMatch; - - /** * Constructs a new EarlyRenderingControllerWrapperSubscriber instance. * * @param \Drupal\Core\Controller\ControllerResolverInterface $controller_resolver * The controller resolver. * @param \Drupal\Core\Render\RendererInterface $renderer * The renderer. - * @param \Drupal\Core\Routing\RouteMatchInterface - * The current route match object. */ - public function __construct(ControllerResolverInterface $controller_resolver, RendererInterface $renderer, RouteMatchInterface $route_match) { + public function __construct(ControllerResolverInterface $controller_resolver, RendererInterface $renderer) { $this->controllerResolver = $controller_resolver; $this->renderer = $renderer; - $this->routeMatch = $route_match; } /** @@ -141,9 +131,8 @@ protected function wrapControllerExecutionInRenderContext($controller, array $ar // If early rendering happened, i.e. if code in the controller called // drupal_render() outside of a render context, then the bubbleable metadata - // for that is stored in the current render context. If the current route is - // not cacheable we simply discard it. - if (!$context->isEmpty() && !$this->routeMatch->getRouteObject()->getOption('no_cache')) { + // for that is stored in the current render context. + if (!$context->isEmpty()) { /** @var \Drupal\Core\Render\BubbleableMetadata $early_rendering_bubbleable_metadata */ $early_rendering_bubbleable_metadata = $context->pop(); diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php index d207a42..a55ef02 100644 --- a/core/modules/system/src/Controller/DbUpdateController.php +++ b/core/modules/system/src/Controller/DbUpdateController.php @@ -220,7 +220,7 @@ protected function info() { $info[] = $this->t("Back up your code. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism."); $info[] = $this->t('Put your site into maintenance mode.', array( - '@url' => $this->url('system.site_maintenance_mode'), + '@url' => Url::fromRoute('system.site_maintenance_mode')->toString(TRUE)->getGeneratedUrl(), )); $info[] = $this->t('Back up your database. This process will change your database values and in case of emergency you may need to revert to a backup.'); $info[] = $this->t('Install your new files in the appropriate location, as described in the handbook.'); @@ -388,7 +388,7 @@ protected function results() { $dblog_exists = $this->moduleHandler->moduleExists('dblog'); if ($dblog_exists && $this->account->hasPermission('access site reports')) { $log_message = $this->t('All errors have been logged.', array( - '@url' => $this->url('dblog.overview'), + '@url' => Url::fromRoute('dblog.overview')->toString(TRUE)->getGeneratedUrl(), )); } else { @@ -396,7 +396,7 @@ protected function results() { } if (!empty($_SESSION['update_success'])) { - $message = '
' . $this->t('Updates were attempted. If you see no failures below, you may proceed happily back to your site. Otherwise, you may need to update your database manually.', array('@url' => $this->url('
' . $this->t('Updates were attempted. If you see no failures below, you may proceed happily back to your site. Otherwise, you may need to update your database manually.', array('@url' => Url::fromRoute('