Skip to content

Commit

Permalink
Fix child blocks UI element not showing on FLD sidebar on existing bl…
Browse files Browse the repository at this point in the history
…ock types
  • Loading branch information
ttempleton committed Jul 21, 2022
1 parent 891f5a3 commit 941ecd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 7 additions & 3 deletions src/controllers/Configurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down

0 comments on commit 941ecd8

Please sign in to comment.