Skip to content

Commit 233d23c

Browse files
committed
Make element select condition rules site-agnostic
Resolves #16005
1 parent ed0d5fc commit 233d23c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Fixed a bug where entry/category drafts weren’t retaining new parent selections.
6+
- Fixed a bug where the “Related to” condition rule would lose track of the selected element if it belonged to a different site. ([#16005](https://github.com/craftcms/cms/pull/16005))
67
- Fixed styling issues. ([#15965](https://github.com/craftcms/cms/issues/15965))
78

89
## 4.12.8 - 2024-10-22

src/base/conditions/BaseElementSelectConditionRule.php

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ private function _element(): ?ElementInterface
152152
/** @phpstan-var class-string<ElementInterface>|ElementInterface $elementType */
153153
$elementType = $this->elementType();
154154
return $elementType::find()
155+
->site('*')
156+
->preferSites(array_filter([Cp::requestedSite()?->id]))
157+
->unique()
155158
->id($elementId)
156159
->status(null)
157160
->one();

0 commit comments

Comments
 (0)