You are here

protected function WebformAjaxFormTrait::missingAjaxCallback in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Form/WebformAjaxFormTrait.php \Drupal\webform\Form\WebformAjaxFormTrait::missingAjaxCallback()

Handle missing Ajax callback.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

2 calls to WebformAjaxFormTrait::missingAjaxCallback()
WebformAjaxFormTrait::validateAjaxForm in src/Form/WebformAjaxFormTrait.php
Validate form #ajax callback.
WebformSubmissionForm::validateAjaxForm in src/WebformSubmissionForm.php
Validate form #ajax callback.

File

src/Form/WebformAjaxFormTrait.php, line 281

Class

WebformAjaxFormTrait
Trait for webform ajax support.

Namespace

Drupal\webform\Form

Code

protected function missingAjaxCallback(array &$form, FormStateInterface $form_state) {
  $command = new WebformConfirmReloadCommand($this
    ->t('We are unable to complete the current request.') . PHP_EOL . PHP_EOL . $this
    ->t('Do you want to reload the current page?'));
  print Json::encode([
    $command
      ->render(),
  ]);
  exit;
}