On 14 abr, 19:24, Sam DeVore <[EMAIL PROTECTED]> wrote:
> My guess is that it is related to the fact that php is loosely typed
> and the ambiguity in something like '0'

It looks like that cakephp is checking if $model->id is false to check
if it has an id or not during save operation (if it do not has an id
set, it is a new db item)

The problem is that it has an id: '0' that is an string, so if you
check something like

if ($model->id){
      // It has an id
} else {
      // It don't has an id
}

it will do like it do not has an id and would assume that is a new
item, when it try to insert a new item, it will fail as id = '0'
already exists there.

So this probably is a cake php bug correct?

/Erico


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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