IndustrialDragonfly / DEdC

Collaborative DFD Editor
MIT License
6 stars 1 forks source link

calling save() on a Diagram with things in its arrays generates an exception #99

Open JoshuaJClark opened 10 years ago

JoshuaJClark commented 10 years ago

when the save (being called by update()) function is called on a diagram with anything currently in its linkList, nodeList or diaNodeList is called an exception is generated, this appears to be caused by the things in the lists not having an entry in the entity table

eugene-davis commented 10 years ago

Can you detail a very simple list of calls which will cause this to occur here?

JoshuaJClark commented 10 years ago

$dfd = new DataFlowDiagram( $this->storage);//create a Diagram $df = new DataFlow($this->storage, $dfd->getId());//add a Link to the Diagram $dfd->refresh();//update the local memory to match the DB $dfd->update();//call update and this generates a pdo exception

copy of the exception: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (dedc.element_list, CONSTRAINT element_list_ibfk_1 FOREIGN KEY (elementId) REFERENCES entity (id) ON DELETE CASCADE ON UPDATE CASCADE)