[TYPO3-mvc] updateAction ignores validation
Jonas Eberle
jonas.eberle at d-mind.de
Sat Sep 12 16:17:48 CEST 2015
Hi,
You should use @var and @validate annotations in your model. Clear system caches afterwards.
Good luck,
Jonas
-------- Original message --------
Subject: [TYPO3-mvc] updateAction ignores validation
From: ondro <ogrosko at gmail.com>
To: typo3-project-typo3v4mvc at lists.typo3.org
CC:
Hey
I stuck in one problem
I have classical actions in my app (newAction, createAction, updateAction, etc)
createAction looks like this:
public function createAction(\Some\Kind\Of\Domain\Model $model) {
[... logic of action]
}
model look like this:
/**
* title
*
* string
* NotEmpty
*/
protected $title = '';
/**
* start
*
* \DateTime
* NotEmpty, DateTime
*/
protected $start = NULL;
/**
* end
*
* \DateTime
* NotEmpty, DateTime
*/
protected $end = NULL;
If I run createAction whole validation runs properly
But if I run updateAction
public function updateAction(\Some\Kind\Of\Domain\Model $model) {
[... logic of action]
}
validation of model is absolutelly ignored. I can submit empty 'title, start, end' property and object is saved. Can you tell me why?
But if I fill start or end property validation of DateTime runs properly (that mean I got proper errorAction with DateTime validation results)
Debuging of that I lost 10years of my life. Can you help me.
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list