From d9ac595af6c6c286726155fd34fccb23f467f78e Mon Sep 17 00:00:00 2001 From: Sean Delaney Date: Tue, 28 Jun 2022 18:30:17 +0100 Subject: [PATCH] Respect non-translatable fields in multisite events --- packages/plugin/src/Services/EventsService.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugin/src/Services/EventsService.php b/packages/plugin/src/Services/EventsService.php index a47d90dc..bb75210c 100644 --- a/packages/plugin/src/Services/EventsService.php +++ b/packages/plugin/src/Services/EventsService.php @@ -494,7 +494,13 @@ private function _respectNonTranslatableFields(Event $event, bool $isSaved): boo $otherSiteIds = ArrayHelper::withoutValue(array_keys($supportedSites), $event->siteId); if (! empty($otherSiteIds)) { - $otherSiteEvents = Event::find()->id($event->id)->siteId($otherSiteIds)->status(null)->all(); + foreach ($otherSiteIds as $otherSiteId) { + $otherSiteEvent = $this->getEventById($event->id, $otherSiteId); + + if ($otherSiteEvent) { + $otherSiteEvents[] = $otherSiteEvent; + } + } } foreach ($event->getFieldLayout()->getTabs() as $fieldLayoutTab) {