Yii Framework Forum: findall bug since 2012? - Yii Framework Forum

Jump to content

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

findall bug since 2012? Rate Topic: -----

#1 User is offline   ralphwigum 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-November 14

Posted 05 April 2018 - 08:40 AM

Hi!

I was trying to do a right join in a findAll and I get 0 results. Using the YiiDegubToolbar, Copying the SQL generated and paste into my Oracle DataBase I get 3 results. This has no sense.

I founded this
https://code.google....yii/issues/3222

If Yii 1.1.19 (latest), If I change CActiveFinder.php line 824

if(isset($row[$this->_pkAlias]))


to

if(isset($row[$this->_pkAlias]) || is_null($row[$this->_pkAlias]))


it "works" relative.


This is the code that I run:

$model = User::model()->with(array('idOrgs'=>array("joinType"=>"RIGHT JOIN")))->findAll();


relation:

'idOrgs' => array(self::HAS_MANY, 'Organizations', array('ID_ORGS' => 'ID_USER_ORGS')),



Thanks and regards!
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