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

baseRelationField's modifyElementsQuery siteId constraint #14304

Merged

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Feb 6, 2024

Description

BaseRelationField's modityElementsQuery should factor in siteId when creating the relation condition for the query.

This change makes the result of the following queries consistent:

craft.entries.section('blog').siteId(1).myCategories(2).all()

and

craft.entries.section('blog').siteId(1).relatedTo({
    field: 'myCategories',
    targetElement: 2
}).all()

As it might be considered a slight change in behaviour, I’ve targetted 4.8.

Related issues

#14258

@brandonkelly brandonkelly merged commit cc77978 into 4.8 Feb 13, 2024
@brandonkelly brandonkelly deleted the bugfix/14258-baseRelationField-modifyElementsQuery-incl-site branch February 13, 2024 23:11
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