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

9.0 port of neos/neos-ui#3856

Original Commit MSG:

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
mhsdesign committed Oct 8, 2024
1 parent eb40e73 commit 0c38244
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Neos.Neos/Classes/Service/ContentElementWrappingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ public function wrapContentObject(
$attributes['data-__neos-fusion-path'] = $fusionPath;
$attributes['data-__neos-node-contextpath'] = $nodeAddress->serializeForUri();

return $this->htmlAugmenter->addAttributes($content, $attributes, 'div');
// 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 0c38244

Please sign in to comment.