Cactivedataprovider, 'with' In Criteria Plus Pagination

Hi,

I came across a strange behaviour. I am creating an CActiveDataProvider with uses a few relations which are defined in the ‘criteria’ -> ‘with’ parameter. Now, when I set ‘pagination’ to false, it works, but if I set the pagination to array(‘pageSize’=>50,‘pageVar’=>‘page’), the created SQL statement does not work anymore.

working code:




        $articles = new CActiveDataProvider ('File',array(

                'criteria'=>array(

'with'=>array('member.accepted_experts.sub_sub_category.sub_category.category','member.accepted_experts.sub_sub_category.sub_category','member.accepted_experts.sub_sub_category','member.accepted_experts','member'),

                ),

                'pagination'=>false,                                   

            )       

        );  



broken code:




        $articles = new CActiveDataProvider ('File',array(

                'criteria'=>array(

'with'=>array('member.accepted_experts.sub_sub_category.sub_category.category','member.accepted_experts.sub_sub_category.sub_category','member.accepted_experts.sub_sub_category','member.accepted_experts','member'),

                ),

                'pagination'=>array('pageSize'=>50,'pageVar'=>'page'),                                        

            )       

        );  



The SQL error is "column not found" and the SQL statement shows only one "LEFT OUTER JOIN" to the "member" table, but not the other tables defined in "with".

So when pagination=false: the relational tables are loaded via LEFT OUTER JOIN, when the pagination is set, then the error occurs.

Any ideas? Thanks!