By alexpott on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.3.x
Introduced in version:
10.3.0
Issue links:
Description:
\Drupal\Core\Render\MainContent\DialogRenderer::getTitleAsStringable() has been added to make it simple for classes that extend \Drupal\Core\Render\MainContent\DialogRenderer to render the title from the main content array or the current route match simpler.
Also if an array is passed to \Drupal\Core\Ajax\OpenDialogCommand::__construct() or \Drupal\Core\Ajax\OpenOffCanvasDialogCommand::__construct() an exception will be triggered. Prior to 10.3.x this would produce a PHP warning and the title would be set to Array
Impacts:
Module developers
Comments
Previously I was overriding
Previously I was overriding the title with of an off-canvas dialog like this:
This approach is broken after this change, because by the time
$this->titleResolver->getTitle($request, $route_match->getRouteObject())returns a result it already is a string. And the string primitive does not have arender()method.What is the new way of overriding the title of an off-canvas dialog?