diff --git a/Neos.Neos/Classes/Service/ContentElementWrappingService.php b/Neos.Neos/Classes/Service/ContentElementWrappingService.php index 6a8f60d57f3..7da3e721dd4 100644 --- a/Neos.Neos/Classes/Service/ContentElementWrappingService.php +++ b/Neos.Neos/Classes/Service/ContentElementWrappingService.php @@ -17,8 +17,6 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; -use Neos\Flow\Security\Authorization\PrivilegeManagerInterface; -use Neos\Flow\Session\SessionInterface; use Neos\Fusion\Service\HtmlAugmenter as FusionHtmlAugmenter; use Neos\Neos\FrontendRouting\NodeAddressFactory; @@ -31,24 +29,12 @@ */ class ContentElementWrappingService { - /** - * @Flow\Inject - * @var PrivilegeManagerInterface - */ - protected $privilegeManager; - /** * @Flow\Inject * @var FusionHtmlAugmenter */ protected $htmlAugmenter; - /** - * @Flow\Inject - * @var SessionInterface - */ - protected $session; - /** * @Flow\Inject * @var ContentRepositoryRegistry @@ -81,27 +67,14 @@ public function wrapContentObject( $attributes['data-__neos-fusion-path'] = $fusionPath; $attributes['data-__neos-node-contextpath'] = $nodeAddress->serializeForUri(); - return $this->htmlAugmenter->addAttributes($content, $attributes, 'div'); - } - - /** - * Add required CSS classes to the attributes. - * - * @param array $attributes - * @param array $initialClasses - * @return array - */ - protected function addCssClasses(array $attributes, Node $node, array $initialClasses = []): array - { - $classNames = $initialClasses; - if (!$node->dimensionSpacePoint->equals($node->originDimensionSpacePoint)) { - $classNames[] = 'neos-contentelement-shine-through'; - } - - if ($classNames !== []) { - $attributes['class'] = implode(' ', $classNames); - } - - return $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) + ); } }