Skip to content

Fix hydration of collections indexed by an inherited field when SQL filters change - #12506

Open
igrizzli wants to merge 1 commit into
doctrine:3.6.xfrom
igrizzli:12505-reuse-inherited-column-alias
Open

Fix hydration of collections indexed by an inherited field when SQL filters change#12506
igrizzli wants to merge 1 commit into
doctrine:3.6.xfrom
igrizzli:12505-reuse-inherited-column-alias

Conversation

@igrizzli

Copy link
Copy Markdown
Q A
Type bug
BC Break no
Fixed issues Fixes #12505

@greg0ire greg0ire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://www.doctrine-project.org/2025/10/08/an-update-on-the-orm-2-end-of-life.html, we no longer accept bugfixes on 2.x

Please retarget to 3.x if it is affected.

@igrizzli
igrizzli force-pushed the 12505-reuse-inherited-column-alias branch from 86b39c6 to 05397db Compare June 11, 2026 02:25
@igrizzli
igrizzli changed the base branch from 2.20.x to 3.6.x June 11, 2026 02:25
@greg0ire
greg0ire dismissed their stale review June 11, 2026 05:58

The PR now targets the 3.x branch

@greg0ire greg0ire added the Bug label Jun 11, 2026
Comment thread tests/Tests/ORM/Functional/Ticket/GH12505/Garage.php Outdated
@greg0ire

Copy link
Copy Markdown
Member

@dbannik @tomme87 please review

@dbannik

dbannik commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@greg0ire

Its OK, I am approve.

@greg0ire greg0ire added this to the 3.6.8 milestone Jun 16, 2026
This fixes a hydration error ("Undefined array key") when loading a
collection indexed by an inherited field after the SQL filters
changed. The column alias reuse from doctrine#11792/doctrine#12373 stores the alias
under the field's declaring class but looks it up under the alias's
class, so it never matches for inherited fields.

Fixes doctrine#12505
@igrizzli
igrizzli force-pushed the 12505-reuse-inherited-column-alias branch from 05397db to cdc1267 Compare June 25, 2026 17:09
public function setDeletedAt(DateTimeImmutable|null $deletedAt): void
{
$this->deletedAt = $deletedAt;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove any unused methods.

@greg0ire greg0ire removed this from the 3.6.8 milestone Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hydration error with ManyToMany relation indexed by inherited id when changing SQL filters

3 participants