if ($this->
isAjax()) { $form['actions'
]['submit'
]['#ajax'
]['callback'
] = '::ajaxSubmit';
// @todo static::ajaxSubmit() requires data-drupal-selector to be the same
// between the various Ajax requests. A bug in
// \Drupal\Core\Form\FormBuilder prevents that from happening unless
// $form['#id'] is also the same. Normally, #id is set to a unique HTML
// ID via Html::getUniqueId(), but here we bypass that in order to work
// around the data-drupal-selector bug. This is okay so long as we
// assume that this form only ever occurs once on a page. Remove this
// workaround in https://www.drupal.org/node/2897377.
$form['#id'
] = Html::
getId($form_state->
getBuildInfo()['form_id'
]);
} // Mark this as an administrative page for JavaScript ("Back to site" link).
$form['#attached'
]['drupalSettings'
]['path'
]['currentPathIsAdmin'
] = TRUE;
return $form;
} /**
* Returns the label for the submit button.
*
* @return string
* Submit label.
*/