In my model I have this BelongsTo field, that I want to be compulsory:
'destination' => new Sprig_Field_BelongsTo(array(
'model'=>'Entity',
'column'=>'destination_id',
'empty' => false,
'rules'=>array('isId'=>array()))),
But my rule is not called, and I can select " -- None", even with explicit empty=false
I have checked the input() from Sprig_Field_BelongsTo class with FirePHP, in all belongsTo fields the empty becomes true. I tried to track where in the sprig code the options are being overwritten, but no luck...
Another issue is that I need to explicit the column option, since its trying to get the 'model_id' instead 'field_id' in database query (in my case entity_id instead of destination_id).
I'm using master branch HEAD here.
Thanks for your spent time ;)
In my model I have this BelongsTo field, that I want to be compulsory:
But my rule is not called, and I can select " -- None", even with explicit empty=false
I have checked the input() from Sprig_Field_BelongsTo class with FirePHP, in all belongsTo fields the empty becomes true. I tried to track where in the sprig code the options are being overwritten, but no luck...
Another issue is that I need to explicit the column option, since its trying to get the 'model_id' instead 'field_id' in database query (in my case entity_id instead of destination_id).
I'm using master branch HEAD here.
Thanks for your spent time ;)