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 <[email protected]> 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
