From 354f2c8f3ffc1e7e6f10c60db32f8468fb9478c8 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 29 Oct 2024 16:07:28 +0100 Subject: [PATCH 1/2] Moved `applyBlockDefaults` one component up so the style is computed correctly --- packages/volto/src/components/manage/Blocks/Block/Edit.jsx | 3 +-- .../src/components/manage/Blocks/Block/EditBlockWrapper.jsx | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/volto/src/components/manage/Blocks/Block/Edit.jsx b/packages/volto/src/components/manage/Blocks/Block/Edit.jsx index 19fd9a932e..6812152587 100644 --- a/packages/volto/src/components/manage/Blocks/Block/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/Edit.jsx @@ -12,7 +12,6 @@ import cx from 'classnames'; import { setSidebarTab, setUIState } from '@plone/volto/actions'; import config from '@plone/volto/registry'; import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser'; -import { applyBlockDefaults } from '@plone/volto/helpers'; import { ViewDefaultBlock, EditDefaultBlock } from '@plone/volto/components'; import { @@ -199,7 +198,7 @@ export class Edit extends Component { {this.props.manage && ( { onInsertBlock, onSelectBlock, onMutateBlock, - data, + data: originalData, editable, properties, showBlockChooser, @@ -56,6 +57,8 @@ const EditBlockWrapper = (props) => { contentType, } = blockProps; + const data = applyBlockDefaults({ data: originalData, ...blockProps, intl }); + const visible = selected && !hideHandler(data); const required = isBoolean(data.required) From 08010dcb7bcb080dead9823d8f48375440a1ba82 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 29 Oct 2024 16:09:18 +0100 Subject: [PATCH 2/2] Changelog --- packages/volto/news/6451.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/volto/news/6451.bugfix diff --git a/packages/volto/news/6451.bugfix b/packages/volto/news/6451.bugfix new file mode 100644 index 0000000000..f4f9865d63 --- /dev/null +++ b/packages/volto/news/6451.bugfix @@ -0,0 +1 @@ +Moved `applyBlockDefaults` one component up so the style is computed correctly. @sneridagh