Skip to content

Conversation

@podlesny-j
Copy link

@podlesny-j podlesny-j commented Jan 28, 2026

When a QueryBuilder alias like 'event' coincidentally matches an
existing PHP class name (e.g. \Event from ext-event stubs),
isClassString() returns yes and isTransient() returns true, causing
a DynamicQueryBuilderArgumentException. This made the query type
resolve to mixed instead of the correct entity type.

The isTransient check in ArgumentsProcessor::processArgs() is now scoped to only the first
argument of from/join/innerJoin/leftJoin/rightJoin methods. For all other methods and argument
positions, class-strings that happen to match a PHP class name fall through to constant scalar
handling. This preserves the error for genuinely passing a non-entity class to from/join, while
fixing the false positive for aliases like 'event'.

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com and janedbal


based on #609

podlesny-j and others added 2 commits January 28, 2026 23:45
When a QueryBuilder alias like 'event' coincidentally matches an
existing PHP class name (e.g. \Event from ext-event stubs),
isClassString() returns yes and isTransient() returns true, causing
a DynamicQueryBuilderArgumentException. This made the query type
resolve to mixed instead of the correct entity type.

Invert the transient check so that only non-transient (actual entity)
class-strings are resolved to their FQCN. Transient class-strings now
fall through to constant scalar handling, where they are treated as
plain string aliases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@podlesny-j podlesny-j marked this pull request as ready for review January 29, 2026 08:07
@podlesny-j podlesny-j requested a review from janedbal January 29, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants