Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty GridBlocks will not be rendered in 'View' #6280

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

MAX-786
Copy link
Contributor

@MAX-786 MAX-786 commented Sep 8, 2024

Fixes #6279

This can be a single line fix:

const columns = data.blocks_layout.items;

adding this check just before the above mentioned line will fix this

  if (data.blocks_layout === undefined) {
    return null;
  }

then this won't render any Grid block since its empty so it makes sense too, but yeah it remains in the formData so going into edit again will open up the TemplateChooser again.

Copy link

netlify bot commented Sep 8, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 79a9964
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66de6a152256a500084d2b0e

Copy link
Sponsor Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix!

@davisagli davisagli merged commit ccf31d3 into plone:main Sep 9, 2024
44 checks passed
@MAX-786 MAX-786 deleted the empty-grid-fix branch September 9, 2024 03:51
sneridagh added a commit that referenced this pull request Sep 14, 2024
* main: (97 commits)
  Release 18.0.0-alpha.43
  Release @plone/slate 18.0.0-alpha.18
  Release @plone/client 1.0.0-alpha.17
  Added a notice in the upgrade guide for CookiePlone as the recommended way for generating projects and add-on boilerplate (#6286)
  Fix typo in Changelog for #6285 (#6287)
  Update to Volto 6.0.13 (#6285)
  Fix order component (#6284)
  Remove dangling `.only` in Cypress test (#6282)
  Empty GridBlocks will not be rendered in 'View' (#6280)
  Refactor Content upload modal  (#5047)
  Passes the `user` to the `restricted` function of the block settings (#6271)
  Refactored SelectMetadataField.jsx to functional component (#5570)
  Remove "Generate tabs for items other than folders" field from navigation control panel (#6278)
  Refactor DatetimeWidget (#6213)
  Added make i18n to volto (#6274)
  Place the actions-storybook in correct folder (#6275)
  Refactor ReferenceWidget (#5093)
  Fix error in SortOn component when there is no sort selected. (#6273)
  When user changes location, set the userSession.token value based on cookie (#6079)
  Trivial MyST syntax enhancement
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving empty 'gridBlock' breaks volto
2 participants