diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f64cee..8f7d180a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Fixed a JavaScript error that occurred when pasting a block type - Fixed an incorrect German translation of 'Min Blocks' (thanks @alumpe) +- Fixed a bug where the child blocks UI element wasn't appearing on the field layout designer sidebar on existing block types ## 3.1.8 - 2022-07-15 diff --git a/src/controllers/Configurator.php b/src/controllers/Configurator.php index 397207aa..17357553 100644 --- a/src/controllers/Configurator.php +++ b/src/controllers/Configurator.php @@ -33,9 +33,13 @@ public function actionRenderFieldLayout(): Response $config = $request->getBodyParam('layout'); // Prioritise the config - $fieldLayout = $config - ? FieldLayout::createFromConfig($config) - : ($id ? Craft::$app->getFields()->getLayoutById($id) : new FieldLayout(['type' => Block::class])); + if ($config) { + $fieldLayout = FieldLayout::createFromConfig($config); + $fieldLayout->type = Block::class; + } else { + $fieldLayout = $id ? Craft::$app->getFields()->getLayoutById($id) : new FieldLayout(['type' => Block::class]); + } + $html = Neo::$plugin->blockTypes->renderFieldLayoutDesigner($fieldLayout); return $this->asJson([