diff --git a/src/Fields/FieldTransformer.php b/src/Fields/FieldTransformer.php index 76a0cc116b..28eea44a8f 100644 --- a/src/Fields/FieldTransformer.php +++ b/src/Fields/FieldTransformer.php @@ -28,12 +28,11 @@ private static function inlineTabField(array $submitted) { $fieldtype = FieldtypeRepository::find($submitted['fieldtype'] ?? $submitted['config']['type']); - $defaultConfig = Field::commonFieldOptions()->all() - ->merge($fieldtype->configFields()->all()) - ->map->defaultValue()->filter(); + $fields = Field::commonFieldOptions()->all() + ->merge($fieldtype->configFields()->all()); $field = collect($submitted['config']) - ->reject(function ($value, $key) use ($defaultConfig) { + ->reject(function ($value, $key) use ($fields) { if (in_array($key, ['isNew', 'icon', 'duplicate'])) { return true; } @@ -46,7 +45,11 @@ private static function inlineTabField(array $submitted) return true; } - return $defaultConfig->has($key) && $defaultConfig->get($key) === $value; + if (! $field = $fields->get($key)) { + return false; + } + + return $field->defaultValue() === $value; }) ->map(function ($value, $key) { if ($key === 'sets') {