diff --git a/src/fieldlayoutelements/CustomField.php b/src/fieldlayoutelements/CustomField.php index 2c7177a5bcc..169adc6cfa8 100644 --- a/src/fieldlayoutelements/CustomField.php +++ b/src/fieldlayoutelements/CustomField.php @@ -37,9 +37,8 @@ public function __construct(?FieldInterface $field = null, $config = []) { // ensure we set the field last, so it has access to other properties that need to be set first // see https://github.com/craftcms/cms/issues/15752 - if (isset($config['fieldUid'])) { - $fieldUid = $config['fieldUid']; - unset($config['fieldUid']); + $fieldUid = ArrayHelper::remove($config, 'fieldUid'); + if ($fieldUid) { $config['fieldUid'] = $fieldUid; }