Hello everybody!

After a whole day trying to make my application work correctly, asking for
help on IRC and some friends, I concluded that I found a bug in polymorphic
Behaviour.

My Scenario:

The Picture is my Polymorphic Model:
Picture model: http://bin.cakephp.org/view/1085677267

Family hasOne Banner (Banner is an alias to Picture that is polymorphic)
Family hasOne icon (Icon is an alias to Picture that is polymorphic)
Family model: http://bin.cakephp.org/view/2133641829
Family controller: http://bin.cakephp.org/view/827099383
Family add_view: http://bin.cakephp.org/view/478488471
Family edit_view: http://bin.cakephp.org/view/751543170

When I add a Family I Can add a Banner or Icon or Both relationed too. This
is working great, the picture is uploaded and the records are saved in the
pictures table.

When I delete a Family, the Banner or the Icon or Both Should be deleted
from table (Pictures) and files Should Be unliked. This is working great
too.

The problem is when I'm editing Family. I tried many ways to get it working
with find(), read() at BeforeSave () afterSave(), but i can not get it.

This is the debug on beforeSave (When Works)
http://bin.cakephp.org/view/2145699735

This is the debug on beforeSave (When Bug)
http://bin.cakephp.org/view/135653162

Please Note that when it fail, the ID is THE SAME for both (here is the bug)
Banner and Icon, array looks mixed up (both Have type => icon)

Sometimes, the Behaviour Appears to be mixing arrays when updating both
(Icon and Banner) .. But sometimes work.. looks random.

It's the Behaviour? Or I'm missing something?

Thanks in advance


Att,

Henrique Machado
TI Expert

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to