Problem/Motivation

Values saved from the Config panel keep the strings the form posts. For a source nested in a component, booleans are published as '1', and slot weights as '0'.

Steps to reproduce

  1. Add a page layout with a component that uses the Menu source for a prop, with "Expand all menu links" ticked.
  2. In the builder, change the menu depth, then Publish.
  3. Run drush config:get on the page layout: expand_all_items: '1', not true.

Proposed resolution

Cast the saved source data to its config schema, and block settings to the block schema, as config does on save.

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ✅ Automated unit/functional testing coverage
  • ❌ Code review by maintainers

The tests cover the cast itself. A kernel test through the Config panel request is missing, as the component form did not take posted values in a kernel test.

AI-Generated: Yes

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

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Publishing a display installed from config also fills in dependencies: that is expected, they are calculated once the builder is used. The field formatter source drops label: hidden, which the formatter source never uses, so the output stays the same. The type changes are this issue.

AI-Generated: Yes

pdureau’s picture

a component that uses the Menu source for a prop

It may be a UI Patterns ticket about missing config schema. What do you think @mogtofu33 and @just__like_good_vibes ?

pdureau’s picture

Assigned: Unassigned » just_like_good_vibes
Status: Active » Needs review
Issue tags: +display_builder-1.0.0-beta

Hi Mikael, can we have a talk about this?