Creating a block. When I "Update" I get Fatal Error (Duplicate PRIMARY)

Permalink
Hi,

A block that I am creating will not update, it adds fine. I get this error (example):

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1062: Duplicate entry '132' for key 'PRIMARY' in C:\xampp\htdocs\dev.xxxx.com\public_html\concrete\libraries\3rdparty\adodb\adodb-exceptions.inc.php on line 78 ( ! ) ADODB_Exception: mysql error: [1062: Duplicate entry '132' for key 'PRIMARY'] in EXECUTE("INSERT INTO btfdmediacarousel (bID) VALUES (132)")

The block uses two database tables: One for the block itself and one for slides associated to that block. (It's a slideshow type affair)

I am using the standard save method. I understand why this is but I don't know why the save method is not handling this itself as it does with other blocks.

Any help will save my life.

 
beingalex replied on at Permalink Reply
Fixed it:

Was putting

parent::save($args);


in the wrong place.
aghouseh replied on at Permalink Reply
aghouseh
Can you expand a little further? I'm mostly curious because I'm doing the same type of structure with my db.xml as you are (main block table and then a table for individual items within the block). My btBlockType table is actually ONLY bID with no other fields, but it almost looks like the save() function is getting called twice for some reason.