Skip to content

Commit 42526a1

Browse files
committed
wip
1 parent 4e9b13c commit 42526a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Uploadcare.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ public function getForm(): array
6767
->inline(false),
6868
Toggle::make('config.withMetadata')
6969
->label(__('With metadata'))
70-
->formatStateUsing(function ($state) {
71-
return $state ?? self::getDefaultConfig()['withMetadata'];
70+
->formatStateUsing(function ($state, $record) {
71+
// Check if withMetadata exists in the config
72+
$config = is_string($record->config) ? json_decode($record->config, true) : $record->config;
73+
return isset($config['withMetadata']) ? $config['withMetadata'] : self::getDefaultConfig()['withMetadata'];
7274
})
7375
->inline(false),
7476
Toggle::make('config.imagesOnly')

0 commit comments

Comments
 (0)