diff --git a/Classes/Package.php b/Classes/Package.php index c821e77..06276a7 100644 --- a/Classes/Package.php +++ b/Classes/Package.php @@ -1,16 +1,27 @@ registerConfigurationType( - 'Validation', + static::CONFIGURATION_TYPE_VALIDATION, ConfigurationManager::CONFIGURATION_PROCESSING_TYPE_DEFAULT, true ); diff --git a/Classes/Validation/Validator/SettingsValidator.php b/Classes/Validation/Validator/SettingsValidator.php index c94efff..4a87bd9 100644 --- a/Classes/Validation/Validator/SettingsValidator.php +++ b/Classes/Validation/Validator/SettingsValidator.php @@ -1,6 +1,16 @@ processConfiguration(Package::CONFIGURATION_TYPE_VALIDATION, + function (&$configuration) { + foreach ($configuration as $validatorName => &$validators) { + $newConfiguration = ['properties' => [], 'self' => []]; + + foreach ($validators as $key => &$validator) { + if (!isset($validator['validator']) || !isset($validator['options'])) { + $this->showWarning('The Validation.yaml files contained no validator or options for ' . + 'validation: "' . $validatorName . '.' . $key . '". It was not be migrated.'); + continue; + } + if (isset($validator['property'])) { + $newConfiguration['properties'][$validator['property']][$validator['validator']] + = $validator['options']; + } else { + $newConfiguration['self'][$validator['validator']] = $validator['options']; + } + } + $validators = $newConfiguration; + } + }, + true + ); + } +} diff --git a/composer.json b/composer.json index a3cd64d..65020c7 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,8 @@ "TYPO3.FluidAdaptor-20161130112935", "Neos.Media-20161219094126", "Neos.Flow-20170125103800", - "Neos.Flow-20170127183102" + "Neos.Flow-20170127183102", + "DigiComp.SettingValidator-20170603120900" ] } -} +} \ No newline at end of file