Looks to me like your relationships may not be correct.

Can you post your hasMany/hasOne and belongsTo for each of the models
(User/Project/Topic) ?

On Jan 12, 9:45 pm, Sergei <yatse...@gmail.com> wrote:
> I think I found a bug in generated countercache query:
>
> UPDATE `projects` AS `Project` LEFT JOIN `users` AS `User` ON
> (`Project`.`project_id` = `User`.`id`) SET `Project`.`topic_count` = 4
> WHERE `Project`.`id` = 1
>
> You see, it makes useless and WRONG JOIN-condition with
> `Project`.`project_id`: such column doesn't exist!
> 1) wrong join - it doesn't have to be here
> 2) wrong join condition
>
> On Jan 12, 2:06 pm, Sergei <yatse...@gmail.com> wrote:
>
> > Hello,
>
> > using Cake 1.2 release,counterCachevariable seems to not working.
> > Counter field just is not updating.
>
> > I have model Topic:
>
> > var $belongsTo = array(
> > 'Project' => array('className' => 'Project',
> >         'foreignKey' => 'project_id',
> >         'conditions' => '',
> >         'fields' => '',
> >         'order' => '',
> >         'counterCache' => 'topic_count',
> >                 // OR 'counterCache' => true,
> > ),
>
> > And I have a field in Project model called "topic_count". Everything
> > looks okay but doesn't work.
>
> > Any ideas?
>
> > S.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to