Skip to content

Commit 4253b7a

Browse files
committed
fix: sections/blocks settings support explict null value
1 parent b0decdb commit 4253b7a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Sections/Support/BlockData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function prepareSettings(array $settings, array $settingsSchema):
3636
return collect($settingsSchema)
3737
->reject(fn ($setting) => $setting['type'] === 'header')
3838
->mapWithKeys(fn ($schema) => [
39-
$schema['id'] => $settings[$schema['id']] ?? $schema['default'] ?? null,
39+
$schema['id'] => array_key_exists($schema['id'], $settings) ? $settings[$schema['id']] : ($schema['default'] ?? null),
4040
])
4141
->toArray();
4242
}

src/Sections/Support/SectionData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected static function prepareSettings(array $settings, array $settingsSchema
5454
return collect($settingsSchemas)
5555
->reject(fn ($schema) => $schema['type'] === 'header')
5656
->mapWithKeys(fn ($schema) => [
57-
$schema['id'] => $settings[$schema['id']] ?? $schema['default'] ?? null,
57+
$schema['id'] => array_key_exists($schema['id'], $settings) ? $settings[$schema['id']] : ($schema['default'] ?? null),
5858
])
5959
->all();
6060
}

0 commit comments

Comments
 (0)