Re: Upgrade to Cake 1.2.1 stable problems

2009-02-01 Thread Mathew

Yes, its dynamic.

It seems that in the 1.2 stable that HABTM for a model will always
create a default model for the join table unless the join table is
listed first in the uses for the controller.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Upgrade to Cake 1.2.1 stable problems

2009-01-31 Thread Mathew

Hi,

I was running Cake 1.2.0.7692 RC3 with a model that has a $belongsTo
from the PortfolioTag table to the Portfolio table. I could run this
Find statement.

$count = $this-$documentsTagsModel-find('count',array
('conditions'=array('tag_id'=$tagRecord
['id'],'published'=1,'front_page'=1),'recursive'=2));

And it out generate this SQL statement.

SELECT COUNT(*) AS `count` FROM `portfolio_tags` AS `PortfolioTag`
LEFT JOIN `portfolio` AS `Portfolio` ON (`PortfolioTag`.`portfolio_id`
= `Portfolio`.`id`) LEFT JOIN `tags` AS `Tag` ON
(`PortfolioTag`.`tag_id` = `Tag`.`id`) WHERE `tag_id` = 1 AND
`published` = 1 AND `front_page` = 1

After upgrading to Cake 1.2.1 Stable the same Find generates this SQL
statement which missing the LEFT JOIN so it fails.

SELECT COUNT(*) AS `count` FROM `portfolio_tags` AS `PortfolioTag`
WHERE `tag_id` = 7 AND `published` = 1 AND `front_page` = 1

How do I fix this?

Changing the recursive value for the find doesn't seem to fix the
problem.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Upgrade to Cake 1.2.1 stable problems

2009-01-31 Thread Mathew

Looks like they have changed HABTM so that it calls new AppModel for
the join table. Even if a model exists that is of the same name as the
join table. So if I list the HABTM table and the join table in my uses
for the controller, then it will not load the associations for the
join model.

Is this a bug?

I might be able to work around this by renaming my join model to
something else, but then it no longer follows the Cake naming
convention.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Upgrade to Cake 1.2.1 stable problems

2009-01-31 Thread Miles J

Why is there a dollar sign before the model? Are you calling a model
dynamically? $this-$documentsTagsModel?

On Jan 31, 12:40 pm, Mathew nfoscar...@yahoo.com wrote:
 Looks like they have changed HABTM so that it calls new AppModel for
 the join table. Even if a model exists that is of the same name as the
 join table. So if I list the HABTM table and the join table in my uses
 for the controller, then it will not load the associations for the
 join model.

 Is this a bug?

 I might be able to work around this by renaming my join model to
 something else, but then it no longer follows the Cake naming
 convention.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---