diff --git a/src/Form/PanelizerWizardGeneralForm.php b/src/Form/PanelizerWizardGeneralForm.php index 2ab513a..79096e6 100644 --- a/src/Form/PanelizerWizardGeneralForm.php +++ b/src/Form/PanelizerWizardGeneralForm.php @@ -9,7 +9,9 @@ namespace Drupal\panelizer\Form; use Drupal\Core\Form\FormBase; +use Drupal\Core\Form\FormState; use Drupal\Core\Form\FormStateInterface; +use Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant; /** * General settings for a panelized bundle. @@ -48,6 +50,11 @@ class PanelizerWizardGeneralForm extends FormBase { */ public function buildForm(array $form, FormStateInterface $form_state, $machine_name = NULL) { $this->machine_name = $machine_name; + $cached_values = $form_state->getTemporaryValue('wizard'); + /** @var \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $plugin */ + $plugin = $cached_values['plugin']; + $form['variant_settings'] = $plugin->buildConfigurationForm([], (new FormState())->setValues($form_state->getValue('variant_settings', []))); + $form['variant_settings']['#tree'] = TRUE; return $form; }