From eccc2b1bdd0528e4138e9c8b5e0dfacff78983ca Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Thu, 29 Jun 2017 21:34:20 +0200 Subject: [PATCH] MERGE: Bringing the ValidationGroup feature back to work. - ugly: they get extracted from options, as I do not see any other possibility --- Classes/Validation/Validator/SettingsValidator.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Classes/Validation/Validator/SettingsValidator.php b/Classes/Validation/Validator/SettingsValidator.php index 9ba1929..3752ed7 100644 --- a/Classes/Validation/Validator/SettingsValidator.php +++ b/Classes/Validation/Validator/SettingsValidator.php @@ -133,6 +133,7 @@ class SettingsValidator extends AbstractValidator if (is_null($validation)) { continue; } + $this->extractValidationGroupsFromOptions($newValidation); $newValidation['options'] = $validation; $newValidation['validator'] = $validator; $config[] = $newValidation; @@ -144,6 +145,7 @@ class SettingsValidator extends AbstractValidator if (is_null($options)) { continue; } + $this->extractValidationGroupsFromOptions($options); $newValidation['property'] = $propertyName; $newValidation['validator'] = $validator; $newValidation['options'] = $options; @@ -182,4 +184,15 @@ class SettingsValidator extends AbstractValidator $validatorConfig['options']['validationGroups'] = $this->options['validationGroups']; } } + + /** + * @param $newValidation + */ + protected function extractValidationGroupsFromOptions(&$newValidation) + { + if (isset($newValidation['options']['validationGroups'])) { + $newValidation['validationGroups'] = $newValidation['options']['validationGroups']; + unset($newValidation['options']['validationGroups']); + } + } }