Tuesday, September 10, 2013

Pagination with i18n field condition (pagination + translation behavior error)

Why is this no working (throws a column not found) :

$conditions = array('OR' => array( 'I18n__title.content LIKE' => '%'.$searchKey.'%'));

$this->paginate = array(
                        'conditions' => $conditions
                    );

$results = $this->paginate();

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

While a normal find works fine: 
$this->MyModel->find('all',  array('conditions' => $conditions));



--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate