Problem/Motivation

In Display Builder, we meet 2 issues:

  • Component source has no settings summary.
  • When we drop a content field, it has no default value and is not rendering by default

Proposed resolution

  • Add ComponentSource::settingsSummary()
  • Add EntityFieldSource::getChoiceSettings() with default settings of the default formatter plugin.
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

Assigned: pdureau » just_like_good_vibes
Status: Active » Needs work

Hi,

I have pushed a working proposal but I know it is not good enough. I don't know what would be the right way of doing that. Can you have a look?

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

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » pdureau
Status: Needs work » Needs review

i gave it a try

pdureau’s picture

Assigned: pdureau » just_like_good_vibes
Status: Needs review » Reviewed & tested by the community

Tested with Display Builder: ✅ I drop a field and it is already configured with the default formatter

Tested with UI Patterns 2 (a block in Layout Builder) : I got:

An error occurred while attempting to process /layout_builder/add/block/defaults/node.page.default/0/content/ui_patterns_entity%3Aui_suite_bootstrap%3Acard?_wrapper_format=drupal_dialog.off_canvas&ajax_form=1&_wrapper_format=drupal_ajax: ajax.$form.ajaxSubmit is not a function

is it related?

pdureau’s picture

I have still the issue on my environement, but doesnt seem related to the current MR. OK for merge

just_like_good_vibes’s picture

hello, i am still a bit afraid to merge, let's do more checks just to secure this change is not introducing a regression with the arrival of defaultSettings implemented.

pdureau’s picture

Let's take the time we need

grimreaper’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new44.93 KB

Hello,

On a layout builder override:

I tried to add a block teaser text as a formater I chose "Component per item", then select a component and in a slot, source "[Field] Formatter", then nothing selected by default.

Is it the test to do?

pdureau’s picture

Title: [2.0.10] Add ComponentSource::settingsSummary() & EntityFieldSource::getChoiceSettings() » [2.0.11] Add ComponentSource::settingsSummary() & EntityFieldSource::getChoiceSettings()
just_like_good_vibes’s picture

is this issue still up-to-date, or should we close it ?

pdureau’s picture

Title: [2.0.11] Add ComponentSource::settingsSummary() & EntityFieldSource::getChoiceSettings() » Add ComponentSource::settingsSummary() & EntityFieldSource::getChoiceSettings()
Assigned: pdureau » just_like_good_vibes
Status: Needs work » Needs review

I am not reproducing the layout builder issue, so it looks good to me.

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.