You are here

public function PageWizardBase::submitVariantStep in Page Manager 8.4

Same name and namespace in other branches
  1. 8 page_manager_ui/src/Wizard/PageWizardBase.php \Drupal\page_manager_ui\Wizard\PageWizardBase::submitVariantStep()

Submission callback for the variant plugin steps.

File

page_manager_ui/src/Wizard/PageWizardBase.php, line 82

Class

PageWizardBase

Namespace

Drupal\page_manager_ui\Wizard

Code

public function submitVariantStep(array &$form, FormStateInterface $form_state) {
  $cached_values = $form_state
    ->getTemporaryValue('wizard');

  /** @var \Drupal\page_manager\PageVariantInterface $page_variant */
  $page_variant = $cached_values['page_variant'];

  /** @var \Drupal\Core\Display\VariantInterface $plugin */
  $plugin = $cached_values['plugin'];

  // Make sure the variant plugin on the page variant gets the configuration
  // from the 'plugin' which should have been setup by the variant's steps.
  if (!empty($plugin) && !empty($page_variant)) {
    $page_variant
      ->getVariantPlugin()
      ->setConfiguration($plugin
      ->getConfiguration());
  }
}