solved with  'counterCache' => TRUE

El jueves, 4 de octubre de 2012 01:39:51 UTC+2, Juan Ezquerro LLanes 
escribió:
>
> I read 
> http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html#using-containable
>
> Where say:
>
> "ContainableBehavior can sometimes cause issues with other behaviors or 
> queries that use aggregate functions and/or GROUP BY statements. If you get 
> invalid SQL errors due to mixing of aggregate and non-aggregate fields, try 
> disabling the autoFields setting.:
>
> <?php
> $this->Post->Behaviors->attach('Containable', array('autoFields' => 
> false));"
>
> But i do:
>
>         $this->AllowedDomain->Behaviors->load('Containable', 
> array('autoFields' => false));
>
>         $this->paginate = array(
>             'conditions' => array('AllowedDomain.client_id' => 
> $this->Session->read('Auth.User.Client.id')),
>             'fields' => array('id', 'domain'),
>             'contain' => array('SecureScan' => array('fields' => 
> 'COUNT(id) AS urls'))
>         );
>
> And always crash, can help please?
>

-- 
Like Us on FacekBook 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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to