Problem/Motivation

While working on #3571451: Check config schema when attaching and rendering a block, we noticed than block sources are not initialized with their default values.

In UI Patterns 2, we don't care much about required block settings because it was managed by the Form API:

  1. if a setting is required, we add the #required render property
  2. BlockForm can's be submitted without filling a required value
  3. So it is not possible to render a block without required props filled

But in Display Builder, we can render component without subimiting BlockForm, so with a missing required value:

  • on preview panel
  • on builder panel

Proposed resolution

That's why we need to add those default values.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pdureau created an issue. See original summary.

pdureau’s picture

Title: Add default configuration value to BlockSource » Add default configuration values to BlockSource

pdureau’s picture

Assigned: pdureau » just_like_good_vibes
Status: Active » Needs review

just_like_good_vibes made their first commit to this issue’s fork.

just_like_good_vibes’s picture

as we discussed, i have reworked the proposition and we did another work in cooperation for display_builder in #3571451: Check config schema when attaching and rendering a block.
pipeline is running for MR !550

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.