Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

$modelObj->save() fails if $model is new and has its primary key set

#96

Manually setting a value for the primary key on a new model object means that $modelObj->save() will perform an update instead of an insert even if $modelObj has never been saved to the DB. Models probably need to keep a protected flag about whether they've been saved or not instead.

Reported by Joshua Paine · April 21st, 2009 @ 03:12 PM

State: open
Milestone: 0.30
Assigned to: Kris Jordan Kris Jordan

Activity

  1. Kris Jordan
    Kris Jordan
    • State changed from new to open
    • Milestone changed from 0.20 to 0.30

    Moving this to 0.3 as it is model related and is related to the fix for cascading the delete of graph of rows in the correct order. Would love to see the fix for this be something that happens last minute (like adding a SELECT 1 AS _exists) and during PDO's retrieval.

    June 9th, 2009 @ 02:36 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.