Tag identifier collisions in nested paragraphs

Created on 4 June 2025, 2 days ago

Problem/Motivation

When the Tagify widget is used within a deeply nested paragraph, two or more levels deep, the identifier used for JavaScript selection conflicts with previous instances on the page. The issue is that this code does not account for multiple levels of deltas provided by the parent fields.

$tags_identifier = $items->getName();
// Concat element position to the Tagify identifier.
if (!empty($element['#field_parents'][1])) {
  $tags_identifier .= '_' . $element['#field_parents'][1];
}

Steps to reproduce

  • Create Paragraph Type B with a user entity reference field that has a maximum value of 1.
  • Set the user entity reference field form display to use the Tagify widget.
  • Create Paragraph Type A with a paragraph entity reference field that has unlimited values.
  • Set the paragraph entity reference field to Paragraph Type B.
  • Add a paragraph entity reference field to a node content type.
  • Create a new node with one Paragraph Type A and at least two Paragraph Type B values.
  • Verify the ability to select a Tagify user in both Paragraph Type B sections.
πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States robphillips

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024