I had this error where I had set
var $primaryKey = 'ID';
in my model. Where as it was 'id' in the database. Setting it to
var $primaryKey = 'id';
resolved the issue.
Aurelius-2 wrote:
>
>
> It happens when Saving a Model!
>
> I've no beforeX-Filters, I also had debug($this-data) right before
> saving,
> but each Model (Accept the hasAndbelongToMany) have an id!
>
> thx
> Aurelius
>
> On 31 Mrz., 02:32, mscdex <[email protected]> wrote:
>> On Mar 30, 6:11 pm, Marcelo Andrade <[email protected]> wrote:
>>
>>
>>
>> > On Mon, Mar 30, 2009 at 6:44 PM, Aurelius <[email protected]>
>> wrote:
>>
>> > > What does that mean, and where is the problem?
>> > > Notice (8): Undefined index: id [CORE/cake/libs/model/model.php, line
>> > > 1281...on line 77
>>
>> > > That's line 77:
>> > > if ($this->User->save ( $this->data, true , array ( 'firstname',
>> > > 'lastname', '....' ))) {
>> > > ... }
>>
>> > > What's wrong?
>
--
View this message in context:
http://old.nabble.com/Notice-%288%29%3A-Undefined-index%3A-id--tp22793627p28470469.html
Sent from the CakePHP mailing list archive at Nabble.com.
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