Bug #48093 » compositeValidatorSetValidatedInstancesContainerFix.patch

Tarcisio Fedrizzi, 2013-05-09 17:52

View differences:

Classes/TYPO3/Flow/Validation/Validator/AbstractCompositeValidator.php
96 96
	 * @api
97 97
	 */
98 98
	public function addValidator(\TYPO3\Flow\Validation\Validator\ValidatorInterface $validator) {
99
		if ($validator instanceof ObjectValidatorInterface) {
100
			$validator->setValidatedInstancesContainer = $this->validatedInstancesContainer;
101
		}
102 99
		$this->validators->attach($validator);
103 100
	}
104 101

  
......
145 142
	}
146 143
}
147 144

  
148
?>
145
?>
Classes/TYPO3/Flow/Validation/Validator/ConjunctionValidator.php
32 32
		if ($validators->count() > 0) {
33 33
			$result = NULL;
34 34
			foreach ($validators as $validator) {
35
				if ($validator instanceof ObjectValidatorInterface) {
36
					$validator->setValidatedInstancesContainer($this->validatedInstancesContainer);
37
				}
35 38
				if ($result === NULL) {
36 39
					$result = $validator->validate($value);
37 40
				} else {
......
46 49
	}
47 50
}
48 51

  
49
?>
52
?>
Classes/TYPO3/Flow/Validation/Validator/DisjunctionValidator.php
35 35
		if ($validators->count() > 0) {
36 36
			$result = NULL;
37 37
			foreach ($validators as $validator) {
38
				if ($validator instanceof ObjectValidatorInterface) {
39
					$validator->setValidatedInstancesContainer($this->validatedInstancesContainer);
40
				}
38 41
				$validatorResult = $validator->validate($value);
39 42
				if ($validatorResult->hasErrors()) {
40 43
					if ($result === NULL) {
......
59 62
	}
60 63
}
61 64

  
62
?>
65
?>
(1-1/3)