Problem/Motivation

ExtraFieldSource has been added recently: #3571038: Render extra field values

And have an expected usage of $metadata attribute:

#[Source(
  id: 'extra_field',
  label: new TranslatableMarkup('Extra field'),
  ...
  metadata: ['group' => new TranslatableMarkup('Fields')],
)]

As already warned in https://www.drupal.org/project/display_builder/issues/3571038#comment-16...

metadata attribute, used in ExtraFieldSource, is an undocumented feature of UI Patterns we will try to remove soon (see #3591167: Tidy metadata plugin attributes).

Proposed resolution

Remove current usage of $metadata attribute to avoid fatal errors once we limit its usage, both in plugin definition and in BlockLibrarySourceHelper.

Follow-up

If Display Builder really need to group sources in a clean way, and remove the hacky BlockLibrarySourceHelper::getSourceGroupLabel(), We can propose UI Patterns project to add a category or group attribute to Source plugins and make SourcePluginManager implements CategorizingPluginManagerInterface.

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

Status: Active » Needs work

pipeline running

pdureau’s picture

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

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

  • mogtofu33 committed 9544dae4 on 1.0.x authored by pdureau
    task: #3608406 Remove metadata attribute from ExtraFieldSource
    
    By:...
mogtofu33’s picture

Assigned: mogtofu33 » 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.