mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Versioned entities in a class table inheritance cannot be persisted because of thrown LengthException
#6905
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kryptychon on GitHub (Jan 13, 2022).
BC Break Report
Summary
Persisting versioned entities in a class table inheritance scenario fails with
LengthException. Migration notes do not mention any changes regarding versioned entities.Previous behavior
Persisting such entities worked fine in
2.10.3(previous version I used).Current behavior
Persisting versioned entities in a class table inheritance scenario fails with
LengthException. I think this is related to commite369cb6e73which introduced generated/virtual properties and requiresversioncolumn to provide a value before initially flushing the newly created entity inJoinedSubclassPersister.php.Simply moving
assignDefaultVersionAndUpsertableValues()AFTER the insertion of the joined subclass fixes the issue.I'll try to provide a PR asap.
How to reproduce
Try persisting a versioned entity in a class table inheritance scenario.
Example