alice: 3.x — as no identity/no id values set. It cannot be added to the identity map.

I have two entities.

user (entity 1)

  • id (primary key)
  • name

detail (entity 2)

  • user (primary key, which is from user entity)
  • address

When running fixtures with

detail_{1..10}:
    user:             "@user_<current()>"

I get the following error

[Doctrine\ORM\ORMInvalidArgumentException]
The given entity of type ‘AppBundle\Entity\Detail’ (AppBundle\Entity\Detail@0000000007f1464d000000006748ef3
e) has no identity/no id values set. It cannot be added to the identity map.

Please note that this was working fine on 2.x

Stackoverflow links https://stackoverflow.com/a/30404503/75799

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Sorry I forgot to post my message yesterday, see https://github.com/theofidry/alice-problem/commit/14bf2e0c2b8379ee0950a4a6aba35044a9681838.

Arguably there is some design issues:

  • Missing alias for persister in FidryAliceDataFixtures to easily override it
  • Add a persister factory for e.g. DoctrineOrmLoader in HautelookAliceBundle

Can’t do much atm, but PRs are welcome 😃

I have reproduced the problem at https://github.com/iBasit/alice-problem.git

Getting up and running is easy as 123.

  1. composer install
  2. bin/console database:create:database
  3. bin/console doctrine:schema:update --force

and then just test with bin/console hautelook:fixtures:load

image

I hope you can help on this. Thank you