Problem/Motivation

I have notices there are sometimes unexpected third_party_settings and node_id (always empty, of course, they don't make sense here) in the ComponentSource internal data.

node_id: 699714c9b5736
source_id: component
source:
  component:
    component_id: 'ui_suite_daisyui:avatar'
    variant_id: {}
    props: {}
    slots: {}
    third_party_settings: ''
    node_id: ''

Proposed resolution

Find where they are added and remove them.

Added to display_builder-1.0.0-beta3 scope because I hope it will be a little innocent fix.

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

This little issue may have 2 distinct causes:

node_id is added because of a leftover of the introduction of SourceWithSlotsInterface in #3531521: Layout plugins support with this part in Instance entity hardcofdng ComponentSource logic:

public function getParentId(array $root, string $node_id): string {
  $path = $this->getPath($root, $node_id);
  $length = \count(['source', 'component', 'slots', '{slot_id}', 'sources', '{position}']);
  $parent_path = \array_slice($path, 0, \count($path) - $length);
   return $this->getNodeId($parent_path);
}

It need to be replaced by a generic behaviour, so we need to add a parent key in the path index, and we will also get rid of some now useless logic.

A mechanism adding third_party_settings, not found yet.

pdureau’s picture

Assigned: Unassigned » pdureau
pdureau’s picture

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

A mechanism adding third_party_settings, not found yet.

Indeed, there is a second mechanism in play, adding unexpected node_id and third_party_settings empty values, but it is on UI Patterns' side: #3574820: Unexpected properties in ComponentSource data

What can be done in Display Builder has been done in the MR, so OK to review.

pdureau’s picture

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

  • mogtofu33 committed 57571204 on 1.0.x authored by pdureau
    fix: #3574548 Unexpected properties in ComponentSource data
    
    By: pdureau
    

Status: Fixed » Closed (fixed)

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