I have a model definition where I override the primaryKey as follows:

<?php
        class Amg_Predios extends AppModel {
                var $name = 'Amg_Predios';
                var $primaryKey = 'gid';
        }
?>

but when in my controller I use the:


        $this->AmgPredio->save( $this->data );

I get this error:
        Notice (8): Undefined index: id [CORE/cake/libs/model/model.php, line 
1329]

And after it, a message who says I'm trying to insert a duplicate record,
because the primarykey already exists.

I have flushed the cache and it is still not working.

Any clues about what I'm doing wrong?

Thanks in advance.

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Override-primarikey-Undefined-index-id-Error-tp4472931p4472931.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to