I think the answer is in this part of code, this is the Domain model:
public function search()
// @todo Please modify the following code to remove attributes that should not be searched.
return new CActiveDataProvider($this, array(
// 'together' will force a left join, that's extra cost for searching in relations
$criteria->with = array('domain'=>array('together'=>true));
Just make sure that the ‘primary_url_id’ attribute is not limited to integers in the ‘search’ scenario. I know this looks strange but is it’s valid anyway.