Skip to content

Commit

Permalink
Do not break toolbar if layout id is not registerd in layoutViewsName…
Browse files Browse the repository at this point in the history
…sMapping (#6485)

Co-authored-by: David Glick <[email protected]>
  • Loading branch information
cekk and davisagli authored Nov 19, 2024
1 parent de98f08 commit d320bfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/volto/news/6485.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not break toolbar if layout id is not registered in layoutViewsNamesMapping. @cekk
12 changes: 7 additions & 5 deletions packages/volto/src/components/manage/Display/Display.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ const DisplaySelect = (props) => {
? state.content.data[getLayoutFieldname(state.content.data)]
: '',
);
const layoutMappingId = config.views.layoutViewsNamesMapping?.[layout];
const [selectedOption, setselectedOption] = useState({
value: layout,
label:
intl.formatMessage({
id: config.views.layoutViewsNamesMapping?.[layout],
defaultMessage: config.views.layoutViewsNamesMapping?.[layout],
}) || layout,
label: layoutMappingId
? intl.formatMessage({
id: layoutMappingId,
defaultMessage: layoutMappingId,
})
: layout,
});

const type = useSelector((state) =>
Expand Down

0 comments on commit d320bfe

Please sign in to comment.