\Drupal\Core\Controller\DialogController does not take the #title property into account that may be returned by the route's content controller. This results in situations like the one in the image below, where the route title is used as the modal's title, instead of the title that the controller returned.
Only local images are allowed.

Comments

xano’s picture

Status: Active » Needs review
StatusFileSize
new880 bytes
new48.84 KB

Err, this screenshot.

xano’s picture

StatusFileSize
new48.84 KB

Silly the filename contains spaces, so I won't display your image bug and lack of a preview option.

larowlan’s picture

Can we add to the existing tests?

dawehner’s picture

Issue tags: +Needs tests

It would be nice to have some tests, otherwise +1

larowlan’s picture

hoping for red/green

The last submitted patch, 5: dialog-title-2255369.fail_.patch, failed testing.

tstoeckler’s picture

Hmm... It seems like the test is losing test coverage for the title resolver stuff. Can we test both?

larowlan’s picture

There are other tests for title resolver, eg the form and entity form dialogs

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

I do agree with larowlan, see the following test code.

    $modal_expected_response = array(
      'command' => 'openDialog',
      'selector' => '#drupal-modal',
      'settings' => NULL,
      'data' => $dialog_contents,
      'dialogOptions' => array(
        'modal' => TRUE,
        'title' => 'AJAX Dialog contents',
      ),
    );
    $form_expected_response = array(
      'command' => 'openDialog',
      'selector' => '#drupal-modal',
      'settings' => NULL,
      'dialogOptions' => array(
        'modal' => TRUE,
        'title' => 'Ajax Form contents',
      ),
    );

  • Commit 4b68f9a on 8.x by catch:
    Issue #2255369 by larowlan, Xano: DialogController does not respect ['#...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.