diff --git a/src/fields/HyperField.php b/src/fields/HyperField.php index 958e70f..fc2dc17 100644 --- a/src/fields/HyperField.php +++ b/src/fields/HyperField.php @@ -633,6 +633,9 @@ private function _normalizeLayoutConfig(array $config = []): array $layoutConfig = Json::decode($layoutConfig); } + // Ensure we remove `uid` from the `layoutConfig` - we don't want it + ArrayHelper::remove($layoutConfig, 'uid'); + $newLayout = FieldLayout::createFromConfig($layoutConfig); $fieldLayoutConfig = $newLayout->getConfig(); diff --git a/src/services/Service.php b/src/services/Service.php index 9d5d65d..de32118 100644 --- a/src/services/Service.php +++ b/src/services/Service.php @@ -11,6 +11,7 @@ use craft\elements\Entry; use craft\elements\db\ElementQueryInterface; use craft\events\ConfigEvent; +use craft\helpers\ArrayHelper; use craft\helpers\ProjectConfig as ProjectConfigHelper; class Service extends Component @@ -91,6 +92,9 @@ public function saveField(array $linkTypes, ?ConfigEvent $event = null): void continue; } + // Ensure we remove `uid` from the `layoutConfig` - we don't want it + ArrayHelper::remove($layoutConfig, 'uid'); + $fieldLayout = FieldLayout::createFromConfig($layoutConfig); $fieldLayout->type = $linkType['type']; $fieldLayout->uid = $layoutUid;