Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Remove ambiguity for polymorphic queries #11195

Conversation

GuySartorelli
Copy link
Member

IMPORTANT

Because this PR targets 5.2 which is currently in a change freeze, @maxime-rainville needs to approve it before it can be merged.

I am targetting 5.2 because it is the first minor release which includes multi-relational has_many relations, which is what has surfaced this as a problem (more details in the issue).

Description

polymorphic has_many relations create a query that is too ambiguous - depending on what you join into the query, the {relation}Class and {relation}Relation columns might be on multiple tables.

This PR specifies the table that should be used.

Manual testing steps

See reproduction steps in the issue

Issues

Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

Looks good, tested locally

@emteknetnz emteknetnz merged commit 6743de4 into silverstripe:5.2 Apr 11, 2024
15 checks passed
@emteknetnz emteknetnz deleted the pulls/5.2/non-ambiguous-whereclause branch April 11, 2024 21:40
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.

None yet

2 participants