Skip to content

Commit

Permalink
BUGFIX: Prevent augmenter from applying data of multiple nodes into t…
Browse files Browse the repository at this point in the history
…he same element

This fixes a regression introduced in #b56135a01ecf59ae3a4990e3fd54ac766732e0e6 which
removed the script tag, causing the augmenter to add the data of multiple nodes into the same
html element in certain cases instead of adding an outer div.

With this change this behaviour is now more explicit instead of relying on the inner workings
of the augmenter.
  • Loading branch information
Sebobo committed Sep 25, 2024
1 parent 537b1a2 commit 0b964bd
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 0b964bd

Please sign in to comment.