Re: Empty array on Model::save bypasses validation

2012-05-28 Thread John
Oooops, stupid me, I had never run on that problem before so I didn't cross my mind it was THAT simple :-) Thanks On Monday, May 28, 2012 11:42:00 PM UTC+3, majna wrote: > > add 'required' =>true > > http://book.cakephp.org/2.0/en/models/data-validation.html#required > > On Monday, May 28, 2012

Re: Empty array on Model::save bypasses validation

2012-05-28 Thread majna
add 'required' =>true http://book.cakephp.org/2.0/en/models/data-validation.html#required On Monday, May 28, 2012 7:23:35 PM UTC+2, John wrote: > > Same on 2.1.3 > > I can "fix" it by checking for an empty array on model or controller but I > I guess this is not expected behavior, should I add a

Re: Empty array on Model::save bypasses validation

2012-05-28 Thread John
Same on 2.1.3 I can "fix" it by checking for an empty array on model or controller but I I guess this is not expected behavior, should I add a ticket on it? On Sunday, May 27, 2012 6:45:08 PM UTC+3, John wrote: > > On 2.1 if I do $this->Category->save($this->request->data) and $this- > >request

Empty array on Model::save bypasses validation

2012-05-27 Thread John
On 2.1 if I do $this->Category->save($this->request->data) and $this- >request->data is an empty array() model validation is bypassed and an "empty" record is saved. My model validation as baked: class Category extends AppModel { public $displayField = 'name'; public $validate = a