diff --git a/src/Fieldtypes/DictionaryFields.php b/src/Fieldtypes/DictionaryFields.php index 35cac097bc..ccbeda002e 100644 --- a/src/Fieldtypes/DictionaryFields.php +++ b/src/Fieldtypes/DictionaryFields.php @@ -30,17 +30,17 @@ public function preload() return [ 'type' => [ 'fields' => $typeField->toPublishArray(), - 'meta' => $typeField->meta(), + 'meta' => $typeField->meta()->all(), ], 'dictionaries' => Dictionary::all()->mapWithKeys(function (\Statamic\Dictionaries\Dictionary $dictionary) { return [$dictionary->handle() => [ 'fields' => $dictionary->fields()->toPublishArray(), - 'meta' => $dictionary->fields()->meta(), + 'meta' => $dictionary->fields()->meta()->all(), 'defaults' => $dictionary->fields()->all()->map(function ($field) { return $field->fieldtype()->preProcess($field->defaultValue()); - }), + })->all(), ]]; - }), + })->all(), ]; } diff --git a/tests/Fieldtypes/DictionaryFieldsTest.php b/tests/Fieldtypes/DictionaryFieldsTest.php index ade9f3e1c5..132204714c 100644 --- a/tests/Fieldtypes/DictionaryFieldsTest.php +++ b/tests/Fieldtypes/DictionaryFieldsTest.php @@ -30,7 +30,7 @@ public function it_returns_dictionary_fields_in_preload() 'fields' => [ ['handle' => 'type', 'type' => 'select'], ], - 'meta' => collect(['type' => null]), + 'meta' => ['type' => null], ], ], $preload); @@ -39,10 +39,10 @@ public function it_returns_dictionary_fields_in_preload() 'fields' => [ ['handle' => 'category', 'type' => 'select'], ], - 'meta' => collect(['category' => null]), - 'defaults' => collect(['category' => null]), + 'meta' => ['category' => null], + 'defaults' => ['category' => null], ], - ], $preload['dictionaries']->all()); + ], $preload['dictionaries']); } #[Test]