Skip to content

Fixed bug where element would disappear in a condition rule on reload.#16005

Closed
lukeholder wants to merge 1 commit into5.xfrom
bugfix/element-select-site
Closed

Fixed bug where element would disappear in a condition rule on reload.#16005
lukeholder wants to merge 1 commit into5.xfrom
bugfix/element-select-site

Conversation

@lukeholder
Copy link
Copy Markdown
Member

@lukeholder lukeholder commented Nov 4, 2024

Description

When making a condition rule that uses BaseElementSelectConditionRule (like the "Related To" rule) the element would not show up after page reload. This is due to the element query looking for the $sitesService->getCurrentSite()->id by default.

Fixed by changing the query to look for all sites. This also mimics the rule’s matching logic, which only matches on element ID.

CleanShot.2024-11-04.at.17.36.18.mp4

Related Issue

craftcms/commerce#3739

@brandonkelly brandonkelly deleted the bugfix/element-select-site branch November 6, 2024 18:57
@brandonkelly
Copy link
Copy Markdown
Member

Thanks! Fixed on 4.x via 233d23c.

@brandonkelly
Copy link
Copy Markdown
Member

Craft 4.12.9 and 5.4.10 are out with that fix.

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