public function ActionContainerForm::submitForm in Rules 8.3
Implements ExpressionFormInterface::submitForm().
Empty default implementation.
Overrides ExpressionFormTrait::submitForm
File
- src/
Form/ Expression/ ActionContainerForm.php, line 129
Class
- ActionContainerForm
- Form handler for action containers.
Namespace
Drupal\rules\Form\ExpressionCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getValue('actions', []);
if (empty($values)) {
// Core FormState::getValue() doesn't return the default parameter []
// when there are no values?
return;
}
$component = $this
->getRulesUiHandler()
->getComponent();
/** @var \Drupal\rules\Plugin\RulesExpression\RuleExpression $rule_expression */
$rule_expression = $component
->getExpression();
foreach ($values as $uuid => $expression) {
$action = $rule_expression
->getExpression($uuid);
$action
->setWeight($expression['weight']);
$action
->setConfiguration($action
->getConfiguration());
}
$this
->getRulesUiHandler()
->updateComponent($component);
}