Skip to content

Commit

Permalink
Merge pull request #3856 from neos/bugfix/enforce-dom-node-for-augmen…
Browse files Browse the repository at this point in the history
…tation

BUGFIX: Prevent augmenter from applying data of multiple nodes into the same element
  • Loading branch information
kitsunet authored Sep 25, 2024
2 parents 537b1a2 + 0b964bd commit 00d94b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Classes/Aspects/AugmentationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ public function contentElementAugmentation(JoinPointInterface $joinPoint)
$attributes['data-__neos-node-contextpath'] = $node->getContextPath();
$attributes['data-__neos-fusion-path'] = $fusionPath;

return $this->htmlAugmenter->addAttributes($content, $attributes);
// Define all attribute names as exclusive via the `exclusiveAttributes` parameter, to prevent the data of
// two different nodes to be concatenated into the attributes of a single html node.
// This way an outer div is added, if the wrapped content already has node related data-attributes set.
return $this->htmlAugmenter->addAttributes(
$content,
$attributes,
'div',
array_keys($attributes)
);
}

/**
Expand Down

0 comments on commit 00d94b6

Please sign in to comment.