You are here

public function FlowForm::showVersionMismatches in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/FlowForm.php \Drupal\cms_content_sync\Form\FlowForm::showVersionMismatches()
  2. 2.1.x src/Form/FlowForm.php \Drupal\cms_content_sync\Form\FlowForm::showVersionMismatches()

Show version mismatches. We need to re-set the missing form state here so the form doesn't break when using this button.

Parameters

array $form:

File

src/Form/FlowForm.php, line 415

Class

FlowForm
Form handler for the Flow add and edit forms.

Namespace

Drupal\cms_content_sync\Form

Code

public function showVersionMismatches($form, FormStateInterface $form_state) {
  $trigger = $form_state
    ->getTriggeringElement();
  $type_key = $trigger['#entity_type'];
  $entity_bundle_name = $trigger['#bundle'];
  $this->triggeringType = $type_key;
  $this->triggeringBundle = $entity_bundle_name;
  $this->triggeredAction = 'enable';
  $this
    ->fixMissingFormStateFromAjax($form, $form_state);
  $form_state
    ->setValue([
    $type_key,
    $entity_bundle_name,
    'edit',
  ], '1');
  $form_state
    ->setValue([
    $type_key,
    $entity_bundle_name,
    'show-version-mismatches',
  ], '1');
  $form_state
    ->setRebuild();
}