Change record status: 
Project: 
Introduced in branch: 
10.3.x
Introduced in version: 
10.3.0
Description: 
  • Created a new AJAX method to open a URL in a dialog core/misc/dialog/dialog.ajax.js.
  • Created a new AJAX class to use this command \Drupal\Core\Ajax\OpenModalDialogWithUrl.

Usage
where $url is what we want to load in the modal dialog, and $settings is for passing dialog settings like width, dialogClass.

$response = new AjaxResponse();
$response->addCommand(new OpenModalDialogWithUrl($url->toString(), $settings));
return $response;

The command needs to be used when we want to load a specific URL in a modal dialog which differs from the existing command OpenModalDialogCommand which is used when we want to show some custom content in a modal dialog. To which we pass the title, content, and the options as parameters.

Impacts: 
Module developers
Themers
Site templates, recipes and distribution developers