Skip to content

Commit 03eaf51

Browse files
committed
Fix an issue when propagating Hyper field values within Matrix fields on multi-site installs
1 parent 8182fd2 commit 03eaf51

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/fields/HyperField.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -333,23 +333,11 @@ public function beforeElementSave(ElementInterface $element, bool $isNew): bool
333333
foreach ($value as $linkIndex => $link) {
334334
// Only process this for brand-new, unsaved blocks
335335
if ($link instanceof ElementLink) {
336-
// Check if this is a new Hyper link, and that we should propagate it to other sites
337-
$isNewLink = $this->_originElement?->getFieldValue($this->handle)[$linkIndex]?->isNew ?? null;
336+
$link->linkSiteId = $element->siteId;
338337

339-
// When being saved for a new site element, that should also trigger propagation
340-
if ($element->isNewForSite) {
341-
$isNewLink = true;
342-
}
343-
344-
if ($isNewLink) {
345-
$link->linkSiteId = $element->siteId;
346-
347-
$changedValue = true;
348-
}
338+
$changedValue = true;
349339
}
350340
}
351-
} else {
352-
$this->_originElement = $element;
353341
}
354342

355343
if ($changedValue && $value) {

0 commit comments

Comments
 (0)