LouAdrien Posted July 30, 2015 Share Posted July 30, 2015 Hello all, This question is somewhat related to this topic. The problem happening is that on my own installation (1.6.11 - Mac OS 10.10.3), the add() method of the objectmodel will create thew new entity, but will always return 0 as the entity ID. That is quite a big issue as I read the object model core code, and it seems to rely heavily on the assumption that this will be set properly. Also it seems that it fails as the step doing : $object_id = Db::getInstance()->Insert_ID(); Apparently this insert_id implementation on my system does not work. Anyone have seen this bug / found a way to solve it? Thx Link to comment Share on other sites More sharing options...
gabdara Posted August 1, 2015 Share Posted August 1, 2015 I get the same problem on my custom extended classes of ObjectModel, but only for those that I use force_id=true. To get past this I use something like this: $this->force_id = true; $this->id = $this->{self::$definition['primary']} = $id_custom; $this->add() && $this->id = $id_custom; Link to comment Share on other sites More sharing options...
Recommended Posts