Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ORMException: Entity of type XXX is missing an assigned ID for field 'id'. #45

Closed
Steff81 opened this Issue · 2 comments

3 participants

@Steff81

Hi,
i have a problem using the TranslatetableListener. The service is configured and available. I configured everything like in your example. In the normal Category Entity the id generate strategy ist set to NONE. This seems not to work because I always get the following error message

ORMException: Entity of type XXX\Prototype\CategoryBundle\Entity\Category is missing an assigned ID for field 'id'. The identifier generation strategy for this entity requires the ID field to be populated before EntityManager#persist() is called. If you want automatically generated identifiers instead you need to adjust the metadata mapping accordingly.

Anyway the TranslatetableListeneris triggered and adds the metadata (i have checked this by set an echo 'Hello'; in die TranslatableListener Class)

In my opinion something wents wrong here.

@PedroTroller

It seems that your ID is not auto-generated, and it is empty. So when Doctrine wants to persist your entity, there is no ID to persist...

@Steff81

Yes i found it in the meanwhile.
It is an error in the documentation. There strategy NONE is recommended, but it need to be strategy AUTO.
Anyway, thanks for the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.