Commit 4b68f9af authored by catch's avatar catch

Issue #2255369 by larowlan, Xano: DialogController does not respect ['#title'] for the page title.

parent 209ef5e8
......@@ -93,7 +93,7 @@ public function dialog(Request $request, $_content, $modal = FALSE) {
}
$content = drupal_render($page_content);
$title = $this->titleResolver->getTitle($request, $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT));
$title = isset($page_content['#title']) ? $page_content['#title'] : $this->titleResolver->getTitle($request, $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT));
$response = new AjaxResponse();
// Fetch any modal options passed in from data-dialog-options.
$options = $request->request->get('dialogOptions', array());
......
......@@ -95,6 +95,7 @@ function ajax_test_error() {
function ajax_test_dialog_contents() {
// This is a regular render array; the keys do not have special meaning.
$content = array(
'#title' => 'AJAX Dialog contents',
'content' => array(
'#markup' => 'Example message',
),
......
ajax_test.dialog_contents:
path: '/ajax-test/dialog-contents'
defaults:
_title: 'AJAX Dialog contents'
_title: 'AJAX Dialog contents routing'
_content: '\Drupal\ajax_test\Controller\AjaxTestController::dialogContents'
requirements:
_access: 'TRUE'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment