[TYPO3-mvc] Own property-validator not working on edit/update
Wolfgang Rock
Wolfgang.Rock at comnex.net
Wed Nov 16 21:03:22 CET 2011
Hi list,
I have a simple validator for one of my model-properties, which works well in the new/create action.
But in the edit form, the validator is ignored and the object is safed.
Core-extbase-validators like notEmpty keep working...
The validator looks like this:
class Tx_Asbfunk_Domain_Validator_KennzahlValidator extends Tx_Extbase_Validation_Validator_AbstractValidator {
/**
* @return bool
*/
public function isValid($value)
{
if(preg_match("/\d{2}-\d{3}/", $value)) {
return true;
} else {
$this->addError('Die eingegebene Kennzahl hat nicht das korrekte Format!', 12321559976);
return false;
}
}
}
I'm using it instead of core-regexp to customize the error-message.
TYPO3 4.6.0 with Extbase 1.4 with new property-mapper.
Any ideas?
Thanks and cheers,
Wolfgang
More information about the TYPO3-project-typo3v4mvc
mailing list