function UpdateController::updateRedirect

Provides a redirect to update page.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: A route match object, used for the route name and the parameters.

\Symfony\Component\HttpFoundation\Request $request: The current request object.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse Returns redirect.

Deprecated

in drupal:10.2.0 and is removed from drupal:11.0.0. Use /admin/appearance/update directly instead of /admin/theme/update.

See also

https://www.drupal.org/node/3375850

1 string reference to 'UpdateController::updateRedirect'
update.routing.yml in core/modules/update/update.routing.yml
core/modules/update/update.routing.yml

File

core/modules/update/src/Controller/UpdateController.php, line 109

Class

UpdateController
Controller routines for update routes.

Namespace

Drupal\update\Controller

Code

public function updateRedirect(RouteMatchInterface $route_match, Request $request) : RedirectResponse {
    @trigger_error('The path /admin/theme/update is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use /admin/appearance/update. See https://www.drupal.org/node/3382805', E_USER_DEPRECATED);
    $helper = new PathChangedHelper($route_match, $request);
    $params = [
        '%old_path' => $helper->oldPath(),
        '%new_path' => $helper->newPath(),
        '%change_record' => 'https://www.drupal.org/node/3382805',
    ];
    $warning_message = $this->t('You have been redirected from %old_path. Update links, shortcuts, and bookmarks to use %new_path.', $params);
    $this->messenger()
        ->addWarning($warning_message);
    $this->getLogger('update')
        ->warning('A user was redirected from %old_path to %new_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.', $params);
    return $helper->redirect();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.