Getting Blank Page With A Model Relation When Adding More To "on"

Hello,

I have this relation:


'image'=>array(self::HAS_ONE, 'Image', array('content_id' => 'id_place'), 'condition'=>"image.content_type='place' AND image.cover=1"),

That works but when I do a find with(‘image’) it will only show me results that DO have the image relations, the ones missing it will not appear because of the condition.

So I tried to change it to ON instead of condition, like this:


'image'=>array(self::HAS_ONE, 'Image', array('content_id' => 'id_place'), 'on'=>"image.content_type='place' AND image.cover=1"),

But with this configuration it just gives me a blank page with no errors.

Am I doing it right?

I am updating it:

The relation does work, but I forgot to check if $model->image was NULL before calling it, so that what was giving me the blank screen. The items that did not have the image relation were giving the error because I did not check it before calling it.