Thanks to visit codestin.com
Credit goes to github.com

Skip to content

UnitOfWork->originalEntityData is missing not-modified collections after computeChangeSet #9300

@olsavmic

Description

@olsavmic

Bug Report

Q A
BC Break no
Version 2.9.x and newer

Summary

UnitOfWork->computeChangeSet(ClassMetadata $class, $entity) overrides the $this->originalEntityData[$oid] by $actualData constructed inside this class.

Collections that were hydrated from the DB but not overridden ($value instanceof PersistentCollection && $value->getOwner === $entity) are skipped and not present in the $actualData variable.

This causes duplicate inserts and possibly other issues in case of subsequent flushes/computeChangeSet calls.

How to reproduce

See #9301

Expected behavior

All fields of entity should be present in $actualData (and therefore in originalEntityData).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions