Skip to content

Commit 1a3de71

Browse files
committed
Fixed #17829
1 parent aa048c2 commit 1a3de71

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Fixed a bug where non-admin users couldn’t edit recursively-nested elements if they didn’t have save permissions for the top-level element.
1515
- Fixed a bug where it was possible to select disabled elements within element select modals. ([#17824](https://github.com/craftcms/cms/issues/17824))
1616
- Fixed a bug where toast notifications weren’t always being dismissed automatically when they should have. ([#17825](https://github.com/craftcms/cms/issues/17825))
17+
- Fixed an error that could occur if a Content Block field was saved without any fields selected. ([#17829](https://github.com/craftcms/cms/issues/17829))
1718
- Fixed a styling issue.
1819

1920
## 5.8.16 - 2025-08-29

src/fields/ContentBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public function setFieldLayout(FieldLayout|array|string $layout): void
260260
public function setFieldLayouts(array $layouts): void
261261
{
262262
$config = reset($layouts);
263-
$layout = Craft::$app->getFields()->createLayout($config);
263+
$layout = Craft::$app->getFields()->createLayout($config ?: []);
264264
$layout->uid = array_key_first($layouts);
265265
$layout->type = ContentBlockElement::class;
266266

0 commit comments

Comments
 (0)