/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $context_config = ContextConfig::create(); foreach ($form_state->getValue('context') as $context_name => $value) { if ($form_state->get("context_{$context_name}") == 'selector') { $context_config->map($context_name, $value['setting']); } else { $context_config->setValue($context_name, $value['setting']); } } $configuration = $context_config->toArray(); $configuration['action_id'] = $form_state->getValue('action'); $this->actionExpression->setConfiguration($configuration); }
/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { // Nothing todo as long as the first step is not completed. if (!$form_state->get('action_id')) { return; } $context_config = ContextConfig::create(); foreach ($form_state->getValue('context') as $context_name => $value) { if ($form_state->get("context_{$context_name}") == 'selector') { $context_config->map($context_name, $value['setting']); } else { $context_config->setValue($context_name, $value['setting']); } } $configuration = $context_config->toArray(); $configuration['action_id'] = $form_state->get('action_id'); $this->actionExpression->setConfiguration($configuration); }