Actions
Bug #66335
closedCan not pass options to a Domain Model Validator
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-04-09
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:
Description
In the method \TYPO3\CMS\Extbase\Validation\ValidatorResolver::addCustomValidators the corresponding Validator (based on the model name) instance is created without any options passed to it:
protected function addCustomValidators($targetClassName, ConjunctionValidator &$conjunctionValidator) { $addedValidatorClassName = NULL; // @todo: get rid of ClassNamingUtility usage once we dropped underscored class name support $possibleValidatorClassName = ClassNamingUtility::translateModelNameToValidatorName($targetClassName); $customValidator = $this->createValidator($possibleValidatorClassName); if ($customValidator !== NULL) { $conjunctionValidator->addValidator($customValidator); $addedValidatorClassName = get_class($customValidator); } // @todo: find polytype validator for class }
So if we have a such Validator with some required options - the exception \TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationOptionsException with code:1379981891 will be throwed while constructing the validator (if it extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator of course).
Now the only way to avoid this, is to give some specific name to the Validator and assign it manually in the Controller.
Maybe, if there is no obvious way how to construct the Validator with an options - this method should be removed, since it doesn't provide enough flexibility, as manual assignment does?
Actions