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

Gutenberg: Dynamic blocks default attributes aren't loaded #27963

Closed
Copons opened this issue Oct 19, 2018 · 5 comments · Fixed by #30045
Closed

Gutenberg: Dynamic blocks default attributes aren't loaded #27963

Copons opened this issue Oct 19, 2018 · 5 comments · Fixed by #30045
Assignees
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Pri] High [Type] Bug

Comments

@Copons
Copy link
Contributor

Copons commented Oct 19, 2018

Steps to reproduce

  1. Starting at URL: https://wpcalypso.wordpress.com/gutenberg/post/ ; select a site and load Gutenberg.
  2. Insert a dynamic block such as Latest Comments.
  3. Open the block settings: all the toggles are off and the slider's value is empty.
  4. Compare it with how the block is rendered and observe how most, if not all, settings have the incorrect values.

Notes:

  • Changing one setting will fix this inconsistency for that setting. This issue is only about the default values.
  • Some cases (e.g. the Categories block) might be misleading, because all the attributes actually default to false.

What I expected

That the block default values are applied to the block sidebar.

What happened instead

The block sidebar uses the components default values instead (e.g. false for toggle; empty for the slider input)

Screenshot / Video

screenshot 2018-10-19 at 11 53 32

Context / Source

Gutenberg feeds those default values to the blocks settings with the unstable__bootstrapServerSideBlockDefinitions function, which is called in the client-assets.php file.

That function is never called in Calypso, and therefore all dynamic blocks default attributes fallback to empty objects.

@Copons Copons added [Type] Bug [Goal] Gutenberg Working towards full integration with Gutenberg labels Oct 19, 2018
@Copons Copons added this to the Core Blocks Integration milestone Oct 19, 2018
@cecoates
Copy link

1506955-hc with the "Latest posts" block.

@tanjoymor
Copy link

1675600-zd similar issue with the "Latest posts" block - when you change the settings on the block it's returning an update failed message and the block is reverting to the default values.

@khristiansnyder
Copy link

9056662-hc Same issue with the "Latest Posts" block.

@Agepeuve
Copy link

Agepeuve commented Jan 8, 2019

Same issue on this thread from the ES forums: https://es.forums.wordpress.com/topic/widget-ultimas-entradas/

@selectedselections
Copy link

1702487-zd same issue with the Latest posts block. The values are blank and when they are set to numbers, those numbers are not reflected with the published results. (ie the block is set to display 10 posts and only 4 are displayed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment