'required'=>true… the source of major confusion

In all the time I’ve been following cake on IRC (almost daily), it has become very clear that other than ACL and maybe Auth, ‘required’=>true in the model validation is the most confusing part of CakePHP for many people. On IRC it comes up, probably, once a week… even from people who’ve “been around”. And I can imagine that there are a lot of apps out there, where ‘required’=>true is used, without fully understanding as to what it really does. The problem is that people are quick to assume that ‘required’ means ‘notEmpty’. Even after pointing people to RTFM, they still come back confused as to the real meaning of ‘required’. Who cares, right? Well… we often hear a complain about save() failing (very often) without any apparent reason. The issue boils down to people having ‘required’=>true in the validation rules, while in reality they only wanted ‘rule’=>’notEmpty’. When first creating the Model such setup has no ill effects, because all fields are in the data array and the record can be successfully added and even edited (assuming some basic forms). Then at some point the app becomes a little more complex and people decide to save only a few …

'required'=>true… the source of major confusion

m4s0n501 In all the time I’ve been following cake on IRC (almost daily), it has become very clear that other than ACL and maybe Auth, ‘required’=>true in the model validation is the most confusing part of CakePHP for many people. On IRC it comes up, probably, once a week… even from people who’ve “been around”. And I can imagine that there are a lot of apps out there, where ‘required’=>true is used, without fully understanding as to what it really does. The problem is that people are quick to assume that ‘required’ means ‘notEmpty’. Even after pointing people to RTFM, they still come back confused as to the real meaning of ‘required’. Who cares, right? Well… we often hear a complain about save() failing (very often) without any apparent reason. The issue boils down to people having ‘required’=>true in the validation rules, while in reality they only wanted ‘rule’=>’notEmpty’. When first creating the Model such setup has no ill effects, because all fields are in the data array and the record can be successfully added and even edited (assuming some basic forms). Then at some point the app becomes a little more complex and people decide to save only …