Yii Framework Forum: Strange Difference In Beforefind Between Dev And Prod - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Strange Difference In Beforefind Between Dev And Prod Php version issue? Rate Topic: -----

#1 User is offline   krs3 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-January 11

Posted 26 July 2013 - 11:15 AM

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(){
		
		parent::beforeFind();
		$controller=Yii::app()->getController();
		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;
	 
			 $this->dbCriteria->mergeWith($criteria);
		}

	}


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
0

#2 User is offline   krs3 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-January 11

Posted 26 July 2013 - 12:06 PM

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 ?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users