MergeRemoteStructure calls ParagraphsWidget::isApplicable for all field types indiscriminately

Created on 19 February 2025, about 2 months ago

Problem/Motivation

I ran into an issue while using conflict_paragraphs in conjunction with a patch from 📌 Expose target type, selection handler and selection settings in LinkWidget Needs work , which adds a "target_type" setting to the link field type. This target type may be an empty string.

\Drupal\conflict_paragraphs\ConflictResolution\MergeRemoteStructure::resolveConflictsContentEntity calls ParagraphsWidget::isApplicable(), even when $field_definition is not of the type "entity_reference_revisions" type. So when target_type is empty, a \Drupal\Component\Plugin\Exception\PluginNotFoundException is raised, saying "The "" entity type does not exist."

Proposed resolution

Turn this :
if (ParagraphsWidget::isApplicable($field_definition))

Into this :
if ($field_definition->getType() === 'entity_reference_revisions' && ParagraphsWidget::isApplicable($field_definition))

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France arousseau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024