Skip to content
Snippets Groups Projects
Commit 4b68f9af authored by catch's avatar catch
Browse files

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

parent 209ef5e8
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -93,7 +93,7 @@ public function dialog(Request $request, $_content, $modal = FALSE) { ...@@ -93,7 +93,7 @@ public function dialog(Request $request, $_content, $modal = FALSE) {
} }
$content = drupal_render($page_content); $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(); $response = new AjaxResponse();
// Fetch any modal options passed in from data-dialog-options. // Fetch any modal options passed in from data-dialog-options.
$options = $request->request->get('dialogOptions', array()); $options = $request->request->get('dialogOptions', array());
......
...@@ -95,6 +95,7 @@ function ajax_test_error() { ...@@ -95,6 +95,7 @@ function ajax_test_error() {
function ajax_test_dialog_contents() { function ajax_test_dialog_contents() {
// This is a regular render array; the keys do not have special meaning. // This is a regular render array; the keys do not have special meaning.
$content = array( $content = array(
'#title' => 'AJAX Dialog contents',
'content' => array( 'content' => array(
'#markup' => 'Example message', '#markup' => 'Example message',
), ),
......
ajax_test.dialog_contents: ajax_test.dialog_contents:
path: '/ajax-test/dialog-contents' path: '/ajax-test/dialog-contents'
defaults: defaults:
_title: 'AJAX Dialog contents' _title: 'AJAX Dialog contents routing'
_content: '\Drupal\ajax_test\Controller\AjaxTestController::dialogContents' _content: '\Drupal\ajax_test\Controller\AjaxTestController::dialogContents'
requirements: requirements:
_access: 'TRUE' _access: 'TRUE'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment