Wednesday, March 21, 2012

Bug with paginateCount in Cake 2.1

I think I've found a bug in Cake 2.1 with internal paginateCount.

I'm doing pagination with manually binding model:

$this->Topic->bindModel(array('hasOne'=>array('CategoriesTopic')));
$contain['CategoriesTopic']=array();
$conditions[]=array('CategoriesTopic.category_id'=>$cat);

The main paginate query build is ok, but internal count query is wrong, without hasOne association join, but with condition on CategoriesTopic.category_id. So it produces error:

Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'CategoriesTopic.category_id' in 'where clause'

Any workaround?

Thanks,
Sergei.


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate