neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 221 forks source link

!!! TASK: Refactor `Node` property mapper to use new NodeAddress #5068

Closed mhsdesign closed 3 months ago

mhsdesign commented 4 months ago

Solves: https://github.com/neos/neos-development-collection/issues/4873

This is an intermediate step after !!! FEATURE: Overhaul node uri building before we fully move to the new node address serialisation in the Neos Ui. Everything was refactored here that does not require adjustments in the Neos Ui (and the workspace module was also not really touched).

Upgrade instructions

This change is breaking for existing Neos 9 users as the node being property mapped will require a new serialised input.

public function someAction(Node $node): {}

In Neos 8.3 you could call this action with the node like

?node=/sites/neosdemo/features/multiple-columns@user-admin;language=en_US

in Neos9-dev it was

?node=user-admin__eyJsYW5ndWFnZSI6ImVuX1VTIn0%3D__995c9174-ddd6-4d5c-cfc0-1ffc82184677

and now it must be the node address in json NodeAddress::toJson()

?node=%7B%22contentRepositoryId%22%3A%22default%22%2C%22workspaceName%22%3A%22live%22%2C%22dimensionSpacePoint%22%3A%7B%22language%22%3A%22es%22%2C%22country%22%3A%22ar%22%7D%2C%22aggregateId%22%3A%22node-1%22%7D

to build such a uri you can simply use:

$myActionUri = new Uri($this->uriBuilder->uriFor(...));
$myActionUriWithNode = UriHelper::uriWithAdditionalQueryParameters(
    $myActionUri,
    ['node' => NodeAddress::fromNode($node)->toJson()]
);

Review instructions

Checklist

mhsdesign commented 3 months ago

Okay in that case id merge it ;)