neos-development-collection icon indicating copy to clipboard operation
neos-development-collection copied to clipboard

Neos 9.0 Sub-request on Neos.Neos Frontend page broken

Open mhsdesign opened this issue 1 year ago • 0 comments

Routing in plugins like described here https://github.com/neos/Neos.Demo/pull/190#discussion_r1499742141 is currently broken.

The EventSourcedFrontendNodeRoutePartHandler expects a NodeAdress instance and not a serialized string: https://github.com/neos/neos-development-collection/blob/a2dd063fde0c5b3ccf8c96b6b260870ad63f6d17/Neos.Neos/Classes/FrontendRouting/EventSourcedFrontendNodeRoutePartHandler.php#L265

Fix:

if (!$nodeAddress instanceof NodeAddress) {
    $nodeAddress = NodeAddressFactory::create($this->contentRepositoryRegistry->get($currentRequestSiteDetectionResult->contentRepositoryId))
        ->createFromUriString($nodeAddress);
}

But the real question is why was it a string in the first place? I fear because of this weird thing? https://github.com/neos/neos-development-collection/blob/5f80a56210ba903e484e79a99d82b457a226198f/Neos.Neos/Classes/Routing/NodeIdentityConverterAspect.php#L34

With this fix the Neos.Neos:Plugin works as described here https://github.com/neos/Neos.Demo/pull/190

Things i tested in the controller (we should ad an behat test for each):

  • forward (content of other action)
  • throwStatus (500 will be upmerged and plugin will show text inside: 500 Internal Server Error
  • redirect (uri will change)
  • set arbitrary header x-mhs: foobar
  • build uri to another action (navigation)
  • render fluid view
  • render string

mhsdesign avatar Feb 22 '24 20:02 mhsdesign