Skip to content

[CursorPaginator] Fix cursor building when ordering by ManyToOne association#12485

Merged
greg0ire merged 1 commit into
doctrine:3.7.xfrom
seb-jean:fix/cursor-paginator-manytoone-association
May 26, 2026
Merged

[CursorPaginator] Fix cursor building when ordering by ManyToOne association#12485
greg0ire merged 1 commit into
doctrine:3.7.xfrom
seb-jean:fix/cursor-paginator-manytoone-association

Conversation

@seb-jean
Copy link
Copy Markdown

@seb-jean seb-jean commented May 24, 2026

  • getParametersForItem() was passing the associated entity directly to convertToDatabaseValue() when ordering by a ManyToOne association, causing a type mismatch exception (Could not convert PHP value of type App\Entity\Author to type author_id)
  • Fix: unwrap the association to its identifier before type conversion
  • Add a test covering this case

Fixes #12484

@seb-jean seb-jean force-pushed the fix/cursor-paginator-manytoone-association branch from d333f5e to 79bfdd3 Compare May 24, 2026 18:02
@seb-jean seb-jean force-pushed the fix/cursor-paginator-manytoone-association branch from 79bfdd3 to 7c59815 Compare May 24, 2026 18:09
@greg0ire greg0ire added the Bug label May 24, 2026
@greg0ire greg0ire added this to the 3.7.0 milestone May 26, 2026
@greg0ire greg0ire merged commit 9eccd1f into doctrine:3.7.x May 26, 2026
108 of 109 checks passed
@greg0ire
Copy link
Copy Markdown
Member

Thanks @seb-jean !

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.

3 participants