/** @var \Drupal\views_ui\ViewUI $view */
$view =
$this->entity;
$display_id =
$this->displayID;
// Do not allow the form to be cached, because $form_state->get('view') can become
// stale between page requests.
// See views_ui_ajax_get_form() for how this affects #ajax.
// @todo To remove this and allow the form to be cacheable:
// - Change $form_state->get('view') to $form_state->getTemporary()['view'].
// - Add a #process function to initialize $form_state->getTemporary()['view']
// on cached form submissions.
// - Use \Drupal\Core\Form\FormStateInterface::loadInclude().
$form_state->
disableCache();
if ($display_id) { if (!
$view->
getExecutable()->
setDisplay($display_id)) { $form['#markup'
] =
$this->
t('Invalid display id @display',
['@display' =>
$display_id]);
return $form;
} } $form['#tree'
] = TRUE;
$form['#attached'
]['library'
][] = 'core/drupal.dialog.ajax';