DDC-381: InvalidArgumentException: New entity detected during merge. Persist the new entity before merging. #474

Open
opened 2026-01-22 12:39:27 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 26, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user cloun:

I have attached my test project, except 'Doctrine' folder with Doctrine 2 project.
What I did:

  1. I created schema manually (user create.sql file)
  2. I generated model classes (by doctrine-cli.php script)
  3. Made a little changes in annotations (I just added OneToMany between user and phone)
  4. Run script test.php
    Steps for reproducing:
  5. create schema from create.sql file
  6. fix connection string in dbconfig.php
  7. run test.sql

Simple workaroung for me is to make all private fields as protected.

Originally created by @doctrinebot on GitHub (Feb 26, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user cloun: I have attached my test project, except 'Doctrine' folder with Doctrine 2 project. What I did: 1. I created schema manually (user create.sql file) 2. I generated model classes (by doctrine-cli.php script) 3. Made a little changes in annotations (I just added OneToMany between user and phone) 4. Run script test.php Steps for reproducing: 1. create schema from create.sql file 2. fix connection string in dbconfig.php 3. run test.sql Simple workaroung for me is to make all private fields as protected.
admin added the Bug label 2026-01-22 12:39:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#474