Strange Difference In Beforefind Between Dev And Prod

I’ve hit a problem which has me stumped on deploying a project;

I have a LEFT JOIN which is applied to all queries in a certain context (see bottom of post) it works perfectly in my dev environment (Vagrant VM running Ubuntu / Nginx Php5-fpm 5.3.10 ) but on my production server (Debian / Nginx Php5-fpm 5.4.10) although the beforeFind function is called the JOIN isn’t added onto the query.

Both machines running Yii 1.1.13

public function beforeFind(){




		if(isset($controller->domain) && $controller->domain != false){

			 $criteria = new CDbCriteria;

			 $criteria->join='LEFT JOIN articles_sites ON id=articles_sites.article_id';

			 $criteria->condition='articles_sites.site_id='. $controller->domain;





Dev server - Ubuntu 12.04 LTS , Php 5.3.10-1ubuntu3.5

Prod server - Debian 6.0.6 , Php 5.4.10-1~dotdeb.0

Not sure why but moving parent::beforeFind(); to the end of the function sorted it, must be a difference between Php 5.3 and 5.4 ?