Skip to content

Commit

Permalink
TASK: remove ui script tag neos 9 followup
Browse files Browse the repository at this point in the history
The `Classes/Aspects/AugmentationAspect.php` was adjusted via

neos/neos-ui#3770

but in Neos 9.0 it resides here in Neos.Neos

Thus we have to redo the adjustments.

Fixes partially neos#4951 by removing illegal php dependencies
  • Loading branch information
mhsdesign committed Aug 28, 2024
1 parent 1aeef6c commit 0d1bdf1
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions Neos.Neos/Classes/Service/ContentElementWrappingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Neos\Flow\Session\SessionInterface;
use Neos\Fusion\Service\HtmlAugmenter as FusionHtmlAugmenter;
use Neos\Neos\FrontendRouting\NodeAddressFactory;
use Neos\Neos\Ui\Domain\Service\UserLocaleService;
use Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper;

/**
* The content element wrapping service adds the necessary markup around
Expand Down Expand Up @@ -51,18 +49,6 @@ class ContentElementWrappingService
*/
protected $session;

/**
* @Flow\Inject
* @var UserLocaleService
*/
protected $userLocaleService;

/**
* @Flow\Inject
* @var NodeInfoHelper
*/
protected $nodeInfoHelper;

/**
* @Flow\Inject
* @var ContentRepositoryRegistry
Expand Down Expand Up @@ -95,20 +81,7 @@ public function wrapContentObject(
$attributes['data-__neos-fusion-path'] = $fusionPath;
$attributes['data-__neos-node-contextpath'] = $nodeAddress->serializeForUri();

$this->userLocaleService->switchToUILocale();

// TODO illegal dependency on ui
$serializedNode = json_encode($this->nodeInfoHelper->renderNodeWithPropertiesAndChildrenInformation($node));

$this->userLocaleService->switchToUILocale(true);

$wrappedContent = $this->htmlAugmenter->addAttributes($content, $attributes, 'div');
$nodeContextPath = $nodeAddress->serializeForUri();
/** @codingStandardsIgnoreStart */
$wrappedContent .= "<script data-neos-nodedata>(function(){(this['@Neos.Neos.Ui:Nodes'] = this['@Neos.Neos.Ui:Nodes'] || {})['{$nodeContextPath}'] = {$serializedNode}})()</script>";
/** @codingStandardsIgnoreEnd */

return $wrappedContent;
return $this->htmlAugmenter->addAttributes($content, $attributes, 'div');
}

/**
Expand Down

0 comments on commit 0d1bdf1

Please sign in to comment.