From f4dd2f1203cb934636d750cfd1ab791e3c4b9fc7 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:14:26 +0100 Subject: [PATCH 001/113] TASK Rewrite Neos.Neos:Shortcut to pure Fusion --- .../Private/Fusion/Prototypes/Shortcut.fusion | 97 ++++++++++++++++++- .../Templates/FusionObjects/Shortcut.html | 44 --------- 2 files changed, 93 insertions(+), 48 deletions(-) delete mode 100644 Neos.Neos/Resources/Private/Templates/FusionObjects/Shortcut.html diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion index 0039b2efbd1..364753f33d8 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion @@ -1,15 +1,104 @@ # Neos.Neos.Shortcut is given a representation for editing purposes # -prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Template) { - templatePath = 'resource://Neos.Neos/Private/Templates/FusionObjects/Shortcut.html' - +prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { targetMode = ${q(node).property('targetMode')} firstChildNode = ${q(node).children('[instanceof Neos.Neos:Document]').get(0)} target = ${q(node).property('target')} targetConverted = ${Neos.Link.hasSupportedScheme(this.target) ? Neos.Link.convertUriToObject(this.target, node) : null} targetSchema = ${Neos.Link.getScheme(this.target)} - node = ${node} + i18n = ${I18n.id(null).package('Neos.Neos').source('Main').locale(Neos.Backend.interfaceLanguage())} + + renderer = Neos.Fusion:Match { + @subject = ${props.targetMode} + + selectedTarget = Neos.Fusion:Join { + @glue = '
' + mainMessage = Neos.Fusion:Value { + fallback = 'This is a shortcut to a specific target:' + value = ${props.i18n.id('shortcut.toSpecificTarget').value(this.fallback).translate()} + } + targetMessage = Neos.Fusion:Case { + targetSelected { + condition = ${props.target} + renderer = Neos.Fusion:Match { + @subject = ${props.targetSchema} + + node = Neos.Fusion:Value { + targetUriTag = Neos.Neos:NodeLink { + node = ${props.targetConverted} + } + fallback = afx` + Click {this.targetUriTag} to continue to the page. + ` + value = ${props.i18n.id('shortcut.clickToContinueToPage').arguments([this.targetUriTag]).value(this.fallback).translate()} + } + + asset = Neos.Fusion:Value { + targetUriTag = afx` + + + {props.targetConverted.label} + + ` + fallback = afx` + Click {this.targetUriTag} to see the file. + ` + value = ${props.i18n.id('shortcut.clickToContinueToAsset').arguments([this.targetUriTag]).value(this.fallback).translate()} + } + + @default = Neos.Fusion:Value { + targetUriTag = afx` + {props.target} + ` + fallback = afx` + Click {this.targetUriTag} to open the link. + ` + value = ${props.i18n.id('shortcut.clickToContinueToExternalUrl').arguments([this.targetUriTag]).value(this.fallback).translate()} + } + } + } + noTargetSelected { + @position = 'end' + condition = true + renderer = Neos.Fusion:Value { + fallback = 'no target has been selected' + value = ${props.i18n.id('shortcut.noTargetSelected').value(this.fallback).translate()} + } + } + } + } + + firstChildNode = Neos.Fusion:Value { + targetUriTag = Neos.Neos:NodeLink { + node = ${props.firstChildNode} + } + fallback = afx` + This is a shortcut to the first child page.
+ Click {this.targetUriTag} to continue to the page. + ` + value = ${props.i18n.id('shortcut.clickToContinueToFirstChildNode').arguments([this.targetUriTag]).value(this.fallback).translate()} + } + + parentNode = Neos.Fusion:Value { + targetUriTag = Neos.Neos:NodeLink { + node = ${props.node.parent} + } + fallback = afx` + This is a shortcut to the parent page.
+ Click {this.targetUriTag} to continue to the page. + ` + value = ${props.i18n.id('shortcut.clickToContinueToParentNode').arguments([this.targetUriTag]).value(this.fallback).translate()} + } + } + + renderer.@process.contentWrap = afx` +
+

+ {value} +

+
+ ` @exceptionHandler = 'Neos\\Neos\\Fusion\\ExceptionHandlers\\NodeWrappingHandler' } diff --git a/Neos.Neos/Resources/Private/Templates/FusionObjects/Shortcut.html b/Neos.Neos/Resources/Private/Templates/FusionObjects/Shortcut.html deleted file mode 100644 index 6fa8120681a..00000000000 --- a/Neos.Neos/Resources/Private/Templates/FusionObjects/Shortcut.html +++ /dev/null @@ -1,44 +0,0 @@ -{namespace neos=Neos\Neos\ViewHelpers} -
-

- - - {neos:backend.translate(id: 'shortcut.toSpecificTarget', value: 'This is a shortcut to a specific target:')}
- - - - - - Click to continue to the page. - - - - {targetConverted.label}'}"> - Click {targetConverted.label} to see the file. - - - - {target}'}"> - Click {target} to open the link. - - - - - {neos:backend.translate(id: 'shortcut.noTargetSelected', value: '(no target has been selected)')} - -
- - - This is a shortcut to the first child page.
- Click to continue to the page. -
-
- - - This is a shortcut to the parent page.
- Click to continue to the page. -
-
-
-

-
From 9fb5ef02b7aa699f2249b133593c6e431137addb Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:25:15 +0100 Subject: [PATCH 002/113] TASK Neos.Neos:Shortcut remove translation fallbacks with https://github.com/neos/neos-development-collection/pull/3937 we dont need the fallbacks anymore ;) --- .../Private/Fusion/Prototypes/Shortcut.fusion | 37 ++++--------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion index 364753f33d8..603210b8f49 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion @@ -14,10 +14,7 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { selectedTarget = Neos.Fusion:Join { @glue = '
' - mainMessage = Neos.Fusion:Value { - fallback = 'This is a shortcut to a specific target:' - value = ${props.i18n.id('shortcut.toSpecificTarget').value(this.fallback).translate()} - } + mainMessage = ${props.i18n.id('shortcut.toSpecificTarget').translate()} targetMessage = Neos.Fusion:Case { targetSelected { condition = ${props.target} @@ -28,10 +25,7 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { targetUriTag = Neos.Neos:NodeLink { node = ${props.targetConverted} } - fallback = afx` - Click {this.targetUriTag} to continue to the page. - ` - value = ${props.i18n.id('shortcut.clickToContinueToPage').arguments([this.targetUriTag]).value(this.fallback).translate()} + value = ${props.i18n.id('shortcut.clickToContinueToPage').arguments([this.targetUriTag]).translate()} } asset = Neos.Fusion:Value { @@ -41,30 +35,21 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { {props.targetConverted.label} ` - fallback = afx` - Click {this.targetUriTag} to see the file. - ` - value = ${props.i18n.id('shortcut.clickToContinueToAsset').arguments([this.targetUriTag]).value(this.fallback).translate()} + value = ${props.i18n.id('shortcut.clickToContinueToAsset').arguments([this.targetUriTag]).translate()} } @default = Neos.Fusion:Value { targetUriTag = afx` {props.target} ` - fallback = afx` - Click {this.targetUriTag} to open the link. - ` - value = ${props.i18n.id('shortcut.clickToContinueToExternalUrl').arguments([this.targetUriTag]).value(this.fallback).translate()} + value = ${props.i18n.id('shortcut.clickToContinueToExternalUrl').arguments([this.targetUriTag]).translate()} } } } noTargetSelected { @position = 'end' condition = true - renderer = Neos.Fusion:Value { - fallback = 'no target has been selected' - value = ${props.i18n.id('shortcut.noTargetSelected').value(this.fallback).translate()} - } + renderer = ${props.i18n.id('shortcut.noTargetSelected').translate()} } } } @@ -73,22 +58,14 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { targetUriTag = Neos.Neos:NodeLink { node = ${props.firstChildNode} } - fallback = afx` - This is a shortcut to the first child page.
- Click {this.targetUriTag} to continue to the page. - ` - value = ${props.i18n.id('shortcut.clickToContinueToFirstChildNode').arguments([this.targetUriTag]).value(this.fallback).translate()} + value = ${props.i18n.id('shortcut.clickToContinueToFirstChildNode').arguments([this.targetUriTag]).translate()} } parentNode = Neos.Fusion:Value { targetUriTag = Neos.Neos:NodeLink { node = ${props.node.parent} } - fallback = afx` - This is a shortcut to the parent page.
- Click {this.targetUriTag} to continue to the page. - ` - value = ${props.i18n.id('shortcut.clickToContinueToParentNode').arguments([this.targetUriTag]).value(this.fallback).translate()} + value = ${props.i18n.id('shortcut.clickToContinueToParentNode').arguments([this.targetUriTag]).translate()} } } From a776cb06f35dba3e1ea4a8506ae83a004a0598c0 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:37:25 +0100 Subject: [PATCH 003/113] TASK Neos.Neos:Shortcut cleanup Fusion nesting --- .../Private/Fusion/Prototypes/Shortcut.fusion | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion index 603210b8f49..bb6b762ef63 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion @@ -15,43 +15,38 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { selectedTarget = Neos.Fusion:Join { @glue = '
' mainMessage = ${props.i18n.id('shortcut.toSpecificTarget').translate()} - targetMessage = Neos.Fusion:Case { - targetSelected { - condition = ${props.target} - renderer = Neos.Fusion:Match { - @subject = ${props.targetSchema} + targetSelected = Neos.Fusion:Match { + @if.isTarget = ${props.target} - node = Neos.Fusion:Value { - targetUriTag = Neos.Neos:NodeLink { - node = ${props.targetConverted} - } - value = ${props.i18n.id('shortcut.clickToContinueToPage').arguments([this.targetUriTag]).translate()} - } + @subject = ${props.targetSchema} - asset = Neos.Fusion:Value { - targetUriTag = afx` - - - {props.targetConverted.label} - - ` - value = ${props.i18n.id('shortcut.clickToContinueToAsset').arguments([this.targetUriTag]).translate()} - } - - @default = Neos.Fusion:Value { - targetUriTag = afx` - {props.target} - ` - value = ${props.i18n.id('shortcut.clickToContinueToExternalUrl').arguments([this.targetUriTag]).translate()} - } + node = Neos.Fusion:Value { + targetUriTag = Neos.Neos:NodeLink { + node = ${props.targetConverted} } + value = ${props.i18n.id('shortcut.clickToContinueToPage').arguments([this.targetUriTag]).translate()} } - noTargetSelected { - @position = 'end' - condition = true - renderer = ${props.i18n.id('shortcut.noTargetSelected').translate()} + + asset = Neos.Fusion:Value { + targetUriTag = afx` + + + {props.targetConverted.label} + + ` + value = ${props.i18n.id('shortcut.clickToContinueToAsset').arguments([this.targetUriTag]).translate()} + } + + @default = Neos.Fusion:Value { + targetUriTag = afx` + {props.target} + ` + value = ${props.i18n.id('shortcut.clickToContinueToExternalUrl').arguments([this.targetUriTag]).translate()} } } + + noTargetSelected = ${props.i18n.id('shortcut.noTargetSelected').translate()} + noTargetSelected.@if.isNotTarget = ${!props.target} } firstChildNode = Neos.Fusion:Value { From 1ce5b154f44cd84199ed70a73f4aabb8e06a10c3 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:42:13 +0100 Subject: [PATCH 004/113] TASK Neos.Neos:Shortcut dont cache the backend view Otherwise, changes from `Neos.Backend.interfaceLanguage()` will not be reflected. And its like a backend module -> which i wouldn't cache also. --- .../Resources/Private/Fusion/Prototypes/Shortcut.fusion | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion index bb6b762ef63..d22fafbe9ef 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion @@ -72,5 +72,12 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { ` + @cache { + mode = "uncached" + context { + 0 = "node" + } + } + @exceptionHandler = 'Neos\\Neos\\Fusion\\ExceptionHandlers\\NodeWrappingHandler' } From d012fe602348426f3f418d4b477c224d5b342277 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 12 Nov 2022 11:13:41 +0100 Subject: [PATCH 005/113] BUGFIX 3835 apply suggestions from code review --- .../Private/Fusion/Prototypes/Shortcut.fusion | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion index d22fafbe9ef..8b050ee433d 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion @@ -28,12 +28,16 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { } asset = Neos.Fusion:Value { - targetUriTag = afx` - - - {props.targetConverted.label} - - ` + targetUriTag = Neos.Fusion:Tag { + tagName = 'a' + attributes { + target = '_blank' + href = Neos.Fusion:ResourceUri { + resource = ${props.targetConverted.resource} + } + } + content = ${props.targetConverted.label} + } value = ${props.i18n.id('shortcut.clickToContinueToAsset').arguments([this.targetUriTag]).translate()} } From 888a66bb428e74fff67619b8a9bbbfa5cb8d2ced Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Tue, 30 May 2023 17:59:22 +0200 Subject: [PATCH 006/113] BUGFIX: Allow disabling of auto-created Image Variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes support for the setting `autoCreateImageVariantPresets` that was documented for a long time but never actually evaluated. This change set: * Adjusts `AssetService::assetCreated()` signal to only trigger `AssetVariantGenerator::createVariants()` if the `autoCreateImageVariantPresets` flag is set * Sets the default value of the flag to `true` for greater backwards compatibility * Adjusts `AssetVariantGenerator::createVariant()` to only create a variant if it does not exist already – previously multiple variants with the same identifiers could be created for a single asset leading to undeterministic behavior * Adds a button "Create missing Variants" to the `Variants` tab of the Media Module allowing editors to manually trigger creation of (missing) variants. Fixes: #4300 --- .../Classes/Controller/AssetController.php | 33 +++++++++++++++++++ Neos.Media.Browser/Configuration/Policy.yaml | 2 +- .../Private/Templates/Asset/Variants.html | 7 ++++ .../Private/Translations/en/Main.xlf | 3 ++ .../Domain/Service/AssetVariantGenerator.php | 6 ++++ Neos.Media/Classes/Package.php | 9 ++++- Neos.Media/Configuration/Settings.yaml | 2 +- Neos.Media/Documentation/VariantPresets.rst | 6 ++-- 8 files changed, 62 insertions(+), 6 deletions(-) diff --git a/Neos.Media.Browser/Classes/Controller/AssetController.php b/Neos.Media.Browser/Classes/Controller/AssetController.php index e82e3d6df41..b1e9ec03449 100644 --- a/Neos.Media.Browser/Classes/Controller/AssetController.php +++ b/Neos.Media.Browser/Classes/Controller/AssetController.php @@ -50,6 +50,7 @@ use Neos\Media\Domain\Repository\AssetRepository; use Neos\Media\Domain\Repository\TagRepository; use Neos\Media\Domain\Service\AssetService; +use Neos\Media\Domain\Service\AssetVariantGenerator; use Neos\Media\Exception\AssetServiceException; use Neos\Media\TypeConverter\AssetInterfaceConverter; use Neos\Neos\Controller\BackendUserTranslationTrait; @@ -140,6 +141,12 @@ class AssetController extends ActionController */ protected $assetSourceService; + /** + * @Flow\Inject + * @var AssetVariantGenerator + */ + protected $assetVariantGenerator; + /** * @var AssetSourceInterface[] */ @@ -468,6 +475,32 @@ public function variantsAction(string $assetSourceIdentifier, string $assetProxy } } + /** + * (Re-)create all variants for the given image + * + * @param string $assetSourceIdentifier + * @param string $assetProxyIdentifier + * @param string $overviewAction + * @throws StopActionException + * @throws UnsupportedRequestTypeException + */ + public function createVariantsAction(string $assetSourceIdentifier, string $assetProxyIdentifier, string $overviewAction): void + { + $assetSource = $this->assetSources[$assetSourceIdentifier]; + $assetProxyRepository = $assetSource->getAssetProxyRepository(); + + $assetProxy = $assetProxyRepository->getAssetProxy($assetProxyIdentifier); + $asset = $this->persistenceManager->getObjectByIdentifier($assetProxy->getLocalAssetIdentifier(), Asset::class); + + /** @var VariantSupportInterface $originalAsset */ + $originalAsset = ($asset instanceof AssetVariantInterface ? $asset->getOriginalAsset() : $asset); + + $this->assetVariantGenerator->createVariants($originalAsset); + $this->assetRepository->update($originalAsset); + + $this->redirect('variants', null, null, ['assetSourceIdentifier' => $assetSourceIdentifier, 'assetProxyIdentifier' => $assetProxyIdentifier, 'overviewAction' => $overviewAction]); + } + /** * @return void * @throws NoSuchArgumentException diff --git a/Neos.Media.Browser/Configuration/Policy.yaml b/Neos.Media.Browser/Configuration/Policy.yaml index 24e025b8edb..a237114296c 100644 --- a/Neos.Media.Browser/Configuration/Policy.yaml +++ b/Neos.Media.Browser/Configuration/Policy.yaml @@ -6,7 +6,7 @@ privilegeTargets: 'Neos.Media.Browser:ManageAssets': label: Allowed to manage assets - matcher: 'method(Neos\Media\Browser\Controller\(Asset|Image)Controller->(index|new|show|edit|update|initializeCreate|create|replaceAssetResource|updateAssetResource|initializeUpload|upload|tagAsset|delete|createTag|editTag|updateTag|deleteTag|addAssetToCollection|relatedNodes|variants)Action()) || method(Neos\Media\Browser\Controller\ImageVariantController->(update)Action())' + matcher: 'method(Neos\Media\Browser\Controller\(Asset|Image)Controller->(index|new|show|edit|update|initializeCreate|create|replaceAssetResource|updateAssetResource|initializeUpload|upload|tagAsset|delete|createTag|editTag|updateTag|deleteTag|addAssetToCollection|relatedNodes|variants|createVariants)Action()) || method(Neos\Media\Browser\Controller\ImageVariantController->(update)Action())' 'Neos.Media.Browser:AssetUsage': label: Allowed to calculate asset usages diff --git a/Neos.Media.Browser/Resources/Private/Templates/Asset/Variants.html b/Neos.Media.Browser/Resources/Private/Templates/Asset/Variants.html index 0c035452335..e024a452100 100644 --- a/Neos.Media.Browser/Resources/Private/Templates/Asset/Variants.html +++ b/Neos.Media.Browser/Resources/Private/Templates/Asset/Variants.html @@ -24,6 +24,13 @@ + + + diff --git a/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf b/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf index 81cddf67e1e..1f9682910d3 100644 --- a/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf +++ b/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf @@ -427,6 +427,9 @@ No document node found for this node + + Create missing Variants + diff --git a/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php b/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php index 4a8224515c0..77797c1a514 100644 --- a/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php +++ b/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php @@ -127,6 +127,12 @@ public function createVariant(AssetInterface $asset, string $presetIdentifier, s $createdVariant = null; $preset = $this->getVariantPresets()[$presetIdentifier] ?? null; if ($preset instanceof VariantPreset && $preset->matchesMediaType($asset->getMediaType())) { + + $existingVariant = $asset->getVariant($presetIdentifier, $variantIdentifier); + if ($existingVariant !== null) { + return $existingVariant; + } + $variantConfiguration = $preset->variants()[$variantIdentifier] ?? null; if ($variantConfiguration instanceof Configuration\Variant) { diff --git a/Neos.Media/Classes/Package.php b/Neos.Media/Classes/Package.php index 299f827307c..dd5b7b06fb5 100644 --- a/Neos.Media/Classes/Package.php +++ b/Neos.Media/Classes/Package.php @@ -11,8 +11,10 @@ * source code. */ +use Neos\Flow\Configuration\ConfigurationManager; use Neos\Flow\Core\Bootstrap; use Neos\Flow\Package\Package as BasePackage; +use Neos\Media\Domain\Model\AssetInterface; use Neos\Media\Domain\Model\ImportedAssetManager; use Neos\Media\Domain\Service\AssetService; use Neos\Media\Domain\Service\AssetVariantGenerator; @@ -30,7 +32,12 @@ class Package extends BasePackage public function boot(Bootstrap $bootstrap) { $dispatcher = $bootstrap->getSignalSlotDispatcher(); - $dispatcher->connect(AssetService::class, 'assetCreated', AssetVariantGenerator::class, 'createVariants'); + $dispatcher->connect(AssetService::class, 'assetCreated', function (AssetInterface $asset) use ($bootstrap) { + $configurationManager = $bootstrap->getObjectManager()->get(ConfigurationManager::class); + if ($configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Media.autoCreateImageVariantPresets')) { + $bootstrap->getObjectManager()->get(AssetVariantGenerator::class)->createVariants($asset); + } + }); $dispatcher->connect(AssetService::class, 'assetCreated', ThumbnailGenerator::class, 'createThumbnails'); $dispatcher->connect(AssetService::class, 'assetCreated', ImportedAssetManager::class, 'registerCreatedAsset'); $dispatcher->connect(AssetService::class, 'assetRemoved', ImportedAssetManager::class, 'registerRemovedAsset'); diff --git a/Neos.Media/Configuration/Settings.yaml b/Neos.Media/Configuration/Settings.yaml index 035e4020d23..8025a3d5774 100644 --- a/Neos.Media/Configuration/Settings.yaml +++ b/Neos.Media/Configuration/Settings.yaml @@ -65,7 +65,7 @@ Neos: # Variant presets variantPresets: [] # Automatically create asset variants for configured presets when assets are added - autoCreateImageVariantPresets: false + autoCreateImageVariantPresets: true thumbnailGenerators: diff --git a/Neos.Media/Documentation/VariantPresets.rst b/Neos.Media/Documentation/VariantPresets.rst index 02976ec41b2..d43dd11e921 100644 --- a/Neos.Media/Documentation/VariantPresets.rst +++ b/Neos.Media/Documentation/VariantPresets.rst @@ -92,14 +92,14 @@ The following example shows the required structure and possible fields of the pr options: aspectRatio: '1:1' -The automatic variant generation for new assets has to be enabled via setting as -by default this feature is disabled. +The automatic variant generation for new assets is active by default. +It can be disabled via setting: .. code-block:: yaml Neos: Media: - autoCreateImageVariantPresets: true + autoCreateImageVariantPresets: false To show and edit the variants in the media module the variants tab has to be enabled. From 3582ca2b8a3776861641251ec62a967608532e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anke=20H=C3=A4slich?= Date: Thu, 13 Jul 2023 19:03:48 +0200 Subject: [PATCH 007/113] Apply suggestions from code review Co-authored-by: Bastian Waidelich --- Neos.Media.Browser/Classes/Controller/AssetController.php | 2 +- Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.Media.Browser/Classes/Controller/AssetController.php b/Neos.Media.Browser/Classes/Controller/AssetController.php index b1e9ec03449..141326a6951 100644 --- a/Neos.Media.Browser/Classes/Controller/AssetController.php +++ b/Neos.Media.Browser/Classes/Controller/AssetController.php @@ -476,7 +476,7 @@ public function variantsAction(string $assetSourceIdentifier, string $assetProxy } /** - * (Re-)create all variants for the given image + * Create missing variants for the given image * * @param string $assetSourceIdentifier * @param string $assetProxyIdentifier diff --git a/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf b/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf index 1f9682910d3..07f3354ed02 100644 --- a/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf +++ b/Neos.Media.Browser/Resources/Private/Translations/en/Main.xlf @@ -428,7 +428,7 @@ No document node found for this node - Create missing Variants + Create missing variants From c3da3633873d30147fc10033df0969f4c83f4b39 Mon Sep 17 00:00:00 2001 From: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 17 Sep 2023 12:25:26 +0200 Subject: [PATCH 008/113] BUGFIX: `props` will be unset after an exception Resolves #4525 --- .../Classes/FusionObjects/ComponentImplementation.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php b/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php index 8b83ad88509..f1bc064d58d 100644 --- a/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php +++ b/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php @@ -80,8 +80,10 @@ protected function getProps(array $context): \ArrayAccess protected function render(array $context) { $this->runtime->pushContextArray($context); - $result = $this->runtime->render($this->path . '/renderer'); - $this->runtime->popContext(); - return $result; + try { + return $this->runtime->render($this->path . '/renderer'); + } finally { + $this->runtime->popContext(); + } } } From ac88f59aabc8c0abca27c5b270ad3f71c09ba0fe Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Mon, 18 Sep 2023 20:41:07 +0200 Subject: [PATCH 009/113] !!! TASK Make NodeType::getPropertyType throw if property not declared Resolves #4477 --- .../Classes/NodeType/NodeType.php | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php index 91f4d254b78..337ba220878 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php @@ -409,22 +409,32 @@ public function getProperties(): array } /** - * Returns the configured type of the specified property + * Check if the property is configured in the schema. + */ + public function hasProperty(string $propertyName): bool + { + $this->initialize(); + + return isset($this->fullConfiguration['properties'][$propertyName]); + } + + /** + * Returns the configured type of the specified property, and falls back to 'string'. * - * @param string $propertyName Name of the property + * @throws \InvalidArgumentException if the property is not configured */ public function getPropertyType(string $propertyName): string { $this->initialize(); - if ( - !isset($this->fullConfiguration['properties']) - || !isset($this->fullConfiguration['properties'][$propertyName]) - || !isset($this->fullConfiguration['properties'][$propertyName]['type']) - ) { - return 'string'; + if (!$this->hasProperty($propertyName)) { + throw new \InvalidArgumentException( + sprintf('NodeType schema has no property "%s" configured. Cannot read its type.', $propertyName), + 1695062252040 + ); } - return $this->fullConfiguration['properties'][$propertyName]['type']; + + return $this->fullConfiguration['properties'][$propertyName]['type'] ?? 'string'; } /** From cc5fe089e60f5112ad2727bfe0fa27cdc96b5a6e Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 23 Sep 2023 22:37:37 +0200 Subject: [PATCH 010/113] !!! TASK: Remove NodeSearchServiceInterface and implementation --- .../Domain/Service/NodeSearchService.php | 42 ------------------- .../Service/NodeSearchServiceInterface.php | 28 ------------- Neos.Neos/Configuration/Objects.yaml | 4 -- 3 files changed, 74 deletions(-) delete mode 100644 Neos.Neos/Classes/Domain/Service/NodeSearchService.php delete mode 100644 Neos.Neos/Classes/Domain/Service/NodeSearchServiceInterface.php diff --git a/Neos.Neos/Classes/Domain/Service/NodeSearchService.php b/Neos.Neos/Classes/Domain/Service/NodeSearchService.php deleted file mode 100644 index bd3ed2bb289..00000000000 --- a/Neos.Neos/Classes/Domain/Service/NodeSearchService.php +++ /dev/null @@ -1,42 +0,0 @@ - $searchNodeTypes - */ - public function findByProperties( - string $term, - array $searchNodeTypes, - ?Node $startingPoint = null - ): never { - throw new \InvalidArgumentException('Cannot find nodes with the current set of arguments', 1651923867); - } -} diff --git a/Neos.Neos/Classes/Domain/Service/NodeSearchServiceInterface.php b/Neos.Neos/Classes/Domain/Service/NodeSearchServiceInterface.php deleted file mode 100644 index abd58aa5681..00000000000 --- a/Neos.Neos/Classes/Domain/Service/NodeSearchServiceInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - $searchNodeTypes - */ - public function findByProperties(string $term, array $searchNodeTypes): Nodes; -} diff --git a/Neos.Neos/Configuration/Objects.yaml b/Neos.Neos/Configuration/Objects.yaml index 6af4b7726b6..fdc548b70fe 100644 --- a/Neos.Neos/Configuration/Objects.yaml +++ b/Neos.Neos/Configuration/Objects.yaml @@ -31,10 +31,6 @@ Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder: factoryObjectName: 'Doctrine\ORM\EntityManagerInterface' factoryMethodName: 'getConnection' - -Neos\Neos\Domain\Service\NodeSearchServiceInterface: - className: Neos\Neos\Domain\Service\NodeSearchService - Neos\Neos\Service\XliffService: properties: xliffToJsonTranslationsCache: From 55e1ebfd6825bc17902706a1a1cf7b24c6e80955 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 24 Sep 2023 21:34:49 +0200 Subject: [PATCH 011/113] BUGFIX: Fix `${q(node).property("undefined")}` access. NodeType schema has no property "undefined" configured. Cannot read its type. --- .../Classes/FlowQueryOperations/PropertyOperation.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php index 127a0244727..dc3701cdda4 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php @@ -110,7 +110,11 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): mixed return ObjectAccess::getPropertyPath($element, substr($propertyName, 1)); } - if ($element->nodeType->getPropertyType($propertyName) === 'reference') { + $propertyType = $element->nodeType->hasProperty($propertyName) + ? $element->nodeType->getPropertyType($propertyName) + : null; + + if ($propertyType === 'reference') { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($element); return ( $subgraph->findReferences( @@ -120,7 +124,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): mixed )?->node; } - if ($element->nodeType->getPropertyType($propertyName) === 'references') { + if ($propertyType === 'references') { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($element); return $subgraph->findReferences( $element->nodeAggregateId, From e6fca326a576557d0a25c14cab9561846a8372ed Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Tue, 26 Sep 2023 12:24:35 +0200 Subject: [PATCH 012/113] BUGFIX: Reduce nodetype schema size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this change the following optimisations are done to improve speed and reduce size of the schema generation: * Abstract nodetypes are not queried anymore for constraints as they are already resolved by the nodetype manager. * Entries in the inheritance map and constraints will be skipped if they don’t contain any data. These optimisations reduce the size of the schema in the Neos.Demo from ~380KB to ~307KB and improve the response time by ~20%. The more nodetypes a project has, the bigger the benefit is. --- .../Classes/Service/NodeTypeSchemaBuilder.php | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php b/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php index 50f5347bee2..c9464c20770 100644 --- a/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php +++ b/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php @@ -12,7 +12,6 @@ */ use Neos\Flow\Annotations as Flow; -use Neos\ContentRepository\Domain\Model\NodeType; /** * Renders the Node Type Schema in a format the User Interface understands; additionally pre-calculating node constraints @@ -54,19 +53,24 @@ public function generateNodeTypeSchema() 'constraints' => $this->generateConstraints() ]; + // We need to include abstract nodetypes as the UI required some basic types like Neos.Neos:Document and Neos.Neos:Content $nodeTypes = $this->nodeTypeManager->getNodeTypes(true); - /** @var NodeType $nodeType */ foreach ($nodeTypes as $nodeTypeName => $nodeType) { if ($nodeType->isAbstract() === false) { $configuration = $nodeType->getFullConfiguration(); $schema['nodeTypes'][$nodeTypeName] = $configuration; $schema['nodeTypes'][$nodeTypeName]['label'] = $nodeType->getLabel(); + + // Remove the postprocessors, as they are not needed in the UI + unset($schema['nodeTypes'][$nodeTypeName]['postprocessors']); } - $schema['inheritanceMap']['subTypes'][$nodeTypeName] = []; - foreach ($this->nodeTypeManager->getSubNodeTypes($nodeType->getName(), true) as $subNodeType) { - /** @var NodeType $subNodeType */ - $schema['inheritanceMap']['subTypes'][$nodeTypeName][] = $subNodeType->getName(); + $subTypes = []; + foreach ($this->nodeTypeManager->getSubNodeTypes($nodeType->getName(), false) as $subNodeType) { + $subTypes[] = $subNodeType->getName(); + } + if ($subTypes) { + $schema['inheritanceMap']['subTypes'][$nodeTypeName] = $subTypes; } } @@ -81,29 +85,31 @@ public function generateNodeTypeSchema() protected function generateConstraints() { $constraints = []; - $nodeTypes = $this->nodeTypeManager->getNodeTypes(true); - /** @var NodeType $nodeType */ + $nodeTypes = $this->nodeTypeManager->getNodeTypes(false); foreach ($nodeTypes as $nodeTypeName => $nodeType) { - if ($nodeType->isAbstract()) { - continue; - } - $constraints[$nodeTypeName] = [ - 'nodeTypes' => [], - 'childNodes' => [] - ]; + $nodeTypeConstraints = []; + $childNodeConstraints = []; + foreach ($nodeTypes as $innerNodeTypeName => $innerNodeType) { if ($nodeType->allowsChildNodeType($innerNodeType)) { - $constraints[$nodeTypeName]['nodeTypes'][$innerNodeTypeName] = true; + $nodeTypeConstraints[$innerNodeTypeName] = true; } } - foreach ($nodeType->getAutoCreatedChildNodes() as $key => $_x) { + foreach (array_keys($nodeType->getAutoCreatedChildNodes()) as $key) { foreach ($nodeTypes as $innerNodeTypeName => $innerNodeType) { if ($nodeType->allowsGrandchildNodeType($key, $innerNodeType)) { - $constraints[$nodeTypeName]['childNodes'][$key]['nodeTypes'][$innerNodeTypeName] = true; + $childNodeConstraints[$key]['nodeTypes'][$innerNodeTypeName] = true; } } } + + if ($nodeTypeConstraints || $childNodeConstraints) { + $constraints[$nodeTypeName] = [ + 'nodeTypes' => $nodeTypeConstraints, + 'childNodes' => $childNodeConstraints, + ]; + } } return $constraints; From 4289980987fc34da4897fb4ea3a958fd8841efb0 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Fri, 13 Oct 2023 14:09:45 +0200 Subject: [PATCH 013/113] TASK: Ignore abstract nodetypes except the ones required by the Neos.UI --- .../Classes/Service/NodeTypeSchemaBuilder.php | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php b/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php index c9464c20770..43c51b5495d 100644 --- a/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php +++ b/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php @@ -26,6 +26,16 @@ class NodeTypeSchemaBuilder */ protected $nodeTypeManager; + /** + * The Neos UI package needs a few additional abstract nodetypes to be present in the schema. + * This will be properly cleaned up when this service is moved into the Neos.UI package as we only + * need the schema there. + * + * @Flow\InjectConfiguration(path="nodeTypeRoles", package="Neos.Neos.Ui") + * @var array + */ + protected $nodeTypeRoles; + /** * The preprocessed node type schema contains everything we need for the UI: * @@ -53,8 +63,17 @@ public function generateNodeTypeSchema() 'constraints' => $this->generateConstraints() ]; - // We need to include abstract nodetypes as the UI required some basic types like Neos.Neos:Document and Neos.Neos:Content - $nodeTypes = $this->nodeTypeManager->getNodeTypes(true); + // We need skip abstract nodetypes as they are not instantiated by the UI + $nodeTypes = $this->nodeTypeManager->getNodeTypes(false); + + // Get special abstract nodetypes required by the Neos.UI + if ($this->nodeTypeRoles) { + $additionalNodeTypeNames = array_values($this->nodeTypeRoles); + foreach ($additionalNodeTypeNames as $additionalNodeTypeName) { + $nodeTypes[$additionalNodeTypeName] = $this->nodeTypeManager->getNodeType($additionalNodeTypeName); + } + } + foreach ($nodeTypes as $nodeTypeName => $nodeType) { if ($nodeType->isAbstract() === false) { $configuration = $nodeType->getFullConfiguration(); From 8e04b9ad9f83857c6c654d02f79e3add20c4a1b4 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Mon, 16 Oct 2023 22:37:01 +0200 Subject: [PATCH 014/113] TASK: Render menu prototypes without fluid The prototypes `Neos.Neos:Menu`, `Neos.Neos:DimensionsMenu` and `Neos.Neos:BreadcrumbMenu` are now implemented in pure fusion. The prototype `Neos.Neos:MenuItemListRenderer` is added that is used by those prototypes to render the result as a very basic unordered list. The flag `calculateItemStates` is added to the prototypes `Neos.Neos:MenuItems`, `Neos.Neos:DimensionsMenuItems` and `Neos.Neos:BreadcrumbMenuItems` with the default value being false. Once enabled the itemState of each menuItem is calculated. In addition the following issues are fixed: - DimensionMenuItems did not contain a url - MenuItems did not calculate item states. --- .../AbstractMenuItemsImplementation.php | 32 ++++ .../Classes/Fusion/DimensionMenuItem.php | 25 +++ .../DimensionsMenuItemsImplementation.php | 33 ++-- Neos.Neos/Classes/Fusion/MenuItem.php | 55 +----- Neos.Neos/Classes/Fusion/MenuItemState.php | 19 ++- .../Fusion/MenuItemsImplementation.php | 44 +++-- .../References/NeosFusionReference.rst | 158 ++++-------------- .../Fusion/Prototypes/BreadcrumbMenu.fusion | 34 ++-- .../Prototypes/BreadcrumbMenuItems.fusion | 4 + .../Fusion/Prototypes/DimensionsMenu.fusion | 47 +++--- .../Private/Fusion/Prototypes/Menu.fusion | 48 +----- .../Prototypes/MenuItemListRenderer.fusion | 17 ++ .../Fusion/Prototypes/MenuItems.fusion | 1 + .../FusionObjects/BreadcrumbMenu.html | 18 -- .../FusionObjects/DimensionsMenu.html | 22 --- .../Private/Templates/FusionObjects/Menu.html | 18 -- 16 files changed, 239 insertions(+), 336 deletions(-) create mode 100644 Neos.Neos/Classes/Fusion/DimensionMenuItem.php create mode 100644 Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItemListRenderer.fusion delete mode 100644 Neos.Neos/Resources/Private/Templates/FusionObjects/BreadcrumbMenu.html delete mode 100644 Neos.Neos/Resources/Private/Templates/FusionObjects/DimensionsMenu.html delete mode 100644 Neos.Neos/Resources/Private/Templates/FusionObjects/Menu.html diff --git a/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php index a732ddf97d3..29323c4aeb2 100644 --- a/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php @@ -60,6 +60,13 @@ abstract class AbstractMenuItemsImplementation extends AbstractFusionObject */ protected $renderHiddenInIndex; + /** + * Internal cache for the calculateItemStates property. + * + * @var boolean + */ + protected $calculateItemStates; + /** * Rootline of all nodes from the current node to the site root node, keys are depth of nodes. * @@ -70,6 +77,20 @@ abstract class AbstractMenuItemsImplementation extends AbstractFusionObject #[Flow\Inject] protected ContentRepositoryRegistry $contentRepositoryRegistry; + /** + * Should nodes that have "hiddenInIndex" set still be visible in this menu. + * + * @return boolean + */ + public function isCalculateItemStatesEnabled(): bool + { + if ($this->calculateItemStates === null) { + $this->calculateItemStates = (bool)$this->fusionValue('calculateItemStates'); + } + + return $this->calculateItemStates; + } + /** * Should nodes that have "hiddenInIndex" set still be visible in this menu. * @@ -169,4 +190,15 @@ protected function getCurrentNodeRootline(): array return $this->currentNodeRootline; } + + protected function buildUri(Node $node): string + { + $this->runtime->pushContextArray([ + 'itemNode' => $node, + 'documentNode' => $node, + ]); + $uri = $this->runtime->render($this->path . '/itemUriRenderer'); + $this->runtime->popContext(); + return $uri; + } } diff --git a/Neos.Neos/Classes/Fusion/DimensionMenuItem.php b/Neos.Neos/Classes/Fusion/DimensionMenuItem.php new file mode 100644 index 00000000000..08a400dc5aa --- /dev/null +++ b/Neos.Neos/Classes/Fusion/DimensionMenuItem.php @@ -0,0 +1,25 @@ +|null $targetDimensions + */ + public function __construct( + public readonly ?Node $node, + public readonly ?MenuItemState $state = null, + public readonly ?string $label = null, + public readonly ?array $targetDimensions = null, + public readonly ?string $uri = null + ) { + } +} diff --git a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php index 50871a64ebd..facc2047e57 100644 --- a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php @@ -39,7 +39,7 @@ public function getDimension(): array /** * Builds the array of Menu items for this variant menu - * @return array> + * @return array */ protected function buildItems(): array { @@ -86,12 +86,13 @@ protected function buildItems(): array $metadata = $this->determineMetadata($dimensionSpacePoint, $dimensionMenuItemsImplementationInternals); if ($variant === null || !$this->isNodeHidden($variant)) { - $menuItems[] = [ - 'node' => $variant, - 'state' => $this->calculateItemState($variant), - 'label' => $this->determineLabel($variant, $metadata), - 'targetDimensions' => $metadata - ]; + $menuItems[] = new DimensionMenuItem( + $variant, + $this->isCalculateItemStatesEnabled() ? $this->calculateItemState($variant) : null, + $this->determineLabel($variant, $metadata), + $metadata, + $variant ? $this->buildUri($variant) : null + ); } } } @@ -100,15 +101,15 @@ protected function buildItems(): array if ($contentDimensionIdentifierToLimitTo && $valuesToRestrictTo) { $order = array_flip($valuesToRestrictTo); usort($menuItems, function ( - array $menuItemA, - array $menuItemB + DimensionMenuItem $menuItemA, + DimensionMenuItem $menuItemB ) use ( $order, $contentDimensionIdentifierToLimitTo ) { - return (int)$order[$menuItemA['node']?->subgraphIdentity->dimensionSpacePoint->getCoordinate( + return (int)$order[$menuItemA->node?->subgraphIdentity->dimensionSpacePoint->getCoordinate( $contentDimensionIdentifierToLimitTo - )] <=> (int)$order[$menuItemB['node']?->subgraphIdentity->dimensionSpacePoint->getCoordinate( + )] <=> (int)$order[$menuItemB->node?->subgraphIdentity->dimensionSpacePoint->getCoordinate( $contentDimensionIdentifierToLimitTo )]; }); @@ -218,19 +219,19 @@ protected function determineLabel(?Node $variant = null, array $metadata = []): } } - protected function calculateItemState(?Node $variant = null): string + protected function calculateItemState(?Node $variant = null): MenuItemState { if (is_null($variant)) { - return self::STATE_ABSENT; + return MenuItemState::absent(); } if ($variant === $this->currentNode) { - return self::STATE_CURRENT; + return MenuItemState::current(); } - - return self::STATE_NORMAL; + return MenuItemState::normal(); } + /** * In some cases generalization of the other dimension values is feasible * to find a dimension space point in which a variant can be resolved diff --git a/Neos.Neos/Classes/Fusion/MenuItem.php b/Neos.Neos/Classes/Fusion/MenuItem.php index 86c23f1947d..1ee3387c0e7 100644 --- a/Neos.Neos/Classes/Fusion/MenuItem.php +++ b/Neos.Neos/Classes/Fusion/MenuItem.php @@ -11,58 +11,17 @@ */ final class MenuItem { - protected Node $node; - - protected ?MenuItemState $state; - - protected ?string $label; - - protected int $menuLevel; - - /** - * @var array - */ - protected array $children; - - protected ?string $uri; - /** * @param array $children */ public function __construct( - Node $node, - ?MenuItemState $state = null, - ?string $label = null, - int $menuLevel = 1, - array $children = [], - string $uri = null + public readonly Node $node, + public readonly ?MenuItemState $state = null, + public readonly ?string $label = null, + public readonly int $menuLevel = 1, + public readonly array $children = [], + public readonly ?string $uri = null ) { - $this->node = $node; - $this->state = $state; - $this->label = $label; - $this->menuLevel = $menuLevel; - $this->children = $children; - $this->uri = $uri; - } - - public function getNode(): Node - { - return $this->node; - } - - public function getState(): ?MenuItemState - { - return $this->state; - } - - public function getLabel(): ?string - { - return $this->label; - } - - public function getMenuLevel(): int - { - return $this->menuLevel; } /** @@ -75,7 +34,7 @@ public function getChildren(): array /** * @return array - * @deprecated Use getChildren instead + * @deprecated Use children instead */ public function getSubItems(): array { diff --git a/Neos.Neos/Classes/Fusion/MenuItemState.php b/Neos.Neos/Classes/Fusion/MenuItemState.php index 5bae271d731..a45ec59bbfe 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemState.php +++ b/Neos.Neos/Classes/Fusion/MenuItemState.php @@ -41,9 +41,22 @@ public function __construct(string $state) } - /** - * @return MenuItemState - */ + + public static function active(): MenuItemState + { + return new MenuItemState(self::STATE_ACTIVE); + } + + public static function current(): MenuItemState + { + return new MenuItemState(self::STATE_CURRENT); + } + + public static function absent(): MenuItemState + { + return new MenuItemState(self::STATE_ABSENT); + } + public static function normal(): MenuItemState { return new MenuItemState(self::STATE_NORMAL); diff --git a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php index dfb9a4f51d4..bdadc138e94 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php @@ -15,6 +15,7 @@ namespace Neos\Neos\Fusion; use Neos\ContentRepository\Core\NodeType\NodeTypeName; +use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindSubtreeFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes; @@ -55,6 +56,11 @@ class MenuItemsImplementation extends AbstractMenuItemsImplementation */ protected $maximumLevels; + /** + * Internal cache for the ancestors of the currentNode. + */ + protected ?Nodes $currentNodeAncestors = null; + /** * Runtime cache for the node type constraints to be applied */ @@ -200,7 +206,7 @@ protected function traverseChildren(Subtree $subtree): MenuItem return new MenuItem( $node, - MenuItemState::normal(), + $this->isCalculateItemStatesEnabled() ? $this->calculateItemState($node) : null, $node->getLabel(), $subtree->level, $children, @@ -232,6 +238,7 @@ protected function findMenuStartingPoint(): ?Node 1369596980 ); } + if ($this->getEntryLevel() === 0) { $entryParentNode = $traversalStartingPoint; } elseif ($this->getEntryLevel() < 0) { @@ -285,7 +292,6 @@ function (Node $traversedNode) use (&$traversedHierarchy, $nodeTypeConstraintsWi $entryParentNode = $traversedHierarchy[$this->getEntryLevel() - 1] ?? null; } - return $entryParentNode; } @@ -312,14 +318,32 @@ protected function traverseUpUntilCondition(Node $node, \Closure $callback): voi } while ($shouldContinueTraversal !== false && $node !== null); } - protected function buildUri(Node $node): string + public function getCurrentNodeAncestors(): Nodes + { + if ($this->currentNodeAncestors instanceof Nodes) { + return $this->currentNodeAncestors; + } + $subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->currentNode); + $this->currentNodeAncestors = $subgraph->findAncestorNodes( + $this->currentNode->nodeAggregateId, + FindAncestorNodesFilter::create( + $this->getNodeTypeConstraints() + ) + ); + return $this->currentNodeAncestors; + } + + protected function calculateItemState(Node $node): MenuItemState { - $this->runtime->pushContextArray([ - 'itemNode' => $node, - 'documentNode' => $node, - ]); - $uri = $this->runtime->render($this->path . '/itemUriRenderer'); - $this->runtime->popContext(); - return $uri; + if ($node->nodeAggregateId->equals($this->currentNode->nodeAggregateId)) { + return MenuItemState::current(); + } + $ancestors = $this->getCurrentNodeAncestors(); + foreach ($ancestors as $ancestor) { + if ($node->nodeAggregateId->equals($ancestor->nodeAggregateId)) { + return MenuItemState::active(); + } + } + return MenuItemState::normal(); } } diff --git a/Neos.Neos/Documentation/References/NeosFusionReference.rst b/Neos.Neos/Documentation/References/NeosFusionReference.rst index af991b249d7..742e8445eef 100644 --- a/Neos.Neos/Documentation/References/NeosFusionReference.rst +++ b/Neos.Neos/Documentation/References/NeosFusionReference.rst @@ -966,73 +966,33 @@ Get argument in controller action:: Neos.Neos:Menu -------------- -Render a menu with items for nodes. Extends :ref:`Neos_Fusion__Template`. +Render a menu with items for nodes. -:templatePath: (string) Override the template path -:entryLevel: (integer) Start the menu at the given depth -:maximumLevels: (integer) Restrict the maximum depth of items in the menu (relative to ``entryLevel``) -:startingPoint: (Node) The parent node of the first menu level (defaults to ``node`` context variable) -:lastLevel: (integer) Restrict the menu depth by node depth (relative to site node) -:filter: (string) Filter items by node type (e.g. ``'!My.Site:News,Neos.Neos:Document'``), defaults to ``'Neos.Neos:Document'`` -:renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered, defaults to ``false`` -:itemCollection: (array) Explicitly set the Node items for the menu (alternative to ``startingPoints`` and levels) -:attributes: (:ref:`Neos_Fusion__DataStructure`) Extensible attributes for the whole menu -:normal.attributes: (:ref:`Neos_Fusion__DataStructure`) Attributes for normal state -:active.attributes: (:ref:`Neos_Fusion__DataStructure`) Attributes for active state -:current.attributes: (:ref:`Neos_Fusion__DataStructure`) Attributes for current state - -.. note:: The ``items`` of the ``Menu`` are internally calculated with the prototype :ref:`Neos_Neos__MenuItems` which - you can use directly aswell. - -Menu item properties: -^^^^^^^^^^^^^^^^^^^^^ - -:node: (Node) A node instance (with resolved shortcuts) that should be used to link to the item -:originalNode: (Node) Original node for the item -:state: (string) Menu state of the item: ``'normal'``, ``'current'`` (the current node) or ``'active'`` (ancestor of current node) -:label: (string) Full label of the node -:menuLevel: (integer) Menu level the item is rendered on - -Examples: -^^^^^^^^^ - -Custom menu template: -""""""""""""""""""""" - -:: - - menu = Neos.Neos:Menu { - entryLevel = 1 - maximumLevels = 3 - templatePath = 'resource://My.Site/Private/Templates/FusionObjects/MyMenu.html' - } - -Menu including site node: -""""""""""""""""""""""""" +:attributes: (:ref:`Neos_Fusion__DataStructure`) attributes for the whole menu +:[key]: (mixed) all other fusion properties are passed over to :ref:`Neos_Neos__MenuItems` internally to calculate the `items` -:: +Example:: menu = Neos.Neos:Menu { - itemCollection = ${q(site).add(q(site).children('[instanceof Neos.Neos:Document]')).get()} + attributes.class = 'menu' + maximumLevels = 3 } -Menu with custom starting point: -"""""""""""""""""""""""""""""""" +.. note:: The ``items`` of the ``Menu`` are internally calculated with the prototype :ref:`Neos_Neos__MenuItems` which + you can use directly aswell. -:: - - menu = Neos.Neos:Menu { - entryLevel = 2 - maximumLevels = 1 - startingPoint = ${q(site).children('[uriPathSegment="metamenu"]').get(0)} - } +.. note:: The ``rendering`` of the ``Menu`` is performed with the prototype :ref:`Neos_Neos__MenuItemListRenderer`. + If the rendering does not suit your useCase it we recommended to create your own variants of the menu and renderer prototype. .. _Neos_Neos__BreadcrumbMenu: Neos.Neos:BreadcrumbMenu ------------------------ -Render a breadcrumb (ancestor documents), based on :ref:`Neos_Neos__Menu`. +Render a breadcrumb (ancestor documents). + +:attributes: (:ref:`Neos_Fusion__DataStructure`) attributes for the whole menu +:[key]: (mixed) all other fusion properties are passed over to :ref:`Neos_Neos__BreadcrumbMenuItems` internally Example:: @@ -1041,91 +1001,36 @@ Example:: .. note:: The ``items`` of the ``BreadcrumbMenu`` are internally calculated with the prototype :ref:`Neos_Neos__MenuItems` which you can use directly aswell. +.. note:: The ``rendering`` of the ``BreadcrumbMenu`` is performed with the prototype :ref:`Neos_Neos__MenuItemListRenderer`. + If the rendering does not suit your useCase it we recommended to create your own variants of the menu and renderer prototype. + .. _Neos_Neos__DimensionMenu: .. _Neos_Neos__DimensionsMenu: Neos.Neos:DimensionsMenu ------------------------ -Create links to other node variants (e.g. variants of the current node in other dimensions) by using this Fusion object. +Create links to other node variants (e.g. variants of the current node in other dimensions). -If the ``dimension`` setting is given, the menu will only include items for this dimension, with all other configured -dimension being set to the value(s) of the current node. Without any ``dimension`` being configured, all possible -variants will be included. +:attributes: (:ref:`Neos_Fusion__DataStructure`) attributes for the whole menu +:[key]: (mixed) all other fusion properties are passed over to :ref:`Neos_Neos__DimensionsMenuItems` internally -If no node variant exists for the preset combination, a ``NULL`` node will be included in the item with a state ``absent``. - -:dimension: (optional, string): name of the dimension which this menu should be based on. Example: "language". -:presets: (optional, array): If set, the presets rendered will be taken from this list of preset identifiers -:includeAllPresets: (boolean, default **false**) If TRUE, include all presets, not only allowed combinations -:renderHiddenInIndex: (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" - -In the template for the menu, each ``item`` has the following properties: - -:node: (Node) A node instance (with resolved shortcuts) that should be used to link to the item -:state: (string) Menu state of the item: ``normal``, ``current`` (the current node), ``absent`` -:label: (string) Label of the item (the dimension preset label) -:menuLevel: (integer) Menu level the item is rendered on -:dimensions: (array) Dimension values of the node, indexed by dimension name -:targetDimensions: (array) The target dimensions, indexed by dimension name and values being arrays with ``value``, ``label`` and ``isPinnedDimension`` - -.. note:: The ``DimensionMenu`` is an alias to ``DimensionsMenu``, available for compatibility reasons only. - -.. note:: The ``items`` of the ``DimensionsMenu`` are internally calculated with the prototype :ref:`Neos_Neos__DimensionsMenuItems` which +.. note:: The ``items`` of the ``DimensionsMenu`` are internally calculated with the prototype :ref:`Neos_Neos__DimensionsMenuMenuItems` which you can use directly aswell. -Examples -^^^^^^^^ +.. note:: The ``rendering`` of the ``DimensionsMenu`` is performed with the prototype :ref:`Neos_Neos__MenuItemListRenderer`. + If the rendering does not suit your useCase it we recommended to create your own variants of the menu and renderer prototype. -Minimal Example, outputting a menu with all configured dimension combinations:: +.. _Neos_Neos__MenuItemListRenderer: - variantMenu = Neos.Neos:DimensionsMenu +Neos.Neos:MenuItemListRenderer +------------------------------- -This example will create two menus, one for the 'language' and one for the 'country' dimension:: +A very basic renderer that takes a list of MenuItems and renders the result as unordered list. If item states were calculated +they are applied as classnames to the list items. - languageMenu = Neos.Neos:DimensionsMenu { - dimension = 'language' - } - countryMenu = Neos.Neos:DimensionsMenu { - dimension = 'country' - } - -If you only want to render a subset of the available presets or manually define a specific order for a menu, -you can override the "presets":: - - languageMenu = Neos.Neos:DimensionsMenu { - dimension = 'language' - presets = ${['en_US', 'de_DE']} # no matter how many languages are defined, only these two are displayed. - } - -In some cases, it can be good to ignore the availability of variants when rendering a dimensions menu. Consider a -situation with two independent menus for country and language, where the following variants of a node exist -(language / country): - -- english / Germany -- german / Germany -- english / UK - -If the user selects UK, only english will be linked in the language selector. German is only available again, if the -user switches back to Germany first. This can be changed by setting the ``includeAllPresets`` option:: - - languageMenu = Neos.Neos:DimensionsMenu { - dimension = 'language' - includeAllPresets = true - } - -Now the language menu will try to find nodes for all languages, if needed the menu items will point to a different -country than currently selected. The menu tries to find a node to link to by using the current preset for the language -(in this example) and the default presets for any other dimensions. So if fallback rules are in place and a node can be -found, it is used. - -.. note:: The ``item.targetDimensions`` will contain the "intended" dimensions, so that information can be used to - inform the user about the potentially unexpected change of dimensions when following such a link. - -Only if the current node is not available at all (even after considering default presets with their fallback rules), -no node be assigned (so no link will be created and the items will have the ``absent`` state.) - -.. _Neos_Neos__MenuItems: +:items: (array): The MenuItems as generated by :ref:`Neos_Neos__MenuItems`, :ref:`Neos_Neos__DimensionsMenuItems`, :ref:`Neos_Neos__BreadcrumbMenuItems` +:attributes: (optional, array): The attributes to apply on the outer list Neos.Neos:MenuItems ------------------- @@ -1140,6 +1045,7 @@ Create a list of menu-items items for nodes. :renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered, defaults to ``false`` :itemCollection: (array) Explicitly set the Node items for the menu (alternative to ``startingPoints`` and levels) :itemUriRenderer: (:ref:`Neos_Neos__NodeUri`) prototype to use for rendering the URI of each item +:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` MenuItems item properties: ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1220,6 +1126,8 @@ If no node variant exists for the preset combination, a ``NULL`` node will be in :presets: (optional, array): If set, the presets rendered will be taken from this list of preset identifiers :includeAllPresets: (boolean, default **false**) If TRUE, include all presets, not only allowed combinations :renderHiddenInIndex: (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" +:itemUriRenderer: (:ref:`Neos_Neos__NodeUri`) prototype to use for rendering the URI of each item +:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` Each ``item`` has the following properties: diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion index 2e7903596d6..0a9b9fcc365 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion @@ -1,17 +1,29 @@ # Neos.Neos:BreadcrumbMenu provides a breadcrumb navigation based on menu items. # -prototype(Neos.Neos:BreadcrumbMenu) < prototype(Neos.Neos:Menu) { - templatePath = 'resource://Neos.Neos/Private/Templates/FusionObjects/BreadcrumbMenu.html' +prototype(Neos.Neos:BreadcrumbMenu) < prototype(Neos.Fusion:Component) { + attributes = Neos.Fusion:DataStructure - itemCollection = ${q(documentNode).parents('[instanceof Neos.Neos:Document]').get()} - // Show always the current node, event when it is hidden in index - items.@process.addCurrent = Neos.Fusion:Value { - currentItem = Neos.Neos:MenuItems { - renderHiddenInIndex = true - itemCollection = ${[documentNode]} - } - value = ${Array.concat(this.currentItem, value)} + @private { + items = Neos.Neos:BreadcrumbMenuItems { + @ignoreProperties = ${['attributes']} + @apply.props = ${props} + } } - attributes.class = 'breadcrumb' + renderer = Neos.Neos:MenuItemListRenderer { + items = ${private.items} + attributes = ${props.attributes} + } + + @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ContextDependentHandler' + + @cache { + mode = 'cached' + entryIdentifier { + documentNode = ${Neos.Caching.entryIdentifierForNode(documentNode)} + } + entryTags { + 1 = ${Neos.Caching.nodeTypeTag('Neos.Neos:Document', documentNode)} + } + } } diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion index e06d3b8790e..3e66c9b455e 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion @@ -1,10 +1,14 @@ prototype(Neos.Neos:BreadcrumbMenuItems) < prototype(Neos.Neos:MenuItems) { itemCollection = ${q(documentNode).parents('[instanceof Neos.Neos:Document]').get()} + maximumLevels = 0 + @process { // Show always the current node, event when it is hidden in index addCurrent = Neos.Fusion:Value { currentItem = Neos.Neos:MenuItems { + calculateItemStates = ${props.calculateItemStates} renderHiddenInIndex = true + maximumLevels = 0 itemCollection = ${[documentNode]} } value = ${Array.concat(this.currentItem, value)} diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion index f5ded703887..fccffdb3e06 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion @@ -1,34 +1,29 @@ # Neos.Neos:DimensionsMenu provides dimension (e.g. language) menu rendering -prototype(Neos.Neos:DimensionsMenu) < prototype(Neos.Neos:Menu) { - templatePath = 'resource://Neos.Neos/Private/Templates/FusionObjects/DimensionsMenu.html' - - # the "absent" state is assigned to items for dimension (combinations) for which no node variant exists - absent.attributes = Neos.Fusion:DataStructure { - class = 'normal' +prototype(Neos.Neos:DimensionsMenu) < prototype(Neos.Fusion:Component) { + attributes = Neos.Fusion:DataStructure + + @private { + items = Neos.Neos:DimensionsMenuItems { + @ignoreProperties = ${['attributes']} + @apply.props = ${props} + } } - # if documents which are hidden in index should be rendered or not - renderHiddenInIndex = true - - # name of the dimension to use (optional) - dimension = null - - # list of presets, if the default order should be overridden, only used with "dimension" set - presets = null - - # if true, items for all presets will be included, ignoring dimension constraints - includeAllPresets = false - - @context { - dimension = ${this.dimension} - presets = ${this.presets} - includeAllPresets = ${this.includeAllPresets} + renderer = Neos.Neos:MenuItemListRenderer { + items = ${private.items} + attributes = ${props.attributes} } - items = Neos.Neos:DimensionsMenuItems { - includeAllPresets = ${includeAllPresets} - dimension = ${dimension} - presets = ${presets} + @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ContextDependentHandler' + + @cache { + mode = 'cached' + entryIdentifier { + documentNode = ${Neos.Caching.entryIdentifierForNode(documentNode)} + } + entryTags { + 1 = ${Neos.Caching.nodeTypeTag('Neos.Neos:Document', documentNode)} + } } } diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion index 570b9af36d0..aca16e43107 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion @@ -1,48 +1,18 @@ # Neos.Neos:Menu provides basic menu rendering # -prototype(Neos.Neos:Menu) < prototype(Neos.Fusion:Template) { - templatePath = 'resource://Neos.Neos/Private/Templates/FusionObjects/Menu.html' - - entryLevel = ${this.startingPoint ? 0 : 1} - maximumLevels = 2 - startingPoint = null - lastLevel = null - filter = 'Neos.Neos:Document' - renderHiddenInIndex = false - itemCollection = null - - node = ${node} - +prototype(Neos.Neos:Menu) < prototype(Neos.Fusion:Component) { attributes = Neos.Fusion:DataStructure - active.attributes = Neos.Fusion:DataStructure { - class = 'active' - } - current.attributes = Neos.Fusion:DataStructure { - class = 'current' - } - normal.attributes = Neos.Fusion:DataStructure { - class = 'normal' - } - - @context { - entryLevel = ${this.entryLevel} - maximumLevels = ${this.maximumLevels} - startingPoint = ${this.startingPoint} - lastLevel = ${this.lastLevel} - filter = ${this.filter} - renderHiddenInIndex = ${this.renderHiddenInIndex} - itemCollection = ${this.itemCollection} + @private { + items = Neos.Neos:MenuItems { + @ignoreProperties = ${['attributes']} + @apply.props = ${props} + } } - items = Neos.Neos:MenuItems { - entryLevel = ${entryLevel} - maximumLevels = ${maximumLevels} - startingPoint = ${startingPoint} - lastLevel = ${lastLevel} - filter = ${filter} - renderHiddenInIndex = ${renderHiddenInIndex} - itemCollection = ${itemCollection} + renderer = Neos.Neos:MenuItemListRenderer { + items = ${private.items} + attributes = ${props.attributes} } @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ContextDependentHandler' diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItemListRenderer.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItemListRenderer.fusion new file mode 100644 index 00000000000..54203902617 --- /dev/null +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItemListRenderer.fusion @@ -0,0 +1,17 @@ +# Neos.Neos:MenuItemListRenderer provides basic menu rendering +# +prototype(Neos.Neos:MenuItemListRenderer) < prototype(Neos.Fusion:Component) { + items = null + attributes = Neos.Fusion:DataStructure + + renderer = afx` +
    + +
  • + {item.label} + +
  • +
    +
+ ` +} diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion index 01dbeb06484..d2ef5d4b7f1 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion @@ -9,6 +9,7 @@ prototype(Neos.Neos:MenuItems) { filter = 'Neos.Neos:Document' renderHiddenInIndex = false itemCollection = null + calculateItemStates = false // This property is used internally by `MenuItemsImplementation` to render each items uri. // It can be modified to change behaviour for all rendered uris. diff --git a/Neos.Neos/Resources/Private/Templates/FusionObjects/BreadcrumbMenu.html b/Neos.Neos/Resources/Private/Templates/FusionObjects/BreadcrumbMenu.html deleted file mode 100644 index f96b3e7c63c..00000000000 --- a/Neos.Neos/Resources/Private/Templates/FusionObjects/BreadcrumbMenu.html +++ /dev/null @@ -1,18 +0,0 @@ -{namespace neos=Neos\Neos\ViewHelpers} -{namespace ts=Neos\Fusion\ViewHelpers} - - f:format.raw()}> - - f:format.raw()}> - - - {item.label} - - - {item.label} - - - - - - diff --git a/Neos.Neos/Resources/Private/Templates/FusionObjects/DimensionsMenu.html b/Neos.Neos/Resources/Private/Templates/FusionObjects/DimensionsMenu.html deleted file mode 100644 index 4b646319db0..00000000000 --- a/Neos.Neos/Resources/Private/Templates/FusionObjects/DimensionsMenu.html +++ /dev/null @@ -1,22 +0,0 @@ -{namespace neos=Neos\Neos\ViewHelpers} -{namespace ts=Neos\Fusion\ViewHelpers} - f:format.raw()}> - - f:format.raw()}> - - - - - - - - - - - - - - - - {item.label} - diff --git a/Neos.Neos/Resources/Private/Templates/FusionObjects/Menu.html b/Neos.Neos/Resources/Private/Templates/FusionObjects/Menu.html deleted file mode 100644 index 27f33b88ebe..00000000000 --- a/Neos.Neos/Resources/Private/Templates/FusionObjects/Menu.html +++ /dev/null @@ -1,18 +0,0 @@ -{namespace neos=Neos\Neos\ViewHelpers} -{namespace ts=Neos\Fusion\ViewHelpers} - f:format.raw()}> - - - - - - f:format.raw()}> - {item.label} - -
    - -
-
- -
-
From 61cd48e5e4352db5b51534fcf2d99325f47527c7 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:29:43 +0200 Subject: [PATCH 015/113] TASK: DimensionSpacePoint deprecate legacy methods --- .../Classes/DimensionSpace/AbstractDimensionSpacePoint.php | 1 + .../Classes/DimensionSpace/DimensionSpacePoint.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php index 8d03f3624d0..9f457b03576 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php @@ -124,6 +124,7 @@ final public function equals(self $other): bool /** * @return array> + * @deprecated should be only used for conversion from Neos <= 8.x to 9.x upwards. never use this in "modern" code. */ final public function toLegacyDimensionArray(): array { diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php index aecb51fe6f1..882b86db565 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php @@ -65,6 +65,7 @@ public static function fromJsonString(string $jsonString): self * Creates a dimension space point from a legacy dimension array in format * ['language' => ['es'], 'country' => ['ar']] * + * @deprecated should be only used for conversion from Neos <= 8.x to 9.x upwards. never use this in "modern" code. * @param array> $legacyDimensionValues */ final public static function fromLegacyDimensionArray(array $legacyDimensionValues): self From ff0efc74c10d48e379d59cd1dcb993d2db7af822 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:30:16 +0200 Subject: [PATCH 016/113] TASK: Throw if DimensionSpacePoint is tried to be mutated --- .../Classes/DimensionSpace/DimensionSpacePointSet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php index 3b8b3165831..9a5b405ba80 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php @@ -97,12 +97,12 @@ public function offsetGet(mixed $offset): ?DimensionSpacePoint public function offsetSet(mixed $offset, mixed $value): void { - // not going to happen + throw new \BadMethodCallException('Cannot modify immutable DimensionSpacePointSet', 1697802335); } public function offsetUnset(mixed $offset): void { - // not going to happen + throw new \BadMethodCallException('Cannot modify immutable DimensionSpacePointSet', 1697802337); } public function getUnion(DimensionSpacePointSet $other): DimensionSpacePointSet From 03b1864c289d0dd035a511148095c0750fbce281 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:39:53 +0200 Subject: [PATCH 017/113] TASK: Introduce `(Origin)?DimensionSpacePoint::zeroDimensional` --- .../Classes/DimensionSpace/DimensionSpacePoint.php | 8 ++++++++ .../DimensionSpace/OriginDimensionSpacePoint.php | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php index 882b86db565..7b5a7730765 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php @@ -61,6 +61,14 @@ public static function fromJsonString(string $jsonString): self return self::instance(json_decode($jsonString, true)); } + /** + * Creates a dimension space point for a simple zero-dimensional content repository. + */ + public static function zeroDimensional(): self + { + return self::instance([]); + } + /** * Creates a dimension space point from a legacy dimension array in format * ['language' => ['es'], 'country' => ['ar']] diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php index 270547793a3..2ab75d92e9b 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php @@ -14,9 +14,6 @@ namespace Neos\ContentRepository\Core\DimensionSpace; -use Neos\ContentRepository\Core\DimensionSpace\AbstractDimensionSpacePoint; -use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; - /** * A node's origin dimension space point. Defines in which point in the dimension space the node originates * (= is "at home"). Every node has exactly ONE OriginDimensionSpacePoint, but one or more {@see DimensionSpacePoint}s @@ -57,6 +54,14 @@ public static function fromArray(array $data): self return self::instance($data); } + /** + * Creates an origin dimension space point for a simple zero-dimensional content repository. + */ + public static function zeroDimensional(): self + { + return self::instance([]); + } + /** * @param string $jsonString A JSON string representation, see jsonSerialize */ From db5a8951b84b78d72ae551dc1e74da35b9913e8e Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:47:01 +0200 Subject: [PATCH 018/113] TASK: Document when `DimensionSpacePointSet` is not empty --- .../Classes/DimensionSpace/DimensionSpacePointSet.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php index 9a5b405ba80..c96732c4644 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php @@ -14,9 +14,14 @@ namespace Neos\ContentRepository\Core\DimensionSpace; +use Neos\ContentRepository\Core\EventStore\EventInterface; + /** * A set of points in the dimension space. * + * In case this set is a member of an {@see EventInterface} as $coveredDimensionSpacePoints, you can be sure that it is not empty. + * There is always at least one dimension space point covered, even in a zero-dimensional content repository. {@see DimensionSpacePoint::zeroDimensional()}. + * * E.g.: {[language => es, country => ar], [language => es, country => es]} * @implements \IteratorAggregate * @implements \ArrayAccess From e78011f49cbcf16e14707247c6521dc91bf18321 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 20 Oct 2023 16:19:20 +0200 Subject: [PATCH 019/113] TASK: Store NodeAggregateIds of current node rootline instead of full nodes This is more memory efficient and we only compare the AggregateIds anyways In addition the signature of `NodeAggregateIds::fromNodes(array $nodes)` is changed to `NodeAggregateIds::fromNodes(Nodes $nodes)` and the method `NodeAggregateIds::contain(NodeAggregateId $nodeAggregateId)` is added. There were no users of this to be found so this should be safe. --- .../SharedModel/Node/NodeAggregateIds.php | 13 ++++++---- .../Fusion/MenuItemsImplementation.php | 24 +++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php b/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php index 66a8016be69..ca554821d62 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\SharedModel\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes; /** * An immutable collection of NodeAggregateIds, indexed by their value @@ -74,13 +75,10 @@ public static function fromJsonString(string $jsonString): self return self::fromArray(\json_decode($jsonString, true)); } - /** - * @param Node[] $nodes - */ - public static function fromNodes(array $nodes): self + public static function fromNodes(Nodes $nodes): self { return self::fromArray( - array_map(fn(Node $node) => $node->nodeAggregateId, $nodes) + array_map(fn(Node $node) => $node->nodeAggregateId, iterator_to_array($nodes)) ); } @@ -92,6 +90,11 @@ public function merge(self $other): self )); } + public function contain(NodeAggregateId $nodeAggregateId): bool + { + return array_key_exists($nodeAggregateId->value, $this->nodeAggregateIds); + } + /** * @return array */ diff --git a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php index bdadc138e94..04c693b7799 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php @@ -22,6 +22,8 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraintsWithSubNodeTypes; use Neos\ContentRepository\Core\Projection\ContentGraph\Subtree; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds; use Neos\Fusion\Exception as FusionException; use Neos\Neos\Domain\Service\NodeTypeNameFactory; @@ -57,9 +59,9 @@ class MenuItemsImplementation extends AbstractMenuItemsImplementation protected $maximumLevels; /** - * Internal cache for the ancestors of the currentNode. + * Internal cache for the ancestors aggregate ids of the currentNode. */ - protected ?Nodes $currentNodeAncestors = null; + protected ?NodeAggregateIds $currentNodeAncestorAggregateIds = null; /** * Runtime cache for the node type constraints to be applied @@ -318,19 +320,20 @@ protected function traverseUpUntilCondition(Node $node, \Closure $callback): voi } while ($shouldContinueTraversal !== false && $node !== null); } - public function getCurrentNodeAncestors(): Nodes + public function getCurrentNodeAncestorAggregateIds(): NodeAggregateIds { - if ($this->currentNodeAncestors instanceof Nodes) { - return $this->currentNodeAncestors; + if ($this->currentNodeAncestorAggregateIds instanceof NodeAggregateIds) { + return $this->currentNodeAncestorAggregateIds; } $subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->currentNode); - $this->currentNodeAncestors = $subgraph->findAncestorNodes( + $currentNodeAncestors = $subgraph->findAncestorNodes( $this->currentNode->nodeAggregateId, FindAncestorNodesFilter::create( $this->getNodeTypeConstraints() ) ); - return $this->currentNodeAncestors; + $this->currentNodeAncestorAggregateIds = NodeAggregateIds::fromNodes($currentNodeAncestors); + return $this->currentNodeAncestorAggregateIds; } protected function calculateItemState(Node $node): MenuItemState @@ -338,11 +341,8 @@ protected function calculateItemState(Node $node): MenuItemState if ($node->nodeAggregateId->equals($this->currentNode->nodeAggregateId)) { return MenuItemState::current(); } - $ancestors = $this->getCurrentNodeAncestors(); - foreach ($ancestors as $ancestor) { - if ($node->nodeAggregateId->equals($ancestor->nodeAggregateId)) { - return MenuItemState::active(); - } + if ($this->getCurrentNodeAncestorAggregateIds()->contain($node->nodeAggregateId)) { + return MenuItemState::active(); } return MenuItemState::normal(); } From e603c21698223950240b19888e879c6e9418ec93 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 20 Oct 2023 16:22:20 +0200 Subject: [PATCH 020/113] Update Neos.Neos/Classes/Fusion/DimensionMenuItem.php Co-authored-by: Bastian Waidelich --- Neos.Neos/Classes/Fusion/DimensionMenuItem.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/DimensionMenuItem.php b/Neos.Neos/Classes/Fusion/DimensionMenuItem.php index 08a400dc5aa..cb7ff321d1c 100644 --- a/Neos.Neos/Classes/Fusion/DimensionMenuItem.php +++ b/Neos.Neos/Classes/Fusion/DimensionMenuItem.php @@ -7,19 +7,20 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Node; /** - * A menu item + * A menu item for dimension menus + * Compared to the default {@see MenuItem} it has no `menuLevel` property, but one for the `targetDimensions` */ -final class DimensionMenuItem +final readonly class DimensionMenuItem { /** * @param array|null $targetDimensions */ public function __construct( - public readonly ?Node $node, - public readonly ?MenuItemState $state = null, - public readonly ?string $label = null, - public readonly ?array $targetDimensions = null, - public readonly ?string $uri = null + public ?Node $node, + public ?MenuItemState $state = null, + public ?string $label = null, + public ?array $targetDimensions = null, + public ?string $uri = null ) { } } From 6134527f794db548ed0db40f9692c27b59732e5e Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 20 Oct 2023 16:26:47 +0200 Subject: [PATCH 021/113] Update Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php Co-authored-by: Bastian Waidelich --- Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php index 29323c4aeb2..d37385261f4 100644 --- a/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php @@ -78,9 +78,8 @@ abstract class AbstractMenuItemsImplementation extends AbstractFusionObject protected ContentRepositoryRegistry $contentRepositoryRegistry; /** - * Should nodes that have "hiddenInIndex" set still be visible in this menu. - * - * @return boolean + * Whether the active/current state of menu items is calculated on the server side. + * This has an effect on performance and caching */ public function isCalculateItemStatesEnabled(): bool { From 8b75a7a9a0e6c12c4365cf819c23671159d4d464 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 17:34:40 +0200 Subject: [PATCH 022/113] TASK: Use `Result` interface instead of `ResultStatement`, because it offers `fetchAssociative` --- .../src/Domain/Projection/ProjectionHypergraph.php | 3 --- .../Domain/Projection/Query/ProjectionHypergraphQuery.php | 7 ++----- .../Query/ProjectionHypergraphQueryInterface.php | 7 ++----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php index 124f10c7933..1d876921576 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php @@ -71,7 +71,6 @@ public function findNodeRecordByCoverage( $query = ProjectionHypergraphQuery::create($contentStreamId, $this->tableNamePrefix); $query = $query->withDimensionSpacePoint($dimensionSpacePoint) ->withNodeAggregateId($nodeAggregateId); - /** @phpstan-ignore-next-line @todo check actual return type */ $result = $query->execute($this->getDatabaseConnection())->fetchAssociative(); return $result ? NodeRecord::fromDatabaseRow($result) : null; @@ -89,7 +88,6 @@ public function findNodeRecordByOrigin( $query = $query->withOriginDimensionSpacePoint($originDimensionSpacePoint); $query = $query->withNodeAggregateId($nodeAggregateId); - /** @phpstan-ignore-next-line @todo check actual return type */ $result = $query->execute($this->getDatabaseConnection())->fetchAssociative(); return $result ? NodeRecord::fromDatabaseRow($result) : null; @@ -191,7 +189,6 @@ public function findNodeRecordsForNodeAggregate( $query = ProjectionHypergraphQuery::create($contentStreamId, $this->tableNamePrefix); $query = $query->withNodeAggregateId($nodeAggregateId); - /** @phpstan-ignore-next-line @todo check actual return type */ $result = $query->execute($this->getDatabaseConnection())->fetchAllAssociative(); return array_map(function ($row) { diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php index 53c1efacd45..ad41c6b19d3 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\ResultStatement; +use Doctrine\DBAL\Driver\Result; use Doctrine\DBAL\Types\Types; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; @@ -113,10 +113,7 @@ public function withNodeAggregateId(NodeAggregateId $nodeAggregateId): self return new self($query, $parameters, $this->types); } - /** - * @return ResultStatement - */ - public function execute(Connection $databaseConnection): ResultStatement + public function execute(Connection $databaseConnection): Result { return $databaseConnection->executeQuery($this->query, $this->parameters, $this->types); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php index ff2ee1066e4..602bf71191d 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php @@ -15,7 +15,7 @@ namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Query; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\ResultStatement; +use Doctrine\DBAL\Driver\Result; /** * The interface to be implemented by projection hypergraph queries @@ -24,8 +24,5 @@ */ interface ProjectionHypergraphQueryInterface { - /** - * @return ResultStatement - */ - public function execute(Connection $databaseConnection): ResultStatement; + public function execute(Connection $databaseConnection): Result; } From 300f84f0755eddff29464f29273cf3531111b559 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 20 Oct 2023 17:04:23 +0200 Subject: [PATCH 023/113] TASK: Make MenuItem and DimensionMenuItemReadonly and convert MenuItemState to a BackedEnum In addition the RenderAttributesTrait was adjusted to handle backed enums like stringables. --- .../Classes/Service/RenderAttributesTrait.php | 6 ++ .../Tests/Unit/Service/HtmlAugmenterTest.php | 32 ++++++++- .../DimensionsMenuItemsImplementation.php | 6 +- Neos.Neos/Classes/Fusion/MenuItem.php | 14 ++-- Neos.Neos/Classes/Fusion/MenuItemState.php | 66 ++----------------- .../Fusion/MenuItemsImplementation.php | 6 +- 6 files changed, 55 insertions(+), 75 deletions(-) diff --git a/Neos.Fusion/Classes/Service/RenderAttributesTrait.php b/Neos.Fusion/Classes/Service/RenderAttributesTrait.php index 9063bb17ed5..ca6af143c16 100644 --- a/Neos.Fusion/Classes/Service/RenderAttributesTrait.php +++ b/Neos.Fusion/Classes/Service/RenderAttributesTrait.php @@ -42,6 +42,8 @@ protected function renderAttributes(iterable $attributes, bool $allowEmpty = tru foreach ($attributeValue as $attributeValuePart) { if ($attributeValuePart instanceof \Stringable) { $attributeValuePart = $attributeValuePart->__toString(); + } elseif ($attributeValuePart instanceof \BackedEnum) { + $attributeValuePart = $attributeValuePart->value; } $joinedAttributeValue .= match (gettype($attributeValuePart)) { 'boolean', 'NULL' => '', @@ -50,6 +52,10 @@ protected function renderAttributes(iterable $attributes, bool $allowEmpty = tru }; } $attributeValue = trim($joinedAttributeValue); + } elseif ($attributeValue instanceof \Stringable) { + $attributeValue = $attributeValue->__toString(); + } elseif ($attributeValue instanceof \BackedEnum) { + $attributeValue = $attributeValue->value; } $encodedAttributeName = htmlspecialchars((string)$attributeName, ENT_COMPAT, 'UTF-8', false); if ($attributeValue === true || $attributeValue === '') { diff --git a/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php b/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php index 820b2d7afe5..c2befa76c02 100644 --- a/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php +++ b/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php @@ -47,9 +47,14 @@ public function __toString() { return "casted value"; } } + enum BackedStringEnum: string { + case Example = "enum value"; + } '); + /** @noinspection PhpUndefinedClassInspection */ $mockObject = new \ClassWithToStringMethod(); + $mockEnum = \BackedStringEnum::Example; return [ // object values with __toString method @@ -61,7 +66,15 @@ public function __toString() { 'allowEmpty' => true, 'expectedResult' => '
' ], - + // object values with BackendEnum value + [ + 'html' => '', + 'attributes' => ['enum' => $mockEnum], + 'fallbackTagName' => null, + 'exclusiveAttributes' => null, + 'allowEmpty' => true, + 'expectedResult' => '
' + ], // empty source [ 'html' => '', @@ -344,6 +357,23 @@ public function __toString() { 'allowEmpty' => false, 'expectedResult' => '

Stringable attribute

', ], + // Adding of Enum attributes + [ + 'html' => '

Enum attribute

', + 'attributes' => ['data-enum' => $mockEnum], + 'fallbackTagName' => null, + 'exclusiveAttributes' => null, + 'allowEmpty' => true, + 'expectedResult' => '

Enum attribute

', + ], + [ + 'html' => '

Enum attribute

', + 'attributes' => ['data-enum' => $mockEnum], + 'fallbackTagName' => null, + 'exclusiveAttributes' => null, + 'allowEmpty' => false, + 'expectedResult' => '

Enum attribute

', + ], // Adding of array attributes [ 'html' => '

Array attribute

', diff --git a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php index facc2047e57..6877fe98c6d 100644 --- a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php @@ -222,13 +222,13 @@ protected function determineLabel(?Node $variant = null, array $metadata = []): protected function calculateItemState(?Node $variant = null): MenuItemState { if (is_null($variant)) { - return MenuItemState::absent(); + return MenuItemState::ABSENT; } if ($variant === $this->currentNode) { - return MenuItemState::current(); + return MenuItemState::CURRENT; } - return MenuItemState::normal(); + return MenuItemState::NORMAL; } diff --git a/Neos.Neos/Classes/Fusion/MenuItem.php b/Neos.Neos/Classes/Fusion/MenuItem.php index 1ee3387c0e7..59de848a70c 100644 --- a/Neos.Neos/Classes/Fusion/MenuItem.php +++ b/Neos.Neos/Classes/Fusion/MenuItem.php @@ -9,18 +9,18 @@ /** * A menu item */ -final class MenuItem +final readonly class MenuItem { /** * @param array $children */ public function __construct( - public readonly Node $node, - public readonly ?MenuItemState $state = null, - public readonly ?string $label = null, - public readonly int $menuLevel = 1, - public readonly array $children = [], - public readonly ?string $uri = null + public Node $node, + public ?MenuItemState $state = null, + public ?string $label = null, + public int $menuLevel = 1, + public array $children = [], + public ?string $uri = null ) { } diff --git a/Neos.Neos/Classes/Fusion/MenuItemState.php b/Neos.Neos/Classes/Fusion/MenuItemState.php index a45ec59bbfe..2430cc3a75f 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemState.php +++ b/Neos.Neos/Classes/Fusion/MenuItemState.php @@ -7,66 +7,10 @@ /** * The menu item state value object */ -final class MenuItemState +enum MenuItemState: string { - public const STATE_NORMAL = 'normal'; - public const STATE_CURRENT = 'current'; - public const STATE_ACTIVE = 'active'; - public const STATE_ABSENT = 'absent'; - - /** - * @var string - */ - protected $state; - - /** - * @param string $state - * @throws Exception\InvalidMenuItemStateException - */ - public function __construct(string $state) - { - if ( - $state !== self::STATE_NORMAL - && $state !== self::STATE_CURRENT - && $state !== self::STATE_ACTIVE - && $state !== self::STATE_ABSENT - ) { - throw new Exception\InvalidMenuItemStateException( - '"' . $state . '" is no valid menu item state', - 1519668881 - ); - } - - $this->state = $state; - } - - - - public static function active(): MenuItemState - { - return new MenuItemState(self::STATE_ACTIVE); - } - - public static function current(): MenuItemState - { - return new MenuItemState(self::STATE_CURRENT); - } - - public static function absent(): MenuItemState - { - return new MenuItemState(self::STATE_ABSENT); - } - - public static function normal(): MenuItemState - { - return new MenuItemState(self::STATE_NORMAL); - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->state; - } + case NORMAL = 'normal'; + case CURRENT = 'current'; + case ACTIVE = 'active'; + case ABSENT = 'absent'; } diff --git a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php index 04c693b7799..f88a11120b7 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php @@ -339,11 +339,11 @@ public function getCurrentNodeAncestorAggregateIds(): NodeAggregateIds protected function calculateItemState(Node $node): MenuItemState { if ($node->nodeAggregateId->equals($this->currentNode->nodeAggregateId)) { - return MenuItemState::current(); + return MenuItemState::CURRENT; } if ($this->getCurrentNodeAncestorAggregateIds()->contain($node->nodeAggregateId)) { - return MenuItemState::active(); + return MenuItemState::ACTIVE; } - return MenuItemState::normal(); + return MenuItemState::NORMAL; } } From f3eb81cfa59f051e8898d60e31ed4e589fee57ec Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 19:34:22 +0200 Subject: [PATCH 024/113] TASK: Stricter typing in `InterDimensionalVariationGraph` --- .../InterDimensionalVariationGraph.php | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php index 7cc294a242a..d300435da44 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php @@ -17,7 +17,7 @@ use Neos\ContentRepository\Core\Dimension; /** - * The inter dimensional variation graph domain model + * The interdimensional variation graph domain model * Represents the specialization and generalization mechanism between dimension space points * @api */ @@ -26,49 +26,49 @@ class InterDimensionalVariationGraph /** * Weighed dimension space points, indexed by identity (DSP) hash * - * @var array|null + * @var array */ - protected ?array $weightedDimensionSpacePoints = null; + protected array $weightedDimensionSpacePoints; /** * Generalization dimension space point sets, indexed by specialization hash * - * @var array|null + * @var array */ - protected ?array $indexedGeneralizations = null; + protected array $indexedGeneralizations; /** * Specialization dimension space point sets, indexed by generalization hash * - * @var array|null + * @var array */ - protected ?array $indexedSpecializations = null; + protected array $indexedSpecializations; /** * Weighed generalizations, indexed by specialization hash and relative weight * - * @var array>|null + * @var array> */ - protected ?array $weightedGeneralizations = null; + protected array $weightedGeneralizations; /** * Weighed specializations, indexed by generalization hash, relative weight and specialization hash - * @var array>>|null + * @var array>> */ - protected ?array $weightedSpecializations = null; + protected array $weightedSpecializations; /** * Primary generalization dimension space points, indexed by specialization hash * * @var array */ - protected ?array $primaryGeneralizations = null; + protected array $primaryGeneralizations; - protected ?int $weightNormalizationBase = null; + protected int $weightNormalizationBase; public function __construct( - private Dimension\ContentDimensionSourceInterface $contentDimensionSource, - private ContentDimensionZookeeper $contentDimensionZookeeper + private readonly Dimension\ContentDimensionSourceInterface $contentDimensionSource, + private readonly ContentDimensionZookeeper $contentDimensionZookeeper ) { } @@ -93,10 +93,9 @@ public function getDimensionSpacePoints(): DimensionSpacePointSet */ public function getWeightedDimensionSpacePoints(): array { - if (is_null($this->weightedDimensionSpacePoints)) { + if (!isset($this->weightedDimensionSpacePoints)) { $this->initializeWeightedDimensionSpacePoints(); } - /** @var array $weighedDimensionSpacePoints */ $weighedDimensionSpacePoints = $this->weightedDimensionSpacePoints; return $weighedDimensionSpacePoints; @@ -110,7 +109,7 @@ public function getWeightedDimensionSpacePointByDimensionSpacePoint( public function getWeightedDimensionSpacePointByHash(string $hash): ?WeightedDimensionSpacePoint { - if (is_null($this->weightedDimensionSpacePoints)) { + if (!isset($this->weightedDimensionSpacePoints)) { $this->initializeWeightedDimensionSpacePoints(); } @@ -136,7 +135,7 @@ public function getRootGeneralizations(): array protected function determineWeightNormalizationBase(): int { - if (is_null($this->weightNormalizationBase)) { + if (!isset($this->weightNormalizationBase)) { $base = 0; foreach ($this->contentDimensionSource->getContentDimensionsOrderedByPriority() as $contentDimension) { $base = max($base, $contentDimension->getMaximumDepth()->value + 1); @@ -154,7 +153,9 @@ protected function initializeVariations(): void $lowestVariationWeights = []; $this->weightedGeneralizations = []; + /** @var array> $indexedGeneralizations */ $indexedGeneralizations = []; + /** @var array> $indexedSpecializations */ $indexedSpecializations = []; foreach ($this->getWeightedDimensionSpacePoints() as $generalizationHash => $generalization) { @@ -165,8 +166,8 @@ protected function initializeVariations(): void foreach ($generalization->dimensionValues as $rawDimensionId => $contentDimensionValue) { $dimensionId = new Dimension\ContentDimensionId($rawDimensionId); - /** @var Dimension\ContentDimension $dimension */ $dimension = $this->contentDimensionSource->getDimension($dimensionId); + assert($dimension !== null); foreach ($dimension->getSpecializations($contentDimensionValue) as $specializedValue) { $specializedDimensionSpacePoint = $generalization->dimensionSpacePoint ->vary($dimensionId, $specializedValue->value); @@ -206,16 +207,13 @@ protected function initializeVariations(): void } } - /** @var array> $indexedGeneralizations */ foreach ($indexedGeneralizations as $specializationHash => $generalizations) { $this->indexedGeneralizations[$specializationHash] = new DimensionSpacePointSet($generalizations); } - /** @var array> $indexedSpecializations */ foreach ($indexedSpecializations as $generalizationHash => $specializations) { $this->indexedSpecializations[$generalizationHash] = new DimensionSpacePointSet($specializations); } - /** @phpstan-ignore-next-line */ foreach ($this->weightedGeneralizations as $specializationHash => &$generalizationsByWeight) { ksort($generalizationsByWeight); } @@ -225,6 +223,8 @@ protected function initializeVariations(): void * @param array $normalizedVariationWeights * @param array>& $indexedGeneralizations * @param array>& $indexedSpecializations + * @param-out array> $indexedGeneralizations + * @param-out array> $indexedSpecializations */ protected function initializeVariationsForDimensionSpacePointPair( WeightedDimensionSpacePoint $specialization, @@ -237,8 +237,8 @@ protected function initializeVariationsForDimensionSpacePointPair( if (isset($indexedGeneralizations[$generalization->getIdentityHash()])) { $generalizations = $indexedGeneralizations[$generalization->getIdentityHash()]; foreach ($generalizations as $parentGeneralizationHash => $parentGeneralization) { - /** @var WeightedDimensionSpacePoint $weighedParent */ $weighedParent = $this->getWeightedDimensionSpacePointByHash($parentGeneralizationHash); + assert($weighedParent !== null); $generalizationsToProcess[$parentGeneralizationHash] = $weighedParent; } } @@ -265,7 +265,7 @@ protected function initializeVariationsForDimensionSpacePointPair( */ public function getIndexedSpecializations(DimensionSpacePoint $generalization): DimensionSpacePointSet { - if (is_null($this->indexedSpecializations)) { + if (!isset($this->indexedSpecializations)) { $this->initializeVariations(); } @@ -277,7 +277,7 @@ public function getIndexedSpecializations(DimensionSpacePoint $generalization): */ public function getIndexedGeneralizations(DimensionSpacePoint $specialization): DimensionSpacePointSet { - if (is_null($this->indexedGeneralizations)) { + if (!isset($this->indexedGeneralizations)) { $this->initializeVariations(); } @@ -291,7 +291,7 @@ public function getIndexedGeneralizations(DimensionSpacePoint $specialization): */ public function getWeightedSpecializations(DimensionSpacePoint $generalization): array { - if (is_null($this->weightedSpecializations)) { + if (!isset($this->weightedSpecializations)) { $this->initializeVariations(); } @@ -305,7 +305,7 @@ public function getWeightedSpecializations(DimensionSpacePoint $generalization): */ public function getWeightedGeneralizations(DimensionSpacePoint $specialization): array { - if (is_null($this->weightedGeneralizations)) { + if (!isset($this->weightedGeneralizations)) { $this->initializeVariations(); } @@ -344,7 +344,7 @@ public function getSpecializationSet( */ public function getPrimaryGeneralization(DimensionSpacePoint $specialization): ?DimensionSpacePoint { - if (is_null($this->primaryGeneralizations)) { + if (!isset($this->primaryGeneralizations)) { $this->initializeVariations(); } @@ -360,7 +360,7 @@ public function getVariantType(DimensionSpacePoint $subject, DimensionSpacePoint return VariantType::TYPE_SAME; } - if (is_null($this->indexedGeneralizations)) { + if (!isset($this->indexedGeneralizations)) { $this->initializeVariations(); } From 293bed62b199eab39ef7696d79faf03d81e87a27 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:34:31 +0200 Subject: [PATCH 025/113] TASK: Stricter typing in `Projections` --- .../Classes/Projection/Projections.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Projection/Projections.php b/Neos.ContentRepository.Core/Classes/Projection/Projections.php index 5e343fa6e3e..56121460f71 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Projections.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Projections.php @@ -13,16 +13,16 @@ final class Projections implements \IteratorAggregate { /** - * @var array> + * @var array>, ProjectionInterface> */ private array $projections; /** - * @param array $projections - * @phpstan-ignore-next-line + * @param ProjectionInterface ...$projections */ private function __construct(ProjectionInterface ...$projections) { + // @phpstan-ignore-next-line $this->projections = $projections; } @@ -60,7 +60,8 @@ public static function fromArray(array $projections): self */ public function get(string $projectionClassName): ProjectionInterface { - if (!$this->has($projectionClassName)) { + $projection = $this->projections[$projectionClassName] ?? null; + if (!$projection instanceof $projectionClassName) { throw new \InvalidArgumentException( sprintf( 'a projection of type "%s" is not registered in this content repository instance.', @@ -69,8 +70,7 @@ public function get(string $projectionClassName): ProjectionInterface 1650120813 ); } - // @phpstan-ignore-next-line - return $this->projections[$projectionClassName]; + return $projection; } public function has(string $projectionClassName): bool @@ -79,8 +79,7 @@ public function has(string $projectionClassName): bool } /** - * @return \Traversable - * @phpstan-ignore-next-line + * @return \Traversable> */ public function getIterator(): \Traversable { From 6510b87abdb51c64511d0c497e5232c0a854fef7 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 21 Oct 2023 09:17:30 +0200 Subject: [PATCH 026/113] TASK: Add phpstan to `Neos.ContentRepository.LegacyNodeMigration` --- .../Classes/Command/CrCommandController.php | 9 ++----- .../Classes/Helpers/AssetExtractor.php | 10 ++++++- .../Classes/Helpers/NodeDataLoader.php | 13 ++++++--- .../Classes/LegacyMigrationService.php | 2 +- .../Classes/NodeDataToAssetsProcessor.php | 11 ++++++-- .../Classes/NodeDataToEventsProcessor.php | 27 ++++++++++++++----- phpstan.neon | 1 + 7 files changed, 52 insertions(+), 21 deletions(-) diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php index fabefad1565..b3b7e1a11d6 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php @@ -40,13 +40,6 @@ class CrCommandController extends CommandController { - - /** - * @var array - */ - #[Flow\InjectConfiguration(package: 'Neos.Flow')] - protected array $flowSettings; - public function __construct( private readonly Connection $connection, private readonly Environment $environment, @@ -96,6 +89,7 @@ public function migrateLegacyDataCommand(bool $verbose = false, string $config = $siteRows = $connection->fetchAllAssociativeIndexed('SELECT nodename, name, siteresourcespackagekey FROM neos_neos_domain_model_site'); $siteNodeName = $this->output->select('Which site to migrate?', array_map(static fn (array $siteRow) => $siteRow['name'] . ' (' . $siteRow['siteresourcespackagekey'] . ')', $siteRows)); + assert(is_string($siteNodeName)); $siteRow = $siteRows[$siteNodeName]; $site = $this->siteRepository->findOneByNodeName($siteNodeName); @@ -208,6 +202,7 @@ private function determineResourcesPath(): string private static function defaultResourcesPath(): string { + // @phpstan-ignore-next-line return FLOW_PATH_DATA . 'Persistent/Resources'; } } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php index f7479da4c39..d6d8b08a21a 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php @@ -12,6 +12,9 @@ final class AssetExtractor { + /** + * @var array + */ private array $processedAssetIds = []; public function __construct( @@ -19,7 +22,8 @@ public function __construct( ) {} /** - * @param iterable $nodeDataRows + * @param iterable> $nodeDataRows + * @return iterable */ public function run(iterable $nodeDataRows): iterable { @@ -48,9 +52,13 @@ public function run(iterable $nodeDataRows): iterable /** ----------------------------- */ + /** + * @return iterable + */ private function extractAssets(mixed $propertyValue): iterable { if ($propertyValue instanceof Asset) { + /** @var string|null $assetId */ $assetId = $propertyValue->getIdentifier(); \Neos\Flow\var_dump($assetId, '$assetId'); if ($assetId === null) { diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php index 52d54cdbf20..904f5700184 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php @@ -4,16 +4,21 @@ namespace Neos\ContentRepository\LegacyNodeMigration\Helpers; use Doctrine\DBAL\Connection; -use Traversable; +/** + * @implements \IteratorAggregate> + */ final class NodeDataLoader implements \IteratorAggregate { - public function __construct( private readonly Connection $connection, - ) {} + ) { + } - public function getIterator(): Traversable + /** + * @return \Traversable> + */ + public function getIterator(): \Traversable { $query = $this->connection->executeQuery(' SELECT diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php index 2bcebc44a0e..15d1be1d8c4 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php @@ -87,7 +87,7 @@ public function runAllProcessors(\Closure $outputLineFn, bool $verbose = false): }); $result = $processor->run(); if ($result->severity === Severity::ERROR) { - throw new \RuntimeException($label . ': ' . $result->message ?? ''); + throw new \RuntimeException($label . ': ' . $result->message); } $outputLineFn(' ' . $result->message); $outputLineFn(); diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php index a1495d6174e..0d60b591cee 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php @@ -17,9 +17,18 @@ final class NodeDataToAssetsProcessor implements ProcessorInterface { + /** + * @var array + */ private array $processedAssetIds = []; + /** + * @var array<\Closure> + */ private array $callbacks = []; + /** + * @param iterable> $nodeDataRows + */ public function __construct( private readonly NodeTypeManager $nodeTypeManager, private readonly AssetExporter $assetExporter, @@ -84,12 +93,10 @@ public function run(): ProcessorResult private function extractAssetIdentifiers(string $type, mixed $value): array { if (($type === 'string' || is_subclass_of($type, \Stringable::class, true)) && is_string($value)) { - // @phpstan-ignore-next-line preg_match_all('/asset:\/\/(?[\w-]*)/i', (string)$value, $matches, PREG_SET_ORDER); return array_map(static fn(array $match) => $match['assetId'], $matches); } if (is_subclass_of($type, ResourceBasedInterface::class, true)) { - // @phpstan-ignore-next-line return isset($value['__identifier']) ? [$value['__identifier']] : []; } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php index 9b4ed5e4189..4f8bb63a3e9 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php @@ -58,7 +58,9 @@ final class NodeDataToEventsProcessor implements ProcessorInterface { - + /** + * @var array<\Closure> + */ private array $callbacks = []; private NodeTypeName $sitesNodeTypeName; private ContentStreamId $contentStreamId; @@ -78,6 +80,9 @@ final class NodeDataToEventsProcessor implements ProcessorInterface */ private $eventFileResource; + /** + * @param iterable> $nodeDataRows + */ public function __construct( private readonly NodeTypeManager $nodeTypeManager, private readonly PropertyMapper $propertyMapper, @@ -156,7 +161,7 @@ private function resetRuntimeState(): void $this->nodeReferencesWereSetEvents = []; $this->numberOfExportedEvents = 0; $this->metaDataExported = false; - $this->eventFileResource = fopen('php://temp/maxmemory:5242880', 'rb+'); + $this->eventFileResource = fopen('php://temp/maxmemory:5242880', 'rb+') ?: null; Assert::resource($this->eventFileResource, null, 'Failed to create temporary event file resource'); } @@ -168,10 +173,14 @@ private function exportEvent(EventInterface $event): void json_decode($this->eventNormalizer->getEventData($event)->value, true), [] ); + assert($this->eventFileResource !== null); fwrite($this->eventFileResource, $exportedEvent->toJson() . chr(10)); $this->numberOfExportedEvents ++; } + /** + * @param array $nodeDataRow + */ private function exportMetaData(array $nodeDataRow): void { if ($this->files->fileExists('meta.json')) { @@ -187,7 +196,7 @@ private function exportMetaData(array $nodeDataRow): void } /** - * @param array $nodeDataRow + * @param array $nodeDataRow */ private function processNodeData(array $nodeDataRow): void { @@ -229,10 +238,9 @@ private function processNodeData(array $nodeDataRow): void /** - * @param NodePath $nodePath * @param OriginDimensionSpacePoint $originDimensionSpacePoint * @param NodeAggregateId $nodeAggregateId - * @param array $nodeDataRow + * @param array $nodeDataRow * @return NodeName[]|void * @throws \JsonException */ @@ -246,6 +254,7 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $ } $pathParts = $nodePath->getParts(); $nodeName = end($pathParts); + assert($nodeName !== false); $nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']); $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); $serializedPropertyValuesAndReferences = $this->extractPropertyValuesAndReferences($nodeDataRow, $nodeType); @@ -280,6 +289,9 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $ $this->visitedNodes->add($nodeAggregateId, new DimensionSpacePointSet([$originDimensionSpacePoint->toDimensionSpacePoint()]), $nodeTypeName, $nodePath, $parentNodeAggregate->nodeAggregateId); } + /** + * @param array $nodeDataRow + */ public function extractPropertyValuesAndReferences(array $nodeDataRow, NodeType $nodeType): SerializedPropertyValuesAndReferences { $properties = []; @@ -375,7 +387,10 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen // When we specialize/generalize, we create a node variant at exactly the same tree location as the source node // If the parent node aggregate id differs, we need to move the just created variant to the new location $nodeAggregate = $this->visitedNodes->getByNodeAggregateId($nodeAggregateId); - if (!$parentNodeAggregate->nodeAggregateId->equals($nodeAggregate->getVariant($variantSourceOriginDimensionSpacePoint)->parentNodeAggregateId)) { + if ( + $variantSourceOriginDimensionSpacePoint && + !$parentNodeAggregate->nodeAggregateId->equals($nodeAggregate->getVariant($variantSourceOriginDimensionSpacePoint)->parentNodeAggregateId) + ) { $this->exportEvent(new NodeAggregateWasMoved( $this->contentStreamId, $nodeAggregateId, diff --git a/phpstan.neon b/phpstan.neon index f86c15823ee..94edcc099fe 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,6 +6,7 @@ parameters: - Neos.ContentRepository.BehavioralTests/Classes - Neos.ContentRepository.TestSuite/Classes - Neos.ContentRepository.Core/Classes + - Neos.ContentRepository.LegacyNodeMigration/Classes - Neos.Neos/Classes excludePaths: analyse: From 55ca1c650e0f263a31c3e630cc975ee5b3cdac29 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 21 Oct 2023 09:29:30 +0200 Subject: [PATCH 027/113] TASK: Remove `var_dump`s from code base ^^ --- .../src/Asset/ValueObject/SerializedImageVariant.php | 5 ----- .../Classes/Helpers/AssetExtractor.php | 2 -- 2 files changed, 7 deletions(-) diff --git a/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php b/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php index 916e39d2043..12b5a86b7fa 100644 --- a/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php +++ b/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php @@ -71,11 +71,6 @@ public static function fromArray(array $array): self public function matches(ImageVariant $imageVariant): bool { - if (self::fromImageVariant($imageVariant)->toJson() !== $this->toJson()) { - \Neos\Flow\var_dump(self::fromImageVariant($imageVariant)->toJson()); - \Neos\Flow\var_dump($this->toJson()); - exit; - } return self::fromImageVariant($imageVariant)->toJson() === $this->toJson(); } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php index d6d8b08a21a..89ce5152c53 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php @@ -60,7 +60,6 @@ private function extractAssets(mixed $propertyValue): iterable if ($propertyValue instanceof Asset) { /** @var string|null $assetId */ $assetId = $propertyValue->getIdentifier(); - \Neos\Flow\var_dump($assetId, '$assetId'); if ($assetId === null) { // TODO exception/error return; @@ -83,7 +82,6 @@ private function extractAssets(mixed $propertyValue): iterable foreach ($matches as $match) { $assetId = $match['assetId']; $asset = ($this->findAssetByIdentifier)($assetId); - \Neos\Flow\var_dump($asset, '$asset ' . $assetId); if ($asset === null) { // TODO exception/error continue; From ec9d8e5fb5268793d2b0afa32a0ee9c761375666 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 09:17:52 +0000 Subject: [PATCH 028/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index c0596712596..ee73a6130ea 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-14 +The following reference was automatically generated from code on 2023-10-21 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 6695a423ad2..79acd948b5e 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 447b2789610..582e91c9267 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 5d8d337ab11..66dd6924281 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 574b2383f18..359257c7ed2 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 07d83856e7c..350cb44df2c 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 48587653f98..937847a87a7 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 683898f185f..e4c5c45cf0f 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 30d84bea30f..9e9407aff36 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 6d51a82d932..7f7479f57ad 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 54a805fba69..b073d7b8500 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 2bba73fe9cd..6f6aaf4574e 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index f03a66dd3b4..032e57f64b7 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 7e70388c7b9..d578688b50b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 162af432765..d25b770036d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index 5d2129451e5..c5191e870e1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 36ca8d3ae18..6a3a594c574 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 07bcb34639dbf177ac9470252122c7facc25f4a2 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 09:22:35 +0000 Subject: [PATCH 029/113] TASK: Update references [skip ci] --- .../References/CommandReference.rst | 736 ++++++++++++------ .../References/EelHelpersReference.rst | 11 +- .../FlowQueryOperationReference.rst | 2 +- .../References/Signals/ContentRepository.rst | 2 +- .../Documentation/References/Signals/Flow.rst | 2 +- .../References/Signals/Media.rst | 2 +- .../Documentation/References/Signals/Neos.rst | 2 +- .../References/Validators/Flow.rst | 2 +- .../References/Validators/Media.rst | 2 +- .../References/Validators/Party.rst | 2 +- .../ViewHelpers/ContentRepository.rst | 2 +- .../References/ViewHelpers/FluidAdaptor.rst | 2 +- .../References/ViewHelpers/Form.rst | 2 +- .../References/ViewHelpers/Fusion.rst | 2 +- .../References/ViewHelpers/Media.rst | 2 +- .../References/ViewHelpers/Neos.rst | 2 +- .../References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 506 insertions(+), 271 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index c9d37944f08..ee73a6130ea 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2017-05-11 +The following reference was automatically generated from code on 2023-10-21 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: @@ -63,14 +63,14 @@ configuration and constraints. *Remove undefined node properties* removeUndefinedProperties -Will remove all undefined properties according to the node type configuration. - *Remove broken object references* removeBrokenEntityReferences Detects and removes references from nodes to entities which don't exist anymore (for example Image nodes referencing ImageVariant objects which are gone for some reason). +Will remove all undefined properties according to the node type configuration. + *Remove nodes with invalid dimensions* removeNodesWithInvalidDimensions @@ -102,6 +102,7 @@ reorderChildNodes For all nodes (or only those which match the --node-type filter specified with this command) which have configured child nodes, those child nodes are reordered according to the position from the parents NodeType configuration. + *Missing default properties* addMissingDefaultValues @@ -119,6 +120,12 @@ It searches for nodes which have a corresponding node in one of the base workspa have different node paths, but don't have a corresponding shadow node with a "movedto" value. +*Create missing sites node* +createMissingSitesNode + +If needed, creates a missing "/sites" node, which is essential for Neos to work +properly. + *Generate missing URI path segments* generateUriPathSegments @@ -133,13 +140,13 @@ Removes content dimensions from the root and sites nodes **Examples:** -``./flow node:repair`` +./flow node:repair -``./flow node:repair --node-type Neos.NodeTypes:Page`` +./flow node:repair --node-type Acme.Com:Page -``./flow node:repair --workspace user-robert --only removeOrphanNodes,removeNodesWithInvalidDimensions`` +./flow node:repair --workspace user-robert --only removeOrphanNodes,removeNodesWithInvalidDimensions -``./flow node:repair --skip removeUndefinedProperties`` +./flow node:repair --skip removeUndefinedProperties @@ -153,7 +160,7 @@ Options ``--dry-run`` Don't do anything, but report actions ``--cleanup`` - If FALSE, cleanup tasks are skipped + If false, cleanup tasks are skipped ``--skip`` Skip the given check or checks (comma separated) ``--only`` @@ -169,6 +176,31 @@ Package *NEOS.FLOW* ------------------- +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:collectgarbage`: + +``neos.flow:cache:collectgarbage`` +********************************** + +**Cache Garbage Collection** + +Runs the Garbage Collection (collectGarbage) method on all registered caches. + +Though the method is defined in the BackendInterface, the implementation +can differ and might not remove any data, depending on possibilities of +the backend. + + + +Options +^^^^^^^ + +``--cache-identifier`` + If set, this command only applies to the given cache + + + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:flush`: ``neos.flow:cache:flush`` @@ -177,7 +209,8 @@ Package *NEOS.FLOW* **Flush all caches** The flush command flushes all caches (including code caches) which have been -registered with Flow's Cache Manager. It also removes any session data. +registered with Flow's Cache Manager. It will NOT remove any session data, unless +you specifically configure the session caches to not be persistent. If fatal errors caused by a package prevent the compile time bootstrap from running, the removal of any temporary data can be forced by specifying @@ -243,6 +276,122 @@ Related commands +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:list`: + +``neos.flow:cache:list`` +************************ + +**List all configured caches and their status if available** + +This command will exit with a code 1 if at least one cache status contains errors or warnings +This allows the command to be easily integrated in CI setups (the --quiet flag can be used to reduce verbosity) + + + +Options +^^^^^^^ + +``--quiet`` + If set, this command only outputs errors & warnings + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:show`` + Display details of a cache including a detailed status if available + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:setup`: + +``neos.flow:cache:setup`` +************************* + +**Setup the given Cache if possible** + +Invokes the setup() method on the configured CacheBackend (if it implements the WithSetupInterface) +which should setup and validate the backend (i.e. create required database tables, directories, ...) + +Arguments +^^^^^^^^^ + +``--cache-identifier`` + + + + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:list`` + List all configured caches and their status if available +``neos.flow:cache:setupall`` + Setup all Caches + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:setupall`: + +``neos.flow:cache:setupall`` +**************************** + +**Setup all Caches** + +Invokes the setup() method on all configured CacheBackend that implement the WithSetupInterface interface +which should setup and validate the backend (i.e. create required database tables, directories, ...) + +This command will exit with a code 1 if at least one cache setup failed +This allows the command to be easily integrated in CI setups (the --quiet flag can be used to reduce verbosity) + + + +Options +^^^^^^^ + +``--quiet`` + If set, this command only outputs errors & warnings + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:setup`` + Setup the given Cache if possible + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:show`: + +``neos.flow:cache:show`` +************************ + +**Display details of a cache including a detailed status if available** + + + +Arguments +^^^^^^^^^ + +``--cache-identifier`` + identifier of the cache (for example "Flow_Core") + + + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:list`` + List all configured caches and their status if available + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:warmup`: ``neos.flow:cache:warmup`` @@ -320,7 +469,14 @@ Options The command shows the configuration of the current context as it is used by Flow itself. You can specify the configuration type and path if you want to show parts of the configuration. -./flow configuration:show --type Settings --path Neos.Flow.persistence +Display all settings: +./flow configuration:show + +Display Flow persistence settings: +./flow configuration:show --path Neos.Flow.persistence + +Display Flow Object Cache configuration +./flow configuration:show --type Caches --path Flow_Object_Classes @@ -328,7 +484,7 @@ Options ^^^^^^^ ``--type`` - Configuration type to show + Configuration type to show, defaults to Settings ``--path`` path to subconfiguration separated by "." like "Neos.Flow @@ -362,7 +518,7 @@ Options ``--path`` path to the subconfiguration separated by "." like "Neos.Flow ``--verbose`` - if TRUE, output more verbose information on the schema files which were used + if true, output more verbose information on the schema files which were used @@ -444,23 +600,6 @@ Arguments -.. _`Neos Command Reference: NEOS.FLOW neos.flow:core:shell`: - -``neos.flow:core:shell`` -************************ - -**Run the interactive Shell** - -The shell command runs Flow's interactive shell. This shell allows for -entering commands like through the regular command line interface but -additionally supports autocompletion and a user-based command history. - - - - - - - .. _`Neos Command Reference: NEOS.FLOW neos.flow:database:setcharset`: ``neos.flow:database:setcharset`` @@ -480,20 +619,19 @@ For background information on this, see: - http://stackoverflow.com/questions/766809/ - http://dev.mysql.com/doc/refman/5.5/en/alter-table.html +- https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434 +- https://mathiasbynens.be/notes/mysql-utf8mb4 +- https://florian.ec/articles/mysql-doctrine-utf8/ -The main purpose of this is to fix setups that were created with Flow 2.3.x or earlier and whose -database server did not have a default collation of utf8mb4_unicode_ci. In those cases, the tables will -have a collation that does not match the default collation of later Flow versions, potentially leading -to problems when creating foreign key constraints (among others, potentially). +The main purpose of this is to fix setups that were created with Flow before version 5.0. In those cases, +the tables will have a collation that does not match the default collation of later Flow versions, potentially +leading to problems when creating foreign key constraints (among others, potentially). If you have special needs regarding the charset and collation, you *can* override the defaults with -different ones. One thing this might be useful for is when switching to the utf8mb4mb4 character set, see: - -- https://mathiasbynens.be/notes/mysql-utf8mb4 -- https://florian.ec/articles/mysql-doctrine-utf8/ +different ones. Note: This command **is not a general purpose conversion tool**. It will specifically not fix cases -of actual utf8mb4 stored in latin1 columns. For this a conversion to BLOB followed by a conversion to the +of actual utf8 stored in latin1 columns. For this a conversion to BLOB followed by a conversion to the proper type, charset and collation is needed instead. @@ -697,7 +835,7 @@ Related commands **Generate a new migration** -If $diffAgainstCurrent is TRUE (the default), it generates a migration file +If $diffAgainstCurrent is true (the default), it generates a migration file with the diff between current DB structure and the found mapping metadata. Otherwise an empty migration skeleton is generated. @@ -722,6 +860,8 @@ Options Whether to base the migration on the current schema structure ``--filter-expression`` Only include tables/sequences matching the filter expression regexp +``--force`` + Generate migrations even if there are migrations left to execute @@ -756,8 +896,6 @@ Options ``--show-migrations`` Output a list of all migrations and their status -``--show-descriptions`` - Show descriptions for the migrations (enables versions display) @@ -898,30 +1036,18 @@ Options -.. _`Neos Command Reference: NEOS.FLOW neos.flow:package:activate`: - -``neos.flow:package:activate`` -****************************** +.. _`Neos Command Reference: NEOS.FLOW neos.flow:middleware:list`: -**Activate an available package** - -This command activates an existing, but currently inactive package. - -Arguments -^^^^^^^^^ +``neos.flow:middleware:list`` +***************************** -``--package-key`` - The package key of the package to create +**Lists all configured middleware components in the order they will be executed** -Related commands -^^^^^^^^^^^^^^^^ -``neos.flow:package:deactivate`` - Deactivate a package @@ -959,54 +1085,6 @@ Related commands -.. _`Neos Command Reference: NEOS.FLOW neos.flow:package:deactivate`: - -``neos.flow:package:deactivate`` -******************************** - -**Deactivate a package** - -This command deactivates a currently active package. - -Arguments -^^^^^^^^^ - -``--package-key`` - The package key of the package to create - - - - - -Related commands -^^^^^^^^^^^^^^^^ - -``neos.flow:package:activate`` - Activate an available package - - - -.. _`Neos Command Reference: NEOS.FLOW neos.flow:package:delete`: - -``neos.flow:package:delete`` -**************************** - -**Delete an existing package** - -This command deletes an existing package identified by the package key. - -Arguments -^^^^^^^^^ - -``--package-key`` - The package key of the package to create - - - - - - - .. _`Neos Command Reference: NEOS.FLOW neos.flow:package:freeze`: ``neos.flow:package:freeze`` @@ -1055,7 +1133,7 @@ Related commands **List available packages** Lists all locally available packages. Displays the package key, version and -package title and its state – active or inactive. +package title. @@ -1067,14 +1145,6 @@ Options -Related commands -^^^^^^^^^^^^^^^^ - -``neos.flow:package:activate`` - Activate an available package -``neos.flow:package:deactivate`` - Deactivate a package - .. _`Neos Command Reference: NEOS.FLOW neos.flow:package:refreeze`: @@ -1240,23 +1310,70 @@ Options -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:getpath`: +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:list`: + +``neos.flow:routing:list`` +************************** + +**List the known routes** + +This command displays a list of all currently registered routes. + + + + + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:match`: + +``neos.flow:routing:match`` +*************************** + +**Match the given URI to a corresponding route** + +This command takes an incoming URI and displays the +matched Route and the mapped routing values (if any): + +./flow routing:match "/de" --parameters="{\"requestUriHost\": \"localhost\"}" + +Arguments +^^^^^^^^^ + +``--uri`` + The incoming route, absolute or relative + + + +Options +^^^^^^^ + +``--method`` + The HTTP method to simulate (default is 'GET') +``--parameters`` + Route parameters as JSON string. Make sure to specify this option as described in the description in order to prevent parsing issues + + + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:resolve`: -``neos.flow:routing:getpath`` +``neos.flow:routing:resolve`` ***************************** -**Generate a route path** +**Build an URI for the given parameters** This command takes package, controller and action and displays the -generated route path and the selected route: +resolved URI and which route matched (if any): -./flow routing:getPath --format json Acme.Demo\\Sub\\Package +./flow routing:resolve Some.Package --controller SomeController --additional-arguments="{\"some-argument\": \"some-value\"}" Arguments ^^^^^^^^^ ``--package`` - Package key and subpackage, subpackage parts are separated with backslashes + Package key (according to "@package" route value) @@ -1264,73 +1381,86 @@ Options ^^^^^^^ ``--controller`` - Controller name, default is 'Standard' + Controller name (according to "@controller" route value), default is 'Standard' ``--action`` - Action name, default is 'index' + Action name (according to "@action" route value), default is 'index' ``--format`` - Requested Format name default is 'html' + Requested Format name (according to "@format" route value), default is 'html' +``--subpackage`` + SubPackage name (according to "@subpackage" route value) +``--additional-arguments`` + Additional route values as JSON string. Make sure to specify this option as described in the description in order to prevent parsing issues +``--parameters`` + Route parameters as JSON string. Make sure to specify this option as described in the description in order to prevent parsing issues +``--base-uri`` + Base URI of the simulated request, default ist 'http://localhost' +``--force-absolute-uri`` + Whether or not to force the creation of an absolute URI -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:list`: +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:show`: -``neos.flow:routing:list`` +``neos.flow:routing:show`` ************************** -**List the known routes** +**Show information for a route** -This command displays a list of all currently registered routes. +This command displays the configuration of a route specified by index number. + +Arguments +^^^^^^^^^ +``--index`` + The index of the route as given by routing:list -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:routepath`: -``neos.flow:routing:routepath`` -******************************* +.. _`Neos Command Reference: NEOS.FLOW neos.flow:schema:validate`: -**Route the given route path** +``neos.flow:schema:validate`` +***************************** -This command takes a given path and displays the detected route and -the selected package, controller and action. +**Validate the given configurationfile againt a schema file** -Arguments -^^^^^^^^^ -``--path`` - The route path to resolve Options ^^^^^^^ -``--method`` - The request method (GET, POST, PUT, DELETE, ...) to simulate +``--configuration-file`` + path to the validated configuration file +``--schema-file`` + path to the schema file +``--verbose`` + if true, output more verbose information on the schema files which were used -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:show`: +.. _`Neos Command Reference: NEOS.FLOW neos.flow:security:describerole`: -``neos.flow:routing:show`` -************************** +``neos.flow:security:describerole`` +*********************************** + +**Show details of a specified role** -**Show information for a route** -This command displays the configuration of a route specified by index number. Arguments ^^^^^^^^^ -``--index`` - The index of the route as given by routing:list +``--role`` + identifier of the role to describe (for example "Neos.Flow:Everybody") @@ -1432,6 +1562,27 @@ Related commands +.. _`Neos Command Reference: NEOS.FLOW neos.flow:security:listroles`: + +``neos.flow:security:listroles`` +******************************** + +**List all configured roles** + + + + + +Options +^^^^^^^ + +``--include-abstract`` + Set this flag to include abstract roles + + + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:security:showeffectivepolicy`: ``neos.flow:security:showeffectivepolicy`` @@ -1524,6 +1675,48 @@ Options +.. _`Neos Command Reference: NEOS.FLOW neos.flow:session:destroyall`: + +``neos.flow:session:destroyall`` +******************************** + +**Destroys all sessions.** + +This special command is needed, because sessions are kept in persistent storage and are not flushed +with other caches by default. + +This is functionally equivalent to +`./flow flow:cache:flushOne Flow_Session_Storage && ./flow flow:cache:flushOne Flow_Session_MetaData` + + + + + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:signal:listconnected`: + +``neos.flow:signal:listconnected`` +********************************** + +**Lists all connected signals with their slots.** + + + + + +Options +^^^^^^^ + +``--class-name`` + if specified, only signals matching the given fully qualified class name will be shown. Note: escape namespace separators or wrap the value in quotes, e.g. "--class-name Neos\\Flow\\Core\\Bootstrap". +``--method-name`` + if specified, only signals matching the given method name will be shown. This is only useful in conjunction with the "--class-name" option. + + + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:typeconverter:list`: ``neos.flow:typeconverter:list`` @@ -1565,7 +1758,7 @@ Generates Schema documentation (XSD) for your ViewHelpers, preparing the file to be placed online and used by any XSD-aware editor. After creating the XSD file, reference it in your IDE and import the namespace in your Fluid template by adding the xmlns:* attribute(s): - + Arguments ^^^^^^^^^ @@ -1579,9 +1772,11 @@ Options ^^^^^^^ ``--xsd-namespace`` - Unique target namespace used in the XSD schema (for example "http://yourdomain.org/ns/viewhelpers"). Defaults to "http://typo3.org/ns/". + Unique target namespace used in the XSD schema (for example "http://yourdomain.org/ns/viewhelpers"). Defaults to "https://neos.io/ns/". ``--target-file`` File path and name of the generated XSD schema. If not specified the schema will be output to standard output. +``--xsd-domain`` + Domain used in the XSD schema (for example "http://yourdomain.org"). Defaults to "https://neos.io". @@ -1614,8 +1809,9 @@ exist. By using the --generate-related flag, a missing package, model or repository can be created alongside, avoiding such an error. By specifying the --generate-templates flag, this command will also create -matching Fluid templates for the actions created. This option can only be -used in combination with --generate-actions. +matching Fluid templates for the actions created. +Alternatively, by specifying the --generate-fusion flag, this command will +create matching Fusion files for the actions. The default behavior is to not overwrite any existing code. This can be overridden by specifying the --force flag. @@ -1637,8 +1833,10 @@ Options Also generate index, show, new, create, edit, update and delete actions. ``--generate-templates`` Also generate the templates for each action. +``--generate-fusion`` + If Fusion templates should be generated instead of Fluid. ``--generate-related`` - Also create the mentioned package, related model and repository if neccessary. + Also create the mentioned package, related model and repository if necessary. ``--force`` Overwrite any existing controller or template code. Regardless of this flag, the package, model and repository will never be overwritten. @@ -1766,13 +1964,19 @@ Arguments +Options +^^^^^^^ + +``--package-type`` + Optional package type, e.g. "neos-plugin + Related commands ^^^^^^^^^^^^^^^^ -``typo3.flow:package:create`` - *Command not available* +``neos.flow:package:create`` + Create a new package @@ -1811,6 +2015,35 @@ Related commands +.. _`Neos Command Reference: NEOS.KICKSTARTER neos.kickstarter:kickstart:translation`: + +``neos.kickstarter:kickstart:translation`` +****************************************** + +**Kickstart translation** + +Generates the translation files for the given package. + +Arguments +^^^^^^^^^ + +``--package-key`` + The package key of the package for the translation +``--source-language-key`` + The language key of the default language + + + +Options +^^^^^^^ + +``--target-language-keys`` + Comma separated language keys for the target translations + + + + + .. _`Neos Command Reference: NEOS.MEDIA`: Package *NEOS.MEDIA* @@ -1834,6 +2067,8 @@ Options ``--preset`` Preset name, if provided only thumbnails matching that preset are cleared +``--quiet`` + If set, only errors will be displayed. @@ -1860,6 +2095,8 @@ Options Preset name, if not provided thumbnails are created for all presets ``--async`` Asynchronous generation, if not provided the setting ``Neos.Media.asyncThumbnails`` is used +``--quiet`` + If set, only errors will be displayed. @@ -1883,6 +2120,40 @@ Options ``--simulate`` If set, this command will only tell what it would do instead of doing it right away +``--quiet`` + + + + + + +.. _`Neos Command Reference: NEOS.MEDIA neos.media:media:removeunused`: + +``neos.media:media:removeunused`` +********************************* + +**Remove unused assets** + +This command iterates over all existing assets, checks their usage count and lists the assets which are not +reported as used by any AssetUsageStrategies. The unused assets can than be removed. + + + +Options +^^^^^^^ + +``--asset-source`` + If specified, only assets of this asset source are considered. For example "neos" or "my-asset-management-system +``--quiet`` + If set, only errors will be displayed. +``--assume-yes`` + If set, "yes" is assumed for the "shall I remove ..." dialogs +``--only-tags`` + Comma-separated list of asset tag labels, that should be taken into account +``--limit`` + Limit the result of unused assets displayed and removed for this run. +``--only-collections`` + Comma-separated list of asset collection titles, that should be taken into account @@ -1905,6 +2176,36 @@ Options ``--limit`` Limit the amount of thumbnails to be rendered to avoid memory exhaustion +``--quiet`` + If set, only errors will be displayed. + + + + + +.. _`Neos Command Reference: NEOS.MEDIA neos.media:media:rendervariants`: + +``neos.media:media:rendervariants`` +*********************************** + +**Render asset variants** + +Loops over missing configured asset variants and renders them. Optional ``limit`` parameter to +limit the amount of variants to be rendered to avoid memory exhaustion. + +If the re-render parameter is given, any existing variants will be rendered again, too. + + + +Options +^^^^^^^ + +``--limit`` + Limit the amount of variants to be rendered to avoid memory exhaustion +``--quiet`` + If set, only errors will be displayed. +``--recreate`` + If set, existing asset variants will be re-generated and replaced @@ -1921,7 +2222,7 @@ Package *NEOS.NEOS* ``neos.neos:domain:activate`` ***************************** -**Activate a domain record by hostname** +**Activate a domain record by hostname (with globbing)** @@ -1929,7 +2230,7 @@ Arguments ^^^^^^^^^ ``--hostname`` - The hostname to activate + The hostname to activate (globbing is supported) @@ -1950,7 +2251,7 @@ Arguments ^^^^^^^^^ ``--site-node-name`` - The nodeName of the site rootNode, e.g. "neostypo3org + The nodeName of the site rootNode, e.g. "flowneosio ``--hostname`` The hostname to match on, e.g. "flow.neos.io @@ -1973,7 +2274,7 @@ Options ``neos.neos:domain:deactivate`` ******************************* -**Deactivate a domain record by hostname** +**Deactivate a domain record by hostname (with globbing)** @@ -1981,7 +2282,7 @@ Arguments ^^^^^^^^^ ``--hostname`` - The hostname to deactivate + The hostname to deactivate (globbing is supported) @@ -1994,7 +2295,7 @@ Arguments ``neos.neos:domain:delete`` *************************** -**Delete a domain record by hostname** +**Delete a domain record by hostname (with globbing)** @@ -2002,7 +2303,7 @@ Arguments ^^^^^^^^^ ``--hostname`` - The hostname to remove + The hostname to remove (globbing is supported) @@ -2036,7 +2337,7 @@ Options ``neos.neos:site:activate`` *************************** -**Activate a site** +**Activate a site (with globbing)** This command activates the specified site. @@ -2044,7 +2345,7 @@ Arguments ^^^^^^^^^ ``--site-node`` - The node name of the site to activate + The node name of the sites to activate (globbing is supported) @@ -2062,13 +2363,12 @@ Arguments This command allows to create a blank site with just a single empty document in the default dimension. The name of the site, the packageKey must be specified. -If no ``nodeType`` option is specified the command will use `Neos.NodeTypes:Page` as fallback. The node type -must already exists and have the superType ``Neos.Neos:Document``. +The node type given with the ``nodeType`` option must already exists and have the superType ``Neos.Neos:Document``. -If no ``nodeName` option is specified the command will create a unique node-name from the name of the site. +If no ``nodeName`` option is specified the command will create a unique node-name from the name of the site. If a node name is given it has to be unique for the setup. -If the flag ``activate` is set to false new site will not be activated. +If the flag ``activate`` is set to false new site will not be activated. Arguments ^^^^^^^^^ @@ -2077,18 +2377,18 @@ Arguments The name of the site ``--package-key`` The site package +``--node-type`` + The node type to use for the site node, e.g. Amce.Com:Page Options ^^^^^^^ -``--node-type`` - The node type to use for the site node. (Default = Neos.NodeTypes:Page) ``--node-name`` The name of the site node. If no nodeName is given it will be determined from the siteName. ``--inactive`` - The new site is not activated immediately (default = false). + The new site is not activated immediately (default = false) @@ -2099,7 +2399,7 @@ Options ``neos.neos:site:deactivate`` ***************************** -**Deactivate a site** +**Deactivate a site (with globbing)** This command deactivates the specified site. @@ -2107,7 +2407,7 @@ Arguments ^^^^^^^^^ ``--site-node`` - The node name of the site to deactivate + The node name of the sites to deactivate (globbing is supported) @@ -2203,17 +2503,17 @@ Options ``neos.neos:site:prune`` ************************ -**Remove all content and related data - for now. In the future we need some more sophisticated cleanup.** +**Remove site with content and related data (with globbing)** +In the future we need some more sophisticated cleanup. +Arguments +^^^^^^^^^ +``--site-node`` + Name for site root nodes to clear only content of this sites (globbing is supported) -Options -^^^^^^^ - -``--site-node`` - Name of a site root node to clear only content of this site. @@ -2224,7 +2524,7 @@ Options ``neos.neos:user:activate`` *************************** -**Activate a user** +**Activate a user (with globbing)** This command reactivates possibly expired accounts for the given user. @@ -2236,7 +2536,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user to be activated. + The username of the user to be activated (globbing is supported) @@ -2270,7 +2570,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user + The username of the user (globbing is supported) ``--role`` Role to be added to the user, for example "Neos.Neos:Administrator" or just "Administrator @@ -2335,7 +2635,7 @@ Options ``neos.neos:user:deactivate`` ***************************** -**Deactivate a user** +**Deactivate a user (with globbing)** This command deactivates a user by flagging all of its accounts as expired. @@ -2347,7 +2647,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user to be deactivated. + The username of the user to be deactivated (globbing is supported) @@ -2366,7 +2666,7 @@ Options ``neos.neos:user:delete`` ************************* -**Delete a user** +**Delete a user (with globbing)** This command deletes an existing Neos user. All content and data directly related to this user, including but not limited to draft workspace contents, will be removed as well. @@ -2382,7 +2682,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user to be removed + The username of the user to be removed (globbing is supported) @@ -2430,7 +2730,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user + The username of the user (globbing is supported) ``--role`` Role to be removed from the user, for example "Neos.Neos:Administrator" or just "Administrator @@ -2607,39 +2907,6 @@ Options -.. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:discardall`: - -``neos.neos:workspace:discardall`` -********************************** - -**Discard changes in workspace <b>(DEPRECATED)</b>** - -This command discards all modified, created or deleted nodes in the specified workspace. - -Arguments -^^^^^^^^^ - -``--workspace-name`` - Name of the workspace, for example "user-john - - - -Options -^^^^^^^ - -``--verbose`` - If enabled, information about individual nodes will be displayed - - - -Related commands -^^^^^^^^^^^^^^^^ - -``neos.neos:workspace:discard`` - Discard changes in workspace - - - .. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:list`: ``neos.neos:workspace:list`` @@ -2687,39 +2954,6 @@ Options -.. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:publishall`: - -``neos.neos:workspace:publishall`` -********************************** - -**Publish changes of a workspace <b>(DEPRECATED)</b>** - -This command publishes all modified, created or deleted nodes in the specified workspace to the live workspace. - -Arguments -^^^^^^^^^ - -``--workspace-name`` - Name of the workspace, for example "user-john - - - -Options -^^^^^^^ - -``--verbose`` - If enabled, information about individual nodes will be displayed - - - -Related commands -^^^^^^^^^^^^^^^^ - -``neos.neos:workspace:publish`` - Publish changes of a workspace - - - .. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:rebase`: ``neos.neos:workspace:rebase`` diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index cc4fb4d5486..79acd948b5e 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Eel Helpers Reference: Api`: @@ -2036,14 +2036,15 @@ Replace occurrences of a search string inside the string Example:: String.replace("canal", "ana", "oo") == "cool" + String.replace("cool gridge", ["oo", "gri"], ["ana", "bri"]) == "canal bridge" Note: this method does not perform regular expression matching, @see pregReplace(). -* ``string`` (string) The input string -* ``search`` (string) A search string -* ``replace`` (string) A replacement string +* ``string`` (array|string|null) The input string +* ``search`` (array|string|null) A search string +* ``replace`` (array|string|null) A replacement string -**Return** (string) The string with all occurrences replaced +**Return** (array|string|string[]) The string with all occurrences replaced String.sha1(string) ^^^^^^^^^^^^^^^^^^^ diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index d5e8781214e..582e91c9267 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 1f7c9b2e2b8..66dd6924281 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 2c92fd5eed6..359257c7ed2 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index c731caf20f0..350cb44df2c 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index e453470f856..937847a87a7 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index b4f1db9548b..e4c5c45cf0f 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 2b9badece72..9e9407aff36 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index f6e6cc52989..7f7479f57ad 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 3708b9567e4..b073d7b8500 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 033b515e2d1..6f6aaf4574e 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index f6a1c13b1b6..032e57f64b7 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index e74bb37cbc6..d578688b50b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 2f1865ed761..d25b770036d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index e226405aeee..c5191e870e1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 4e8b815047f..6a3a594c574 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 98253d7a494a355c99fd118d8415dfa459323689 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 09:29:10 +0000 Subject: [PATCH 030/113] TASK: Update references [skip ci] --- .../References/CommandReference.rst | 917 ++++++++++++------ .../References/EelHelpersReference.rst | 11 +- .../FlowQueryOperationReference.rst | 2 +- .../References/Signals/ContentRepository.rst | 2 +- .../Documentation/References/Signals/Flow.rst | 2 +- .../References/Signals/Media.rst | 2 +- .../Documentation/References/Signals/Neos.rst | 2 +- .../References/Validators/Flow.rst | 2 +- .../References/Validators/Media.rst | 2 +- .../References/Validators/Party.rst | 2 +- .../ViewHelpers/ContentRepository.rst | 2 +- .../References/ViewHelpers/FluidAdaptor.rst | 2 +- .../References/ViewHelpers/Form.rst | 2 +- .../References/ViewHelpers/Fusion.rst | 2 +- .../References/ViewHelpers/Media.rst | 2 +- .../References/ViewHelpers/Neos.rst | 2 +- .../References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 620 insertions(+), 338 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 463b5db14b5..949fe3fcb78 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2017-05-11 +The following reference was automatically generated from code on 2023-10-21 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: @@ -28,58 +28,6 @@ Package *NEOS.CONTENTREPOSITORY* -------------------------------- -.. _`Neos Command Reference: NEOS.CONTENTREPOSITORY neos.contentrepository:nodetypes:show`: - -``neos.contentrepository:nodetypes:show`` -************************************** - -**Show NodeType Configuration** - -Shows the merged configuration (including supertypes) of a NodeType - -**Examples:** - -``./flow nodeTypes:show Vendor.Site:Content`` - -``./flow nodeTypes:show Vendor.Site:Content --path="properties.bar"`` - - -Options -^^^^^^^ - -``--node-type-name`` - The name of the NodeType to show -``--path`` - Optional path of the NodeType-configuration which will be shown - - - -.. _`Neos Command Reference: NEOS.CONTENTREPOSITORY neos.contentrepository:nodetypes:list`: - -``neos.contentrepository:nodetypes:list`` -************************************** - -**List NodeTypes** - -Lists all declared NodeTypes grouped by namespace - -**Examples:** - -``./flow nodeTypes:list --filter Vendor.Site:`` - -``./flow nodeTypes:list --filter Vendor.Site:Document --include-abstract`` - - - -Options -^^^^^^^ - -``--filter`` - Only NodeType-names containing this string will be listed -``--include-abstract`` - List abstract NodeTypes - - .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY neos.contentrepository:node:repair`: ``neos.contentrepository:node:repair`` @@ -115,14 +63,14 @@ configuration and constraints. *Remove undefined node properties* removeUndefinedProperties -Will remove all undefined properties according to the node type configuration. - *Remove broken object references* removeBrokenEntityReferences Detects and removes references from nodes to entities which don't exist anymore (for example Image nodes referencing ImageVariant objects which are gone for some reason). +Will remove all undefined properties according to the node type configuration. + *Remove nodes with invalid dimensions* removeNodesWithInvalidDimensions @@ -154,6 +102,7 @@ reorderChildNodes For all nodes (or only those which match the --node-type filter specified with this command) which have configured child nodes, those child nodes are reordered according to the position from the parents NodeType configuration. + *Missing default properties* addMissingDefaultValues @@ -171,6 +120,12 @@ It searches for nodes which have a corresponding node in one of the base workspa have different node paths, but don't have a corresponding shadow node with a "movedto" value. +*Create missing sites node* +createMissingSitesNode + +If needed, creates a missing "/sites" node, which is essential for Neos to work +properly. + *Generate missing URI path segments* generateUriPathSegments @@ -185,13 +140,13 @@ Removes content dimensions from the root and sites nodes **Examples:** -``./flow node:repair`` +./flow node:repair -``./flow node:repair --node-type Neos.NodeTypes:Page`` +./flow node:repair --node-type Acme.Com:Page -``./flow node:repair --workspace user-robert --only removeOrphanNodes,removeNodesWithInvalidDimensions`` +./flow node:repair --workspace user-robert --only removeOrphanNodes,removeNodesWithInvalidDimensions -``./flow node:repair --skip removeUndefinedProperties`` +./flow node:repair --skip removeUndefinedProperties @@ -205,39 +160,65 @@ Options ``--dry-run`` Don't do anything, but report actions ``--cleanup`` - If FALSE, cleanup tasks are skipped + If false, cleanup tasks are skipped ``--skip`` Skip the given check or checks (comma separated) ``--only`` Only execute the given check or checks (comma separated) -.. _`Neos Command Reference: NEOS.CONTENTREPOSITORY.MIGRATION`: -Package *NEOS.CONTENTREPOSITORY.MIGRATION* -------------------- -.. _`Neos Command Reference: NEOS.CONTENTREPOSITORY.MIGRATION neos.contentrepository.migration:node:migrationcreate`: -``neos.contentrepository.migration:node:migrationcreate`` -************************* +.. _`Neos Command Reference: NEOS.CONTENTREPOSITORY neos.contentrepository:nodetypes:list`: + +``neos.contentrepository:nodetypes:list`` +***************************************** + +**Lists all declared NodeTypes grouped by namespace** + + + + + +Options +^^^^^^^ + +``--filter`` + Only NodeType-names containing this string will be listed +``--include-abstract`` + List abstract NodeTypes + + + + + +.. _`Neos Command Reference: NEOS.CONTENTREPOSITORY neos.contentrepository:nodetypes:show`: + +``neos.contentrepository:nodetypes:show`` +***************************************** + +**Shows the merged configuration (including supertypes) of a NodeType** -**Create a node migration for the given package key** -You can specify the ``packageKey`` of your desired package. A node migration will be created in the specified package under ``/Migrations/ContentRepository/``. -The newly created node migration contains a small template to help you to get started, and also a link to the Neos documentation about how node migrations work in Neos. Arguments ^^^^^^^^^ -``--package-key`` - The key for your package (for example ``Neos.Demo``) +``--node-type-name`` + The name of the NodeType to show + -Example + +Options ^^^^^^^ -.. code-block:: bash - ./flow node:migrationcreate --package-key Neos.Demo +``--path`` + Path of the NodeType-configuration which will be shown + + + + .. _`Neos Command Reference: NEOS.FLOW`: @@ -245,6 +226,31 @@ Package *NEOS.FLOW* ------------------- +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:collectgarbage`: + +``neos.flow:cache:collectgarbage`` +********************************** + +**Cache Garbage Collection** + +Runs the Garbage Collection (collectGarbage) method on all registered caches. + +Though the method is defined in the BackendInterface, the implementation +can differ and might not remove any data, depending on possibilities of +the backend. + + + +Options +^^^^^^^ + +``--cache-identifier`` + If set, this command only applies to the given cache + + + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:flush`: ``neos.flow:cache:flush`` @@ -253,7 +259,8 @@ Package *NEOS.FLOW* **Flush all caches** The flush command flushes all caches (including code caches) which have been -registered with Flow's Cache Manager. It also removes any session data. +registered with Flow's Cache Manager. It will NOT remove any session data, unless +you specifically configure the session caches to not be persistent. If fatal errors caused by a package prevent the compile time bootstrap from running, the removal of any temporary data can be forced by specifying @@ -319,6 +326,122 @@ Related commands +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:list`: + +``neos.flow:cache:list`` +************************ + +**List all configured caches and their status if available** + +This command will exit with a code 1 if at least one cache status contains errors or warnings +This allows the command to be easily integrated in CI setups (the --quiet flag can be used to reduce verbosity) + + + +Options +^^^^^^^ + +``--quiet`` + If set, this command only outputs errors & warnings + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:show`` + Display details of a cache including a detailed status if available + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:setup`: + +``neos.flow:cache:setup`` +************************* + +**Setup the given Cache if possible** + +Invokes the setup() method on the configured CacheBackend (if it implements the WithSetupInterface) +which should setup and validate the backend (i.e. create required database tables, directories, ...) + +Arguments +^^^^^^^^^ + +``--cache-identifier`` + + + + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:list`` + List all configured caches and their status if available +``neos.flow:cache:setupall`` + Setup all Caches + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:setupall`: + +``neos.flow:cache:setupall`` +**************************** + +**Setup all Caches** + +Invokes the setup() method on all configured CacheBackend that implement the WithSetupInterface interface +which should setup and validate the backend (i.e. create required database tables, directories, ...) + +This command will exit with a code 1 if at least one cache setup failed +This allows the command to be easily integrated in CI setups (the --quiet flag can be used to reduce verbosity) + + + +Options +^^^^^^^ + +``--quiet`` + If set, this command only outputs errors & warnings + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:setup`` + Setup the given Cache if possible + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:show`: + +``neos.flow:cache:show`` +************************ + +**Display details of a cache including a detailed status if available** + + + +Arguments +^^^^^^^^^ + +``--cache-identifier`` + identifier of the cache (for example "Flow_Core") + + + + + +Related commands +^^^^^^^^^^^^^^^^ + +``neos.flow:cache:list`` + List all configured caches and their status if available + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:cache:warmup`: ``neos.flow:cache:warmup`` @@ -396,7 +519,14 @@ Options The command shows the configuration of the current context as it is used by Flow itself. You can specify the configuration type and path if you want to show parts of the configuration. -./flow configuration:show --type Settings --path Neos.Flow.persistence +Display all settings: +./flow configuration:show + +Display Flow persistence settings: +./flow configuration:show --path Neos.Flow.persistence + +Display Flow Object Cache configuration +./flow configuration:show --type Caches --path Flow_Object_Classes @@ -404,7 +534,7 @@ Options ^^^^^^^ ``--type`` - Configuration type to show + Configuration type to show, defaults to Settings ``--path`` path to subconfiguration separated by "." like "Neos.Flow @@ -438,7 +568,7 @@ Options ``--path`` path to the subconfiguration separated by "." like "Neos.Flow ``--verbose`` - if TRUE, output more verbose information on the schema files which were used + if true, output more verbose information on the schema files which were used @@ -520,23 +650,6 @@ Arguments -.. _`Neos Command Reference: NEOS.FLOW neos.flow:core:shell`: - -``neos.flow:core:shell`` -************************ - -**Run the interactive Shell** - -The shell command runs Flow's interactive shell. This shell allows for -entering commands like through the regular command line interface but -additionally supports autocompletion and a user-based command history. - - - - - - - .. _`Neos Command Reference: NEOS.FLOW neos.flow:database:setcharset`: ``neos.flow:database:setcharset`` @@ -556,20 +669,19 @@ For background information on this, see: - http://stackoverflow.com/questions/766809/ - http://dev.mysql.com/doc/refman/5.5/en/alter-table.html +- https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434 +- https://mathiasbynens.be/notes/mysql-utf8mb4 +- https://florian.ec/articles/mysql-doctrine-utf8/ -The main purpose of this is to fix setups that were created with Flow 2.3.x or earlier and whose -database server did not have a default collation of utf8mb4_unicode_ci. In those cases, the tables will -have a collation that does not match the default collation of later Flow versions, potentially leading -to problems when creating foreign key constraints (among others, potentially). +The main purpose of this is to fix setups that were created with Flow before version 5.0. In those cases, +the tables will have a collation that does not match the default collation of later Flow versions, potentially +leading to problems when creating foreign key constraints (among others, potentially). If you have special needs regarding the charset and collation, you *can* override the defaults with -different ones. One thing this might be useful for is when switching to the utf8mb4mb4 character set, see: - -- https://mathiasbynens.be/notes/mysql-utf8mb4 -- https://florian.ec/articles/mysql-doctrine-utf8/ +different ones. Note: This command **is not a general purpose conversion tool**. It will specifically not fix cases -of actual utf8mb4 stored in latin1 columns. For this a conversion to BLOB followed by a conversion to the +of actual utf8 stored in latin1 columns. For this a conversion to BLOB followed by a conversion to the proper type, charset and collation is needed instead. @@ -773,7 +885,7 @@ Related commands **Generate a new migration** -If $diffAgainstCurrent is TRUE (the default), it generates a migration file +If $diffAgainstCurrent is true (the default), it generates a migration file with the diff between current DB structure and the found mapping metadata. Otherwise an empty migration skeleton is generated. @@ -798,6 +910,8 @@ Options Whether to base the migration on the current schema structure ``--filter-expression`` Only include tables/sequences matching the filter expression regexp +``--force`` + Generate migrations even if there are migrations left to execute @@ -832,8 +946,6 @@ Options ``--show-migrations`` Output a list of all migrations and their status -``--show-descriptions`` - Show descriptions for the migrations (enables versions display) @@ -974,30 +1086,18 @@ Options -.. _`Neos Command Reference: NEOS.FLOW neos.flow:package:activate`: +.. _`Neos Command Reference: NEOS.FLOW neos.flow:middleware:list`: -``neos.flow:package:activate`` -****************************** - -**Activate an available package** - -This command activates an existing, but currently inactive package. - -Arguments -^^^^^^^^^ +``neos.flow:middleware:list`` +***************************** -``--package-key`` - The package key of the package to create +**Lists all configured middleware components in the order they will be executed** -Related commands -^^^^^^^^^^^^^^^^ -``neos.flow:package:deactivate`` - Deactivate a package @@ -1035,54 +1135,6 @@ Related commands -.. _`Neos Command Reference: NEOS.FLOW neos.flow:package:deactivate`: - -``neos.flow:package:deactivate`` -******************************** - -**Deactivate a package** - -This command deactivates a currently active package. - -Arguments -^^^^^^^^^ - -``--package-key`` - The package key of the package to create - - - - - -Related commands -^^^^^^^^^^^^^^^^ - -``neos.flow:package:activate`` - Activate an available package - - - -.. _`Neos Command Reference: NEOS.FLOW neos.flow:package:delete`: - -``neos.flow:package:delete`` -**************************** - -**Delete an existing package** - -This command deletes an existing package identified by the package key. - -Arguments -^^^^^^^^^ - -``--package-key`` - The package key of the package to create - - - - - - - .. _`Neos Command Reference: NEOS.FLOW neos.flow:package:freeze`: ``neos.flow:package:freeze`` @@ -1131,7 +1183,7 @@ Related commands **List available packages** Lists all locally available packages. Displays the package key, version and -package title and its state – active or inactive. +package title. @@ -1143,14 +1195,6 @@ Options -Related commands -^^^^^^^^^^^^^^^^ - -``neos.flow:package:activate`` - Activate an available package -``neos.flow:package:deactivate`` - Deactivate a package - .. _`Neos Command Reference: NEOS.FLOW neos.flow:package:refreeze`: @@ -1316,23 +1360,70 @@ Options -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:getpath`: +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:list`: + +``neos.flow:routing:list`` +************************** + +**List the known routes** + +This command displays a list of all currently registered routes. + + + + + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:match`: + +``neos.flow:routing:match`` +*************************** + +**Match the given URI to a corresponding route** + +This command takes an incoming URI and displays the +matched Route and the mapped routing values (if any): + +./flow routing:match "/de" --parameters="{\"requestUriHost\": \"localhost\"}" + +Arguments +^^^^^^^^^ + +``--uri`` + The incoming route, absolute or relative + + + +Options +^^^^^^^ + +``--method`` + The HTTP method to simulate (default is 'GET') +``--parameters`` + Route parameters as JSON string. Make sure to specify this option as described in the description in order to prevent parsing issues + + + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:resolve`: -``neos.flow:routing:getpath`` +``neos.flow:routing:resolve`` ***************************** -**Generate a route path** +**Build an URI for the given parameters** This command takes package, controller and action and displays the -generated route path and the selected route: +resolved URI and which route matched (if any): -./flow routing:getPath --format json Acme.Demo\\Sub\\Package +./flow routing:resolve Some.Package --controller SomeController --additional-arguments="{\"some-argument\": \"some-value\"}" Arguments ^^^^^^^^^ ``--package`` - Package key and subpackage, subpackage parts are separated with backslashes + Package key (according to "@package" route value) @@ -1340,73 +1431,86 @@ Options ^^^^^^^ ``--controller`` - Controller name, default is 'Standard' + Controller name (according to "@controller" route value), default is 'Standard' ``--action`` - Action name, default is 'index' + Action name (according to "@action" route value), default is 'index' ``--format`` - Requested Format name default is 'html' + Requested Format name (according to "@format" route value), default is 'html' +``--subpackage`` + SubPackage name (according to "@subpackage" route value) +``--additional-arguments`` + Additional route values as JSON string. Make sure to specify this option as described in the description in order to prevent parsing issues +``--parameters`` + Route parameters as JSON string. Make sure to specify this option as described in the description in order to prevent parsing issues +``--base-uri`` + Base URI of the simulated request, default ist 'http://localhost' +``--force-absolute-uri`` + Whether or not to force the creation of an absolute URI -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:list`: +.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:show`: -``neos.flow:routing:list`` +``neos.flow:routing:show`` ************************** -**List the known routes** +**Show information for a route** -This command displays a list of all currently registered routes. +This command displays the configuration of a route specified by index number. + +Arguments +^^^^^^^^^ +``--index`` + The index of the route as given by routing:list -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:routepath`: -``neos.flow:routing:routepath`` -******************************* +.. _`Neos Command Reference: NEOS.FLOW neos.flow:schema:validate`: -**Route the given route path** +``neos.flow:schema:validate`` +***************************** -This command takes a given path and displays the detected route and -the selected package, controller and action. +**Validate the given configurationfile againt a schema file** -Arguments -^^^^^^^^^ -``--path`` - The route path to resolve Options ^^^^^^^ -``--method`` - The request method (GET, POST, PUT, DELETE, ...) to simulate +``--configuration-file`` + path to the validated configuration file +``--schema-file`` + path to the schema file +``--verbose`` + if true, output more verbose information on the schema files which were used -.. _`Neos Command Reference: NEOS.FLOW neos.flow:routing:show`: +.. _`Neos Command Reference: NEOS.FLOW neos.flow:security:describerole`: -``neos.flow:routing:show`` -************************** +``neos.flow:security:describerole`` +*********************************** + +**Show details of a specified role** -**Show information for a route** -This command displays the configuration of a route specified by index number. Arguments ^^^^^^^^^ -``--index`` - The index of the route as given by routing:list +``--role`` + identifier of the role to describe (for example "Neos.Flow:Everybody") @@ -1508,6 +1612,27 @@ Related commands +.. _`Neos Command Reference: NEOS.FLOW neos.flow:security:listroles`: + +``neos.flow:security:listroles`` +******************************** + +**List all configured roles** + + + + + +Options +^^^^^^^ + +``--include-abstract`` + Set this flag to include abstract roles + + + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:security:showeffectivepolicy`: ``neos.flow:security:showeffectivepolicy`` @@ -1600,6 +1725,69 @@ Options +.. _`Neos Command Reference: NEOS.FLOW neos.flow:session:collectgarbage`: + +``neos.flow:session:collectgarbage`` +************************************ + +**Run garbage collection for sesions.** + +This command will remove session-data and -metadate of outdated sessions +identified by lastActivityTimestamp being older than inactivityTimeout + +!!! This is usually done automatically after shutdown for the percentage +of requests specified in the setting `Neos.Flow.session.garbageCollection.probability` + +Use this command if you need more direct control over the cleanup intervals. + + + + + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:session:destroyall`: + +``neos.flow:session:destroyall`` +******************************** + +**Destroys all sessions.** + +This special command is needed, because sessions are kept in persistent storage and are not flushed +with other caches by default. + +This is functionally equivalent to +`./flow flow:cache:flushOne Flow_Session_Storage && ./flow flow:cache:flushOne Flow_Session_MetaData` + + + + + + + +.. _`Neos Command Reference: NEOS.FLOW neos.flow:signal:listconnected`: + +``neos.flow:signal:listconnected`` +********************************** + +**Lists all connected signals with their slots.** + + + + + +Options +^^^^^^^ + +``--class-name`` + if specified, only signals matching the given fully qualified class name will be shown. Note: escape namespace separators or wrap the value in quotes, e.g. "--class-name Neos\\Flow\\Core\\Bootstrap". +``--method-name`` + if specified, only signals matching the given method name will be shown. This is only useful in conjunction with the "--class-name" option. + + + + + .. _`Neos Command Reference: NEOS.FLOW neos.flow:typeconverter:list`: ``neos.flow:typeconverter:list`` @@ -1641,7 +1829,7 @@ Generates Schema documentation (XSD) for your ViewHelpers, preparing the file to be placed online and used by any XSD-aware editor. After creating the XSD file, reference it in your IDE and import the namespace in your Fluid template by adding the xmlns:* attribute(s): - + Arguments ^^^^^^^^^ @@ -1655,9 +1843,11 @@ Options ^^^^^^^ ``--xsd-namespace`` - Unique target namespace used in the XSD schema (for example "http://yourdomain.org/ns/viewhelpers"). Defaults to "http://typo3.org/ns/". + Unique target namespace used in the XSD schema (for example "http://yourdomain.org/ns/viewhelpers"). Defaults to "https://neos.io/ns/". ``--target-file`` File path and name of the generated XSD schema. If not specified the schema will be output to standard output. +``--xsd-domain`` + Domain used in the XSD schema (for example "http://yourdomain.org"). Defaults to "https://neos.io". @@ -1690,8 +1880,9 @@ exist. By using the --generate-related flag, a missing package, model or repository can be created alongside, avoiding such an error. By specifying the --generate-templates flag, this command will also create -matching Fluid templates for the actions created. This option can only be -used in combination with --generate-actions. +matching Fluid templates for the actions created. +Alternatively, by specifying the --generate-fusion flag, this command will +create matching Fusion files for the actions. The default behavior is to not overwrite any existing code. This can be overridden by specifying the --force flag. @@ -1713,8 +1904,10 @@ Options Also generate index, show, new, create, edit, update and delete actions. ``--generate-templates`` Also generate the templates for each action. +``--generate-fusion`` + If Fusion templates should be generated instead of Fluid. ``--generate-related`` - Also create the mentioned package, related model and repository if neccessary. + Also create the mentioned package, related model and repository if necessary. ``--force`` Overwrite any existing controller or template code. Regardless of this flag, the package, model and repository will never be overwritten. @@ -1842,13 +2035,19 @@ Arguments +Options +^^^^^^^ + +``--package-type`` + Optional package type, e.g. "neos-plugin + Related commands ^^^^^^^^^^^^^^^^ -``typo3.flow:package:create`` - *Command not available* +``neos.flow:package:create`` + Create a new package @@ -1887,6 +2086,35 @@ Related commands +.. _`Neos Command Reference: NEOS.KICKSTARTER neos.kickstarter:kickstart:translation`: + +``neos.kickstarter:kickstart:translation`` +****************************************** + +**Kickstart translation** + +Generates the translation files for the given package. + +Arguments +^^^^^^^^^ + +``--package-key`` + The package key of the package for the translation +``--source-language-key`` + The language key of the default language + + + +Options +^^^^^^^ + +``--target-language-keys`` + Comma separated language keys for the target translations + + + + + .. _`Neos Command Reference: NEOS.MEDIA`: Package *NEOS.MEDIA* @@ -1910,6 +2138,8 @@ Options ``--preset`` Preset name, if provided only thumbnails matching that preset are cleared +``--quiet`` + If set, only errors will be displayed. @@ -1925,7 +2155,7 @@ Options Creates thumbnail images based on the configured thumbnail presets. Optional ``preset`` parameter to only create thumbnails for a specific thumbnail preset configuration. -Additionally accepts a ``async`` parameter determining if the created thumbnails are generated when created. +Additionally, accepts a ``async`` parameter determining if the created thumbnails are generated when created. @@ -1936,6 +2166,8 @@ Options Preset name, if not provided thumbnails are created for all presets ``--async`` Asynchronous generation, if not provided the setting ``Neos.Media.asyncThumbnails`` is used +``--quiet`` + If set, only errors will be displayed. @@ -1959,6 +2191,92 @@ Options ``--simulate`` If set, this command will only tell what it would do instead of doing it right away +``--quiet`` + + + + + + +.. _`Neos Command Reference: NEOS.MEDIA neos.media:media:listvariantpresets`: + +``neos.media:media:listvariantpresets`` +*************************************** + +**List all configurations for your imageVariants.** + +Doesn't matter if configured under 'Neos.Media.variantPresets' or already deleted from this configuration. +This command will find every single one for you. + + + + + + + +.. _`Neos Command Reference: NEOS.MEDIA neos.media:media:removeunused`: + +``neos.media:media:removeunused`` +********************************* + +**Remove unused assets** + +This command iterates over all existing assets, checks their usage count and lists the assets which are not +reported as used by any AssetUsageStrategies. The unused assets can than be removed. + + + +Options +^^^^^^^ + +``--asset-source`` + If specified, only assets of this asset source are considered. For example "neos" or "my-asset-management-system +``--quiet`` + If set, only errors will be displayed. +``--assume-yes`` + If set, "yes" is assumed for the "shall I remove ..." dialogs +``--only-tags`` + Comma-separated list of asset tag labels, that should be taken into account +``--limit`` + Limit the result of unused assets displayed and removed for this run. +``--only-collections`` + Comma-separated list of asset collection titles, that should be taken into account + + + + + +.. _`Neos Command Reference: NEOS.MEDIA neos.media:media:removevariants`: + +``neos.media:media:removevariants`` +*********************************** + +**Cleanup imageVariants with provided identifier and variant name.** + +Image variants that are still configured are removed without usage check and +can be regenerated afterwards with `media:renderVariants`. + +This command will not remove any custom cropped image variants. + +Arguments +^^^^^^^^^ + +``--identifier`` + Identifier of variants to remove. +``--variant-name`` + Variants with this name will be removed (if exist). + + + +Options +^^^^^^^ + +``--quiet`` + If set, only errors and questions will be displayed. +``--assume-yes`` + If set, "yes" is assumed for the "shall I remove ..." dialog. +``--limit`` + Limit the result of unused assets displayed and removed for this run. @@ -1981,6 +2299,36 @@ Options ``--limit`` Limit the amount of thumbnails to be rendered to avoid memory exhaustion +``--quiet`` + If set, only errors will be displayed. + + + + + +.. _`Neos Command Reference: NEOS.MEDIA neos.media:media:rendervariants`: + +``neos.media:media:rendervariants`` +*********************************** + +**Render asset variants** + +Loops over missing configured asset variants and renders them. Optional ``limit`` parameter to +limit the amount of variants to be rendered to avoid memory exhaustion. + +If the re-render parameter is given, any existing variants will be rendered again, too. + + + +Options +^^^^^^^ + +``--limit`` + Limit the amount of variants to be rendered to avoid memory exhaustion +``--quiet`` + If set, only errors will be displayed. +``--recreate`` + If set, existing asset variants will be re-generated and replaced @@ -1997,7 +2345,7 @@ Package *NEOS.NEOS* ``neos.neos:domain:activate`` ***************************** -**Activate a domain record by hostname** +**Activate a domain record by hostname (with globbing)** @@ -2005,7 +2353,7 @@ Arguments ^^^^^^^^^ ``--hostname`` - The hostname to activate + The hostname to activate (globbing is supported) @@ -2026,7 +2374,7 @@ Arguments ^^^^^^^^^ ``--site-node-name`` - The nodeName of the site rootNode, e.g. "neostypo3org + The nodeName of the site rootNode, e.g. "flowneosio ``--hostname`` The hostname to match on, e.g. "flow.neos.io @@ -2049,7 +2397,7 @@ Options ``neos.neos:domain:deactivate`` ******************************* -**Deactivate a domain record by hostname** +**Deactivate a domain record by hostname (with globbing)** @@ -2057,7 +2405,7 @@ Arguments ^^^^^^^^^ ``--hostname`` - The hostname to deactivate + The hostname to deactivate (globbing is supported) @@ -2070,7 +2418,7 @@ Arguments ``neos.neos:domain:delete`` *************************** -**Delete a domain record by hostname** +**Delete a domain record by hostname (with globbing)** @@ -2078,7 +2426,7 @@ Arguments ^^^^^^^^^ ``--hostname`` - The hostname to remove + The hostname to remove (globbing is supported) @@ -2112,7 +2460,7 @@ Options ``neos.neos:site:activate`` *************************** -**Activate a site** +**Activate a site (with globbing)** This command activates the specified site. @@ -2120,7 +2468,7 @@ Arguments ^^^^^^^^^ ``--site-node`` - The node name of the site to activate + The node name of the sites to activate (globbing is supported) @@ -2138,13 +2486,12 @@ Arguments This command allows to create a blank site with just a single empty document in the default dimension. The name of the site, the packageKey must be specified. -If no ``nodeType`` option is specified the command will use `Neos.NodeTypes:Page` as fallback. The node type -must already exists and have the superType ``Neos.Neos:Document``. +The node type given with the ``nodeType`` option must already exists and have the superType ``Neos.Neos:Document``. -If no ``nodeName` option is specified the command will create a unique node-name from the name of the site. +If no ``nodeName`` option is specified the command will create a unique node-name from the name of the site. If a node name is given it has to be unique for the setup. -If the flag ``activate` is set to false new site will not be activated. +If the flag ``activate`` is set to false new site will not be activated. Arguments ^^^^^^^^^ @@ -2153,18 +2500,18 @@ Arguments The name of the site ``--package-key`` The site package +``--node-type`` + The node type to use for the site node, e.g. Amce.Com:Page Options ^^^^^^^ -``--node-type`` - The node type to use for the site node. (Default = Neos.NodeTypes:Page) ``--node-name`` The name of the site node. If no nodeName is given it will be determined from the siteName. ``--inactive`` - The new site is not activated immediately (default = false). + The new site is not activated immediately (default = false) @@ -2175,7 +2522,7 @@ Options ``neos.neos:site:deactivate`` ***************************** -**Deactivate a site** +**Deactivate a site (with globbing)** This command deactivates the specified site. @@ -2183,7 +2530,7 @@ Arguments ^^^^^^^^^ ``--site-node`` - The node name of the site to deactivate + The node name of the sites to deactivate (globbing is supported) @@ -2279,17 +2626,17 @@ Options ``neos.neos:site:prune`` ************************ -**Remove all content and related data - for now. In the future we need some more sophisticated cleanup.** - +**Remove site with content and related data (with globbing)** +In the future we need some more sophisticated cleanup. +Arguments +^^^^^^^^^ +``--site-node`` + Name for site root nodes to clear only content of this sites (globbing is supported) -Options -^^^^^^^ -``--site-node`` - Name of a site root node to clear only content of this site. @@ -2300,7 +2647,7 @@ Options ``neos.neos:user:activate`` *************************** -**Activate a user** +**Activate a user (with globbing)** This command reactivates possibly expired accounts for the given user. @@ -2312,7 +2659,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user to be activated. + The username of the user to be activated (globbing is supported) @@ -2346,7 +2693,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user + The username of the user (globbing is supported) ``--role`` Role to be added to the user, for example "Neos.Neos:Administrator" or just "Administrator @@ -2411,7 +2758,7 @@ Options ``neos.neos:user:deactivate`` ***************************** -**Deactivate a user** +**Deactivate a user (with globbing)** This command deactivates a user by flagging all of its accounts as expired. @@ -2423,7 +2770,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user to be deactivated. + The username of the user to be deactivated (globbing is supported) @@ -2442,7 +2789,7 @@ Options ``neos.neos:user:delete`` ************************* -**Delete a user** +**Delete a user (with globbing)** This command deletes an existing Neos user. All content and data directly related to this user, including but not limited to draft workspace contents, will be removed as well. @@ -2458,7 +2805,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user to be removed + The username of the user to be removed (globbing is supported) @@ -2506,7 +2853,7 @@ Arguments ^^^^^^^^^ ``--username`` - The username of the user + The username of the user (globbing is supported) ``--role`` Role to be removed from the user, for example "Neos.Neos:Administrator" or just "Administrator @@ -2683,39 +3030,6 @@ Options -.. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:discardall`: - -``neos.neos:workspace:discardall`` -********************************** - -**Discard changes in workspace <b>(DEPRECATED)</b>** - -This command discards all modified, created or deleted nodes in the specified workspace. - -Arguments -^^^^^^^^^ - -``--workspace-name`` - Name of the workspace, for example "user-john - - - -Options -^^^^^^^ - -``--verbose`` - If enabled, information about individual nodes will be displayed - - - -Related commands -^^^^^^^^^^^^^^^^ - -``neos.neos:workspace:discard`` - Discard changes in workspace - - - .. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:list`: ``neos.neos:workspace:list`` @@ -2763,39 +3077,6 @@ Options -.. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:publishall`: - -``neos.neos:workspace:publishall`` -********************************** - -**Publish changes of a workspace <b>(DEPRECATED)</b>** - -This command publishes all modified, created or deleted nodes in the specified workspace to the live workspace. - -Arguments -^^^^^^^^^ - -``--workspace-name`` - Name of the workspace, for example "user-john - - - -Options -^^^^^^^ - -``--verbose`` - If enabled, information about individual nodes will be displayed - - - -Related commands -^^^^^^^^^^^^^^^^ - -``neos.neos:workspace:publish`` - Publish changes of a workspace - - - .. _`Neos Command Reference: NEOS.NEOS neos.neos:workspace:rebase`: ``neos.neos:workspace:rebase`` diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index f48f614ca07..2a36c870d79 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Eel Helpers Reference: Api`: @@ -2091,14 +2091,15 @@ Replace occurrences of a search string inside the string Example:: String.replace("canal", "ana", "oo") == "cool" + String.replace("cool gridge", ["oo", "gri"], ["ana", "bri"]) == "canal bridge" Note: this method does not perform regular expression matching, @see pregReplace(). -* ``string`` (string) The input string -* ``search`` (string) A search string -* ``replace`` (string) A replacement string +* ``string`` (array|string|null) The input string +* ``search`` (array|string|null) A search string +* ``replace`` (array|string|null) A replacement string -**Return** (string) The string with all occurrences replaced +**Return** (array|string|string[]) The string with all occurrences replaced String.sha1(string) ^^^^^^^^^^^^^^^^^^^ diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index d5e8781214e..582e91c9267 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 1f7c9b2e2b8..66dd6924281 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 2c92fd5eed6..359257c7ed2 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index c731caf20f0..350cb44df2c 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index e453470f856..937847a87a7 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 6f1db83cbea..fe603202ce7 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 2b9badece72..9e9407aff36 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index f6e6cc52989..7f7479f57ad 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 3708b9567e4..b073d7b8500 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 033b515e2d1..6f6aaf4574e 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index f6a1c13b1b6..032e57f64b7 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index e74bb37cbc6..d578688b50b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 2f1865ed761..d25b770036d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index e226405aeee..c5191e870e1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 4e8b815047f..6a3a594c574 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-09-28 +This reference was automatically generated from code on 2023-10-21 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From e8316fa904d7be0fd246643417b3bc1aa3514978 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 09:52:46 +0000 Subject: [PATCH 031/113] TASK: Add changelog for 7.3.16 [skip ci] See https://jenkins.neos.io/job/neos-release/394/ --- .../Appendixes/ChangeLogs/7316.rst | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 Neos.Neos/Documentation/Appendixes/ChangeLogs/7316.rst diff --git a/Neos.Neos/Documentation/Appendixes/ChangeLogs/7316.rst b/Neos.Neos/Documentation/Appendixes/ChangeLogs/7316.rst new file mode 100644 index 00000000000..512236f16b2 --- /dev/null +++ b/Neos.Neos/Documentation/Appendixes/ChangeLogs/7316.rst @@ -0,0 +1,175 @@ +`7.3.16 (2023-10-21) `_ +================================================================================================ + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`BUGFIX: Only discard nodes in same workspace `_ +--------------------------------------------------------------------------------------------------------------- + +* Resolves: `#4577 `_ + +* Packages: ``ContentRepository`` + +`BUGFIX: Load all thumbnails for an asset to skip further requests `_ +------------------------------------------------------------------------------------------------------------------------------------ + +For the usecase of images with responsive variants this change prevents additional database requests for each additional variant of an image. + +This can greatly reduce the number of queries on pages with many source tags or sources attributes for pictures and images. + +**Review instructions** + +As soon as an image is rendered in several sizes on a page the patch should skip additional db requests in the thumbnails repository. +Persistent resources and image entities are still queried as via the node property getter and to resolve the thumbnail. + + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Allow unsetting thumbnail presets `_ +------------------------------------------------------------------------------------------------------------ + +* Resolves: `#3544 `_ + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Don’t query for abstract nodetypes in nodedata repository `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +As abstract nodetypes don't (shouldn't) appear in the database it makes no sense to query them. + +This is a regression that was introduced a long time ago, when the default parameter to include abstract nodetypes was added to the ``getSubNodeTypes`` method in the ``NodeTypeManager`` without adjusting the call in the ``NodeDataRepository->getNodeTypeFilterConstraintsForDql`` which relied on the previous behaviour. + +The call in the method ``getNodeTypeFilterConstraints`` was fixed some years ago, but that method seems unused. + +* Packages: ``ContentRepository`` + +`BUGFIX: Consistently initialize asset sources via `createFromConfiguration` `_ +---------------------------------------------------------------------------------------------------------------------------------------------- + +fixes: `#3965 `_ + +**The Problem** + +The case at hand was an asset source that uses a value object to validate the incoming asset source options. I expected to be able to define a promoted constructor property with said value object as its declared type: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + public function __construct( + private readonly string $assetSourceIdentifier, + private readonly Options $options + ) { + } + + /* ... */ +} +``` + +...and initialize the value object in the ``createFromConfiguration`` static factory method defined by the ``AssetSourceInterface``: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + /* ... */ + + public static function createFromConfiguration(string $assetSourceIdentifier, array $assetSourceOptions): AssetSourceInterface + { + return new static( + $assetSourceIdentifier, + Options::fromArray($assetSourceOptions) + ); + } +} +``` + +This failed with a Type Error, because the ``AssetSourceService``, which is responsible for initializing asset sources, at one point does not utilize ``createFromConfiguration`` to perform initialization, but calls the asset source constructor directly: + +https://github.com/neos/neos-development-collection/blob/`a4791b623161259b31d2d11b343310bd7ef76507 `_/Neos.Media/Classes/Domain/Service/AssetSourceService.php#L178 + +**The Solution** + +I adjusted the aforementioned routine of the ``AssetSourceService`` to use the ``AssetSourceInterface``-defined ``createFromConfiguration`` static factory method instead of the asset source's constructor. + +Even though the pattern I described above only makes sense in a PHP >8.0 environment, I decided to target Neos 7.3 with this PR, because it should constitute a non-breaking bugfix. + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Guard that Fusion path cannot be empty `_ +----------------------------------------------------------------------------------------------------------------- + +Previously in php 7.4 this ``Neos\\Fusion\\Exception\\MissingFusionObjectException`` was thrown + +> No Fusion object found in path "" + +but with php 8 this ``ValueError`` is thrown which is unexpected + +> strrpos(): Argument `#3 ``_($offset) must be contained in argument ``#1 `_($haystack) + +This change takes care of throwing an explicit ``Neos\\Fusion\\Exception`` instead: + +> Fusion path cannot be empty. + + +-------- + +This error was noticed in the out of band rendering, when there is no content element wrapping: https://discuss.neos.io/t/argument-3-offset-must-be-contained-in-argument-1-haystack/6416/4 + +image + + + +**Upgrade instructions** + +**Review instructions** + + +* Packages: ``Neos`` ``Fusion`` + +`BUGFIX: Fix `NodeType` `getTypeOfAutoCreatedChildNode` and `getPropertyType` `_ +----------------------------------------------------------------------------------------------------------------------------------------------- + +resolves partially `#4333 `_ +resolves partially `#4344 `_ + +**Upgrade instructions** + +**Review instructions** + + +* Packages: ``Neos`` ``ContentRepository`` + +`TASK: Fix documentation builds `_ +------------------------------------------------------------------------------------------------- + +… by pinning updated dependencies. + +**Review instructions** + +Best is to see if the builds succeed on RTD again with this merged… + + +* Packages: ``Neos`` ``Media`` + +`TASK: Fix paths for Neos.Media RTD rendering setup `_ +--------------------------------------------------------------------------------------------------------------------- + +The paths need to be from the repo root, not relative to the ``.readthedocs.yaml`` file (it seems). + + +* Packages: ``Neos`` ``Media`` + +`TASK: Add configuration files for RTD `_ +-------------------------------------------------------------------------------------------------------- + +This add ``.readthedocs.yaml`` files for the collection (handling ``Neos.Neos``) and for ``neos.Media``, to solve failing documentation rendering. + +**Review instructions** + +This can be compared to the configuration we have in place for ``Neos.Flow`` in the Flow development collection. + + +* Packages: ``Media`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 58673f9f3f8dd815ccc4379329d6efeed492de0e Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 09:58:46 +0000 Subject: [PATCH 032/113] TASK: Add changelog for 8.0.13 [skip ci] See https://jenkins.neos.io/job/neos-release/395/ --- .../Appendixes/ChangeLogs/8013.rst | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 Neos.Neos/Documentation/Appendixes/ChangeLogs/8013.rst diff --git a/Neos.Neos/Documentation/Appendixes/ChangeLogs/8013.rst b/Neos.Neos/Documentation/Appendixes/ChangeLogs/8013.rst new file mode 100644 index 00000000000..a3f85f1db68 --- /dev/null +++ b/Neos.Neos/Documentation/Appendixes/ChangeLogs/8013.rst @@ -0,0 +1,171 @@ +`8.0.13 (2023-10-21) `_ +================================================================================================ + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`BUGFIX: Only discard nodes in same workspace `_ +--------------------------------------------------------------------------------------------------------------- + +* Resolves: `#4577 `_ + +* Packages: ``ContentRepository`` + +`BUGFIX: Load all thumbnails for an asset to skip further requests `_ +------------------------------------------------------------------------------------------------------------------------------------ + +For the usecase of images with responsive variants this change prevents additional database requests for each additional variant of an image. + +This can greatly reduce the number of queries on pages with many source tags or sources attributes for pictures and images. + +**Review instructions** + +As soon as an image is rendered in several sizes on a page the patch should skip additional db requests in the thumbnails repository. +Persistent resources and image entities are still queried as via the node property getter and to resolve the thumbnail. + + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Allow unsetting thumbnail presets `_ +------------------------------------------------------------------------------------------------------------ + +* Resolves: `#3544 `_ + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Don’t query for abstract nodetypes in nodedata repository `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +As abstract nodetypes don't (shouldn't) appear in the database it makes no sense to query them. + +This is a regression that was introduced a long time ago, when the default parameter to include abstract nodetypes was added to the ``getSubNodeTypes`` method in the ``NodeTypeManager`` without adjusting the call in the ``NodeDataRepository->getNodeTypeFilterConstraintsForDql`` which relied on the previous behaviour. + +The call in the method ``getNodeTypeFilterConstraints`` was fixed some years ago, but that method seems unused. + +* Packages: ``ContentRepository`` + +`BUGFIX: Consistently initialize asset sources via `createFromConfiguration` `_ +---------------------------------------------------------------------------------------------------------------------------------------------- + +fixes: `#3965 `_ + +**The Problem** + +The case at hand was an asset source that uses a value object to validate the incoming asset source options. I expected to be able to define a promoted constructor property with said value object as its declared type: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + public function __construct( + private readonly string $assetSourceIdentifier, + private readonly Options $options + ) { + } + + /* ... */ +} +``` + +...and initialize the value object in the ``createFromConfiguration`` static factory method defined by the ``AssetSourceInterface``: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + /* ... */ + + public static function createFromConfiguration(string $assetSourceIdentifier, array $assetSourceOptions): AssetSourceInterface + { + return new static( + $assetSourceIdentifier, + Options::fromArray($assetSourceOptions) + ); + } +} +``` + +This failed with a Type Error, because the ``AssetSourceService``, which is responsible for initializing asset sources, at one point does not utilize ``createFromConfiguration`` to perform initialization, but calls the asset source constructor directly: + +https://github.com/neos/neos-development-collection/blob/`a4791b623161259b31d2d11b343310bd7ef76507 `_/Neos.Media/Classes/Domain/Service/AssetSourceService.php#L178 + +**The Solution** + +I adjusted the aforementioned routine of the ``AssetSourceService`` to use the ``AssetSourceInterface``-defined ``createFromConfiguration`` static factory method instead of the asset source's constructor. + +Even though the pattern I described above only makes sense in a PHP >8.0 environment, I decided to target Neos 7.3 with this PR, because it should constitute a non-breaking bugfix. + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Guard that Fusion path cannot be empty `_ +----------------------------------------------------------------------------------------------------------------- + +Previously in php 7.4 this ``Neos\\Fusion\\Exception\\MissingFusionObjectException`` was thrown + +> No Fusion object found in path "" + +but with php 8 this ``ValueError`` is thrown which is unexpected + +> strrpos(): Argument `#3 ``_($offset) must be contained in argument ``#1 `_($haystack) + +This change takes care of throwing an explicit ``Neos\\Fusion\\Exception`` instead: + +> Fusion path cannot be empty. + + +-------- + +This error was noticed in the out of band rendering, when there is no content element wrapping: https://discuss.neos.io/t/argument-3-offset-must-be-contained-in-argument-1-haystack/6416/4 + +image + + + +**Upgrade instructions** + + +* Packages: ``Neos`` ``Fusion`` + +`BUGFIX: Fix `NodeType` `getTypeOfAutoCreatedChildNode` and `getPropertyType` `_ +----------------------------------------------------------------------------------------------------------------------------------------------- + +resolves partially `#4333 `_ +resolves partially `#4344 `_ + +**Upgrade instructions** + + +* Packages: ``Neos`` ``ContentRepository`` + +`TASK: Fix documentation builds `_ +------------------------------------------------------------------------------------------------- + +… by pinning updated dependencies. + +**Review instructions** + +Best is to see if the builds succeed on RTD again with this merged… + + +* Packages: ``Neos`` ``Media`` + +`TASK: Fix paths for Neos.Media RTD rendering setup `_ +--------------------------------------------------------------------------------------------------------------------- + +The paths need to be from the repo root, not relative to the ``.readthedocs.yaml`` file (it seems). + + +* Packages: ``Neos`` ``Media`` + +`TASK: Add configuration files for RTD `_ +-------------------------------------------------------------------------------------------------------- + +This add ``.readthedocs.yaml`` files for the collection (handling ``Neos.Neos``) and for ``neos.Media``, to solve failing documentation rendering. + +**Review instructions** + +This can be compared to the configuration we have in place for ``Neos.Flow`` in the Flow development collection. + + +* Packages: ``Media`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 2f86ef4234828147e9b5cc330ad20d80fc4bc7a2 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 10:00:50 +0000 Subject: [PATCH 033/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index ea302e2d4cb..7ce67ac5624 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-20 +The following reference was automatically generated from code on 2023-10-21 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index b60677e0a6f..00005d0d80d 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index d949bb4de18..582e91c9267 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 6066b426820..66dd6924281 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 384a2a03257..5895a7d401f 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 0adc111a13e..350cb44df2c 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 019dfc2064e..d32d606fadd 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index a45115fad9a..e4c5c45cf0f 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 9a60ca15e92..9e9407aff36 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 1d0d0d53826..7f7479f57ad 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index a1023b01e60..b073d7b8500 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 99a4e6fd91b..6f6aaf4574e 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index f1c98250199..032e57f64b7 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 89aefe324d1..d578688b50b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index fe5c732eec8..d25b770036d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index 95228159a5e..c5191e870e1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index def60af0c31..6a3a594c574 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-20 +This reference was automatically generated from code on 2023-10-21 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From dcf83099ef1efc6afd48ee342601363eb7aaee99 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 10:06:55 +0000 Subject: [PATCH 034/113] TASK: Add changelog for 8.1.8 [skip ci] See https://jenkins.neos.io/job/neos-release/396/ --- .../Appendixes/ChangeLogs/818.rst | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 Neos.Neos/Documentation/Appendixes/ChangeLogs/818.rst diff --git a/Neos.Neos/Documentation/Appendixes/ChangeLogs/818.rst b/Neos.Neos/Documentation/Appendixes/ChangeLogs/818.rst new file mode 100644 index 00000000000..ee60cbb6212 --- /dev/null +++ b/Neos.Neos/Documentation/Appendixes/ChangeLogs/818.rst @@ -0,0 +1,171 @@ +`8.1.8 (2023-10-21) `_ +============================================================================================== + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`BUGFIX: Only discard nodes in same workspace `_ +--------------------------------------------------------------------------------------------------------------- + +* Resolves: `#4577 `_ + +* Packages: ``ContentRepository`` + +`BUGFIX: Load all thumbnails for an asset to skip further requests `_ +------------------------------------------------------------------------------------------------------------------------------------ + +For the usecase of images with responsive variants this change prevents additional database requests for each additional variant of an image. + +This can greatly reduce the number of queries on pages with many source tags or sources attributes for pictures and images. + +**Review instructions** + +As soon as an image is rendered in several sizes on a page the patch should skip additional db requests in the thumbnails repository. +Persistent resources and image entities are still queried as via the node property getter and to resolve the thumbnail. + + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Allow unsetting thumbnail presets `_ +------------------------------------------------------------------------------------------------------------ + +* Resolves: `#3544 `_ + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Don’t query for abstract nodetypes in nodedata repository `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +As abstract nodetypes don't (shouldn't) appear in the database it makes no sense to query them. + +This is a regression that was introduced a long time ago, when the default parameter to include abstract nodetypes was added to the ``getSubNodeTypes`` method in the ``NodeTypeManager`` without adjusting the call in the ``NodeDataRepository->getNodeTypeFilterConstraintsForDql`` which relied on the previous behaviour. + +The call in the method ``getNodeTypeFilterConstraints`` was fixed some years ago, but that method seems unused. + +* Packages: ``ContentRepository`` + +`BUGFIX: Consistently initialize asset sources via `createFromConfiguration` `_ +---------------------------------------------------------------------------------------------------------------------------------------------- + +fixes: `#3965 `_ + +**The Problem** + +The case at hand was an asset source that uses a value object to validate the incoming asset source options. I expected to be able to define a promoted constructor property with said value object as its declared type: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + public function __construct( + private readonly string $assetSourceIdentifier, + private readonly Options $options + ) { + } + + /* ... */ +} +``` + +...and initialize the value object in the ``createFromConfiguration`` static factory method defined by the ``AssetSourceInterface``: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + /* ... */ + + public static function createFromConfiguration(string $assetSourceIdentifier, array $assetSourceOptions): AssetSourceInterface + { + return new static( + $assetSourceIdentifier, + Options::fromArray($assetSourceOptions) + ); + } +} +``` + +This failed with a Type Error, because the ``AssetSourceService``, which is responsible for initializing asset sources, at one point does not utilize ``createFromConfiguration`` to perform initialization, but calls the asset source constructor directly: + +https://github.com/neos/neos-development-collection/blob/`a4791b623161259b31d2d11b343310bd7ef76507 `_/Neos.Media/Classes/Domain/Service/AssetSourceService.php#L178 + +**The Solution** + +I adjusted the aforementioned routine of the ``AssetSourceService`` to use the ``AssetSourceInterface``-defined ``createFromConfiguration`` static factory method instead of the asset source's constructor. + +Even though the pattern I described above only makes sense in a PHP >8.0 environment, I decided to target Neos 7.3 with this PR, because it should constitute a non-breaking bugfix. + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Guard that Fusion path cannot be empty `_ +----------------------------------------------------------------------------------------------------------------- + +Previously in php 7.4 this ``Neos\\Fusion\\Exception\\MissingFusionObjectException`` was thrown + +> No Fusion object found in path "" + +but with php 8 this ``ValueError`` is thrown which is unexpected + +> strrpos(): Argument `#3 ``_($offset) must be contained in argument ``#1 `_($haystack) + +This change takes care of throwing an explicit ``Neos\\Fusion\\Exception`` instead: + +> Fusion path cannot be empty. + + +-------- + +This error was noticed in the out of band rendering, when there is no content element wrapping: https://discuss.neos.io/t/argument-3-offset-must-be-contained-in-argument-1-haystack/6416/4 + +image + + + +**Upgrade instructions** + + +* Packages: ``Neos`` ``Fusion`` + +`BUGFIX: Fix `NodeType` `getTypeOfAutoCreatedChildNode` and `getPropertyType` `_ +----------------------------------------------------------------------------------------------------------------------------------------------- + +resolves partially `#4333 `_ +resolves partially `#4344 `_ + +**Upgrade instructions** + + +* Packages: ``Neos`` ``ContentRepository`` + +`TASK: Fix documentation builds `_ +------------------------------------------------------------------------------------------------- + +… by pinning updated dependencies. + +**Review instructions** + +Best is to see if the builds succeed on RTD again with this merged… + + +* Packages: ``Neos`` ``Media`` + +`TASK: Fix paths for Neos.Media RTD rendering setup `_ +--------------------------------------------------------------------------------------------------------------------- + +The paths need to be from the repo root, not relative to the ``.readthedocs.yaml`` file (it seems). + + +* Packages: ``Neos`` ``Media`` + +`TASK: Add configuration files for RTD `_ +-------------------------------------------------------------------------------------------------------- + +This add ``.readthedocs.yaml`` files for the collection (handling ``Neos.Neos``) and for ``neos.Media``, to solve failing documentation rendering. + +**Review instructions** + +This can be compared to the configuration we have in place for ``Neos.Flow`` in the Flow development collection. + + +* Packages: ``Media`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 5442ddd8f4410764d34dca5fe1b59aa87f2574a9 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 10:13:28 +0000 Subject: [PATCH 035/113] TASK: Add changelog for 8.2.8 [skip ci] See https://jenkins.neos.io/job/neos-release/397/ --- .../Appendixes/ChangeLogs/828.rst | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 Neos.Neos/Documentation/Appendixes/ChangeLogs/828.rst diff --git a/Neos.Neos/Documentation/Appendixes/ChangeLogs/828.rst b/Neos.Neos/Documentation/Appendixes/ChangeLogs/828.rst new file mode 100644 index 00000000000..7c8c2b227a9 --- /dev/null +++ b/Neos.Neos/Documentation/Appendixes/ChangeLogs/828.rst @@ -0,0 +1,171 @@ +`8.2.8 (2023-10-21) `_ +============================================================================================== + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`BUGFIX: Only discard nodes in same workspace `_ +--------------------------------------------------------------------------------------------------------------- + +* Resolves: `#4577 `_ + +* Packages: ``ContentRepository`` + +`BUGFIX: Load all thumbnails for an asset to skip further requests `_ +------------------------------------------------------------------------------------------------------------------------------------ + +For the usecase of images with responsive variants this change prevents additional database requests for each additional variant of an image. + +This can greatly reduce the number of queries on pages with many source tags or sources attributes for pictures and images. + +**Review instructions** + +As soon as an image is rendered in several sizes on a page the patch should skip additional db requests in the thumbnails repository. +Persistent resources and image entities are still queried as via the node property getter and to resolve the thumbnail. + + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Allow unsetting thumbnail presets `_ +------------------------------------------------------------------------------------------------------------ + +* Resolves: `#3544 `_ + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Don’t query for abstract nodetypes in nodedata repository `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +As abstract nodetypes don't (shouldn't) appear in the database it makes no sense to query them. + +This is a regression that was introduced a long time ago, when the default parameter to include abstract nodetypes was added to the ``getSubNodeTypes`` method in the ``NodeTypeManager`` without adjusting the call in the ``NodeDataRepository->getNodeTypeFilterConstraintsForDql`` which relied on the previous behaviour. + +The call in the method ``getNodeTypeFilterConstraints`` was fixed some years ago, but that method seems unused. + +* Packages: ``ContentRepository`` + +`BUGFIX: Consistently initialize asset sources via `createFromConfiguration` `_ +---------------------------------------------------------------------------------------------------------------------------------------------- + +fixes: `#3965 `_ + +**The Problem** + +The case at hand was an asset source that uses a value object to validate the incoming asset source options. I expected to be able to define a promoted constructor property with said value object as its declared type: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + public function __construct( + private readonly string $assetSourceIdentifier, + private readonly Options $options + ) { + } + + /* ... */ +} +``` + +...and initialize the value object in the ``createFromConfiguration`` static factory method defined by the ``AssetSourceInterface``: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + /* ... */ + + public static function createFromConfiguration(string $assetSourceIdentifier, array $assetSourceOptions): AssetSourceInterface + { + return new static( + $assetSourceIdentifier, + Options::fromArray($assetSourceOptions) + ); + } +} +``` + +This failed with a Type Error, because the ``AssetSourceService``, which is responsible for initializing asset sources, at one point does not utilize ``createFromConfiguration`` to perform initialization, but calls the asset source constructor directly: + +https://github.com/neos/neos-development-collection/blob/`a4791b623161259b31d2d11b343310bd7ef76507 `_/Neos.Media/Classes/Domain/Service/AssetSourceService.php#L178 + +**The Solution** + +I adjusted the aforementioned routine of the ``AssetSourceService`` to use the ``AssetSourceInterface``-defined ``createFromConfiguration`` static factory method instead of the asset source's constructor. + +Even though the pattern I described above only makes sense in a PHP >8.0 environment, I decided to target Neos 7.3 with this PR, because it should constitute a non-breaking bugfix. + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Guard that Fusion path cannot be empty `_ +----------------------------------------------------------------------------------------------------------------- + +Previously in php 7.4 this ``Neos\\Fusion\\Exception\\MissingFusionObjectException`` was thrown + +> No Fusion object found in path "" + +but with php 8 this ``ValueError`` is thrown which is unexpected + +> strrpos(): Argument `#3 ``_($offset) must be contained in argument ``#1 `_($haystack) + +This change takes care of throwing an explicit ``Neos\\Fusion\\Exception`` instead: + +> Fusion path cannot be empty. + + +-------- + +This error was noticed in the out of band rendering, when there is no content element wrapping: https://discuss.neos.io/t/argument-3-offset-must-be-contained-in-argument-1-haystack/6416/4 + +image + + + +**Upgrade instructions** + + +* Packages: ``Neos`` ``Fusion`` + +`BUGFIX: Fix `NodeType` `getTypeOfAutoCreatedChildNode` and `getPropertyType` `_ +----------------------------------------------------------------------------------------------------------------------------------------------- + +resolves partially `#4333 `_ +resolves partially `#4344 `_ + +**Upgrade instructions** + + +* Packages: ``Neos`` ``ContentRepository`` + +`TASK: Fix documentation builds `_ +------------------------------------------------------------------------------------------------- + +… by pinning updated dependencies. + +**Review instructions** + +Best is to see if the builds succeed on RTD again with this merged… + + +* Packages: ``Neos`` ``Media`` + +`TASK: Fix paths for Neos.Media RTD rendering setup `_ +--------------------------------------------------------------------------------------------------------------------- + +The paths need to be from the repo root, not relative to the ``.readthedocs.yaml`` file (it seems). + + +* Packages: ``Neos`` ``Media`` + +`TASK: Add configuration files for RTD `_ +-------------------------------------------------------------------------------------------------------- + +This add ``.readthedocs.yaml`` files for the collection (handling ``Neos.Neos``) and for ``neos.Media``, to solve failing documentation rendering. + +**Review instructions** + +This can be compared to the configuration we have in place for ``Neos.Flow`` in the Flow development collection. + + +* Packages: ``Media`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From fe7b14c0fb106a0a8f729c4022406a40e28aa78d Mon Sep 17 00:00:00 2001 From: Jenkins Date: Sat, 21 Oct 2023 10:20:16 +0000 Subject: [PATCH 036/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index c0596712596..ee73a6130ea 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-14 +The following reference was automatically generated from code on 2023-10-21 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index a9d41352199..ccb1506f3cc 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 447b2789610..582e91c9267 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 5d8d337ab11..66dd6924281 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 574b2383f18..359257c7ed2 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 07d83856e7c..350cb44df2c 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 48587653f98..937847a87a7 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 683898f185f..e4c5c45cf0f 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 30d84bea30f..9e9407aff36 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 6d51a82d932..7f7479f57ad 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 54a805fba69..b073d7b8500 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 2bba73fe9cd..6f6aaf4574e 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index f03a66dd3b4..032e57f64b7 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 7e70388c7b9..d578688b50b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 162af432765..d25b770036d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index 5d2129451e5..c5191e870e1 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 36ca8d3ae18..6a3a594c574 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-14 +This reference was automatically generated from code on 2023-10-21 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 628920af8c7a436c26a026d78d96d398624ff2c5 Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Sat, 21 Oct 2023 11:15:11 +0000 Subject: [PATCH 037/113] TASK: Add changelog for 8.3.6 [skip ci] --- .../Appendixes/ChangeLogs/836.rst | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 Neos.Neos/Documentation/Appendixes/ChangeLogs/836.rst diff --git a/Neos.Neos/Documentation/Appendixes/ChangeLogs/836.rst b/Neos.Neos/Documentation/Appendixes/ChangeLogs/836.rst new file mode 100644 index 00000000000..c8fadecc646 --- /dev/null +++ b/Neos.Neos/Documentation/Appendixes/ChangeLogs/836.rst @@ -0,0 +1,175 @@ +`8.3.6 (2023-10-21) `_ +============================================================================================== + +Overview of merged pull requests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`BUGFIX: Only discard nodes in same workspace `_ +--------------------------------------------------------------------------------------------------------------- + +* Resolves: `#4577 `_ + +* Packages: ``ContentRepository`` + +`BUGFIX: Load all thumbnails for an asset to skip further requests `_ +------------------------------------------------------------------------------------------------------------------------------------ + +For the usecase of images with responsive variants this change prevents additional database requests for each additional variant of an image. + +This can greatly reduce the number of queries on pages with many source tags or sources attributes for pictures and images. + +**Review instructions** + +As soon as an image is rendered in several sizes on a page the patch should skip additional db requests in the thumbnails repository. +Persistent resources and image entities are still queried as via the node property getter and to resolve the thumbnail. + + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Allow unsetting thumbnail presets `_ +------------------------------------------------------------------------------------------------------------ + +* Resolves: `#3544 `_ + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Don’t query for abstract nodetypes in nodedata repository `_ +-------------------------------------------------------------------------------------------------------------------------------------- + +As abstract nodetypes don't (shouldn't) appear in the database it makes no sense to query them. + +This is a regression that was introduced a long time ago, when the default parameter to include abstract nodetypes was added to the ``getSubNodeTypes`` method in the ``NodeTypeManager`` without adjusting the call in the ``NodeDataRepository->getNodeTypeFilterConstraintsForDql`` which relied on the previous behaviour. + +The call in the method ``getNodeTypeFilterConstraints`` was fixed some years ago, but that method seems unused. + +* Packages: ``ContentRepository`` + +`BUGFIX: Consistently initialize asset sources via `createFromConfiguration` `_ +---------------------------------------------------------------------------------------------------------------------------------------------- + +fixes: `#3965 `_ + +**The Problem** + +The case at hand was an asset source that uses a value object to validate the incoming asset source options. I expected to be able to define a promoted constructor property with said value object as its declared type: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + public function __construct( + private readonly string $assetSourceIdentifier, + private readonly Options $options + ) { + } + + /* ... */ +} +``` + +...and initialize the value object in the ``createFromConfiguration`` static factory method defined by the ``AssetSourceInterface``: + +```php +final class MyAssetSource implements AssetSourceInterface +{ + /* ... */ + + public static function createFromConfiguration(string $assetSourceIdentifier, array $assetSourceOptions): AssetSourceInterface + { + return new static( + $assetSourceIdentifier, + Options::fromArray($assetSourceOptions) + ); + } +} +``` + +This failed with a Type Error, because the ``AssetSourceService``, which is responsible for initializing asset sources, at one point does not utilize ``createFromConfiguration`` to perform initialization, but calls the asset source constructor directly: + +https://github.com/neos/neos-development-collection/blob/`a4791b623161259b31d2d11b343310bd7ef76507 `_/Neos.Media/Classes/Domain/Service/AssetSourceService.php#L178 + +**The Solution** + +I adjusted the aforementioned routine of the ``AssetSourceService`` to use the ``AssetSourceInterface``-defined ``createFromConfiguration`` static factory method instead of the asset source's constructor. + +Even though the pattern I described above only makes sense in a PHP >8.0 environment, I decided to target Neos 7.3 with this PR, because it should constitute a non-breaking bugfix. + +* Packages: ``Neos`` ``Media`` + +`BUGFIX: Guard that Fusion path cannot be empty `_ +----------------------------------------------------------------------------------------------------------------- + +Previously in php 7.4 this ``Neos\\Fusion\\Exception\\MissingFusionObjectException`` was thrown + +> No Fusion object found in path "" + +but with php 8 this ``ValueError`` is thrown which is unexpected + +> strrpos(): Argument `#3 ``_($offset) must be contained in argument ``#1 `_($haystack) + +This change takes care of throwing an explicit ``Neos\\Fusion\\Exception`` instead: + +> Fusion path cannot be empty. + + +-------- + +This error was noticed in the out of band rendering, when there is no content element wrapping: https://discuss.neos.io/t/argument-3-offset-must-be-contained-in-argument-1-haystack/6416/4 + +image + + + +**Upgrade instructions** + +**Review instructions** + + +* Packages: ``Neos`` ``Fusion`` + +`BUGFIX: Fix `NodeType` `getTypeOfAutoCreatedChildNode` and `getPropertyType` `_ +----------------------------------------------------------------------------------------------------------------------------------------------- + +resolves partially `#4333 `_ +resolves partially `#4344 `_ + +**Upgrade instructions** + +**Review instructions** + + +* Packages: ``Neos`` ``ContentRepository`` + +`TASK: Fix documentation builds `_ +------------------------------------------------------------------------------------------------- + +… by pinning updated dependencies. + +**Review instructions** + +Best is to see if the builds succeed on RTD again with this merged… + + +* Packages: ``Neos`` ``Media`` + +`TASK: Fix paths for Neos.Media RTD rendering setup `_ +--------------------------------------------------------------------------------------------------------------------- + +The paths need to be from the repo root, not relative to the ``.readthedocs.yaml`` file (it seems). + + +* Packages: ``Neos`` ``Media`` + +`TASK: Add configuration files for RTD `_ +-------------------------------------------------------------------------------------------------------- + +This add ``.readthedocs.yaml`` files for the collection (handling ``Neos.Neos``) and for ``neos.Media``, to solve failing documentation rendering. + +**Review instructions** + +This can be compared to the configuration we have in place for ``Neos.Flow`` in the Flow development collection. + + +* Packages: ``Media`` + +`Detailed log `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From f0d9b6f0b48c8a73dbb35355304d22e53b9ba9ba Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 23 Oct 2023 15:46:05 +0200 Subject: [PATCH 038/113] TASK: Unset postprocessors for abstract nodetypes too --- Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php b/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php index 43c51b5495d..46a76f65d14 100644 --- a/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php +++ b/Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php @@ -75,15 +75,16 @@ public function generateNodeTypeSchema() } foreach ($nodeTypes as $nodeTypeName => $nodeType) { + // Skip abstract nodetypes which might have been added by the Neos.UI `nodeTypeRoles` configuration if ($nodeType->isAbstract() === false) { $configuration = $nodeType->getFullConfiguration(); $schema['nodeTypes'][$nodeTypeName] = $configuration; $schema['nodeTypes'][$nodeTypeName]['label'] = $nodeType->getLabel(); - - // Remove the postprocessors, as they are not needed in the UI - unset($schema['nodeTypes'][$nodeTypeName]['postprocessors']); } + // Remove the postprocessors, as they are not needed in the UI + unset($schema['nodeTypes'][$nodeTypeName]['postprocessors']); + $subTypes = []; foreach ($this->nodeTypeManager->getSubNodeTypes($nodeType->getName(), false) as $subNodeType) { $subTypes[] = $subNodeType->getName(); From e1648a1f149a96e08183497af0759d02e2488aaa Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Mon, 23 Oct 2023 17:05:05 +0200 Subject: [PATCH 039/113] initial version --- .../Features/Bootstrap/FeatureContext.php | 4 + .../Features/Bootstrap/FusionTrait.php | 134 +++++++++ .../Behavior/Features/Fusion/Menu.feature | 283 ++++++++++++++++++ 3 files changed, 421 insertions(+) create mode 100644 Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php index 511700328a6..d1f1083ba5b 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php @@ -34,6 +34,7 @@ use Neos\Neos\Domain\Service\SiteService; use Neos\Neos\Domain\Service\UserService; use Neos\Neos\Service\PublishingService; +use Neos\Neos\Tests\Behavior\Features\Bootstrap\FusionTrait; use Neos\Neos\Tests\Functional\Command\BehatTestHelper; use Neos\Party\Domain\Repository\PartyRepository; use Neos\Utility\Arrays; @@ -47,6 +48,7 @@ require_once(__DIR__ . '/../../../../../Neos.ContentRepository/Tests/Behavior/Features/Bootstrap/NodeOperationsTrait.php'); require_once(__DIR__ . '/../../../../../Neos.ContentRepository/Tests/Behavior/Features/Bootstrap/NodeAuthorizationTrait.php'); require_once(__DIR__ . '/HistoryDefinitionsTrait.php'); +require_once(__DIR__ . '/FusionTrait.php'); /** * Features context @@ -59,6 +61,7 @@ class FeatureContext extends MinkContext use SecurityOperationsTrait; use IsolatedBehatStepsTrait; use HistoryDefinitionsTrait; + use FusionTrait; /** * @var string @@ -472,6 +475,7 @@ public function iHaveTheSite($siteName) { $site = new Site($siteName); $site->setSiteResourcesPackageKey('Neos.Demo'); + $site->setState(Site::STATE_ONLINE); /** @var SiteRepository $siteRepository */ $siteRepository = $this->objectManager->get(SiteRepository::class); $siteRepository->add($site); diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php new file mode 100644 index 00000000000..2bb32f1e706 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -0,0 +1,134 @@ +fusionRequest = null; + $this->fusionContext = []; + $this->renderingResult = null; + } + + /** + * @When the Fusion context node is :nodeIdentifier + */ + public function theFusionContextNodeIs(string $nodeIdentifier): void + { + /** @var ContentContext $context */ + $context = $this->getContextForProperties([]); + $this->fusionContext['node'] = $context->getNodeByIdentifier($nodeIdentifier); + if ($this->fusionContext['node'] === null) { + throw new \InvalidArgumentException(sprintf('Node with identifier "%s" could not be found in the "%s" workspace', $nodeIdentifier, $context->getWorkspaceName()), 1696700222); + } + $flowQuery = new FlowQuery([$this->fusionContext['node']]); + $this->fusionContext['documentNode'] = $flowQuery->closest('[instanceof Neos.Neos:Document]')->get(0); + if ($this->fusionContext['documentNode'] === null) { + throw new \RuntimeException(sprintf('Failed to find closest document node for node with identifier "%s"', $nodeIdentifier), 1697790940); + } + $this->fusionContext['site'] = $context->getCurrentSiteNode(); + if ($this->fusionContext['site'] === null) { + throw new \RuntimeException(sprintf('Failed to resolve site node for node with identifier "%s"', $nodeIdentifier), 1697790963); + } + } + + /** + * @When the Fusion context request URI is :requestUri + */ + public function theFusionContextRequestIs(string $requestUri = null): void + { + $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', $requestUri); + $httpRequest = $this->addRoutingParameters($httpRequest); + + $this->fusionRequest = ActionRequest::fromHttpRequest($httpRequest); + } + + private function addRoutingParameters(ServerRequestInterface $httpRequest): ServerRequestInterface + { + $spyMiddleware = new SpyRequestHandler(); + (new RequestUriHostMiddleware())->process($httpRequest, $spyMiddleware); + return $spyMiddleware->getHandledRequest(); + } + + + /** + * @When I execute the following Fusion code: + * @When I execute the following Fusion code on path :path: + */ + public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string $path = 'test'): void + { + if ($this->fusionRequest === null) { + $this->theFusionContextRequestIs('http://localhost'); + } + $fusionAst = (new Parser())->parseFromSource(FusionSourceCodeCollection::fromString($fusionCode->getRaw())); + $uriBuilder = new UriBuilder(); + $uriBuilder->setRequest($this->fusionRequest); + $controllerContext = new ControllerContext($this->fusionRequest, new ActionResponse(), new Arguments(), $uriBuilder); + + $fusionRuntime = (new RuntimeFactory())->createFromConfiguration($fusionAst, $controllerContext); + $fusionRuntime->pushContextArray($this->fusionContext); + $this->renderingResult = $fusionRuntime->render($path); + $fusionRuntime->popContext(); + } + + /** + * @Then I expect the following Fusion rendering result: + */ + public function iExpectTheFollowingFusionRenderingResult(PyStringNode $expectedResult): void + { + Assert::assertSame($expectedResult->getRaw(), $this->renderingResult); + } + + /** + * @Then I expect the following Fusion rendering result as HTML: + */ + public function iExpectTheFollowingFusionRenderingResultAsHtml(PyStringNode $expectedResult): void + { + Assert::assertXmlStringEqualsXmlString($expectedResult->getRaw(), $this->renderingResult); + } + +} diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature new file mode 100644 index 00000000000..3da578d58c5 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -0,0 +1,283 @@ +@fixtures +Feature: + + Background: + Given I have the site "a" + And I have the following NodeTypes configuration: + """yaml + 'unstructured': {} + 'Neos.Neos:FallbackNode': {} + 'Neos.Neos:Document': + properties: + title: + type: string + uriPathSegment: + type: string + 'Neos.Neos:Content': + properties: + title: + type: string + 'Neos.Neos:Test.DocumentType1': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType2': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType2a': + superTypes: + 'Neos.Neos:Test.DocumentType2': true + 'Neos.Neos:Test.Content': + superTypes: + 'Neos.Neos:Content': true + """ + And I have the following nodes: + | Identifier | Path | Node Type | Properties | + | root | /sites | unstructured | | + | a | /sites/a | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a", "title": "Node a"} | + | a1 | /sites/a/a1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1", "title": "Node a1"} | + | a1a | /sites/a/a1/a1a | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1a", "title": "Node a1a"} | + | a1b | /sites/a/a1/a1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b", "title": "Node a1b"} | + | a1b1 | /sites/a/a1/a1b/a1b1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1", "title": "Node a1b1"} | + | a1b1a | /sites/a/a1/a1b/a1b1/a1b1a | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1b1a", "title": "Node a1b1a"} | + | a1b1b | /sites/a/a1/a1b/a1b1/a1b1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1b", "title": "Node a1b1b"} | + | a1b2 | /sites/a/a1/a1b/a1b2 | Neos.Neos:Test.DocumentType2 | {"uriPathSegment": "a1b2", "title": "Node a1b2"} | + | a1b3 | /sites/a/a1/a1b/a1b3 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b3", "title": "Node a1b3"} | + And the Fusion context node is "a1a" + And the Fusion context request URI is "http://localhost" + + Scenario: MenuItems + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + prototype(Neos.Neos:Test.Menu.ItemStateIndicator) < prototype(Neos.Fusion:Component) { + state = null + renderer = Neos.Fusion:Match { + @subject = ${props.state} + @default = '?' + normal = '' + current = '*' + active = '.' + absent = 'x' + } + } + + prototype(Neos.Neos:Test.Menu) < prototype(Neos.Fusion:Component) { + items = ${[]} + renderer = Neos.Fusion:Loop { + items = ${props.items} + itemRenderer = afx` + {item.node.identifier} ({item.menuLevel}){String.chr(10)} + + ` + } + } + + test = Neos.Fusion:DataStructure { + default = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems + } + maximumLevels_3 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + maximumLevels = 3 + } + } + entryLevel_negative = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = -1 + } + } + entryLevel_negative_out_of_range = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = -5 + } + } + entryLevel_0 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 0 + } + } + entryLevel_2 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 2 + } + } + entryLevel_positive_out_of_range = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 5 + } + } + lastLevel_negative = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = -1 + } + } + lastLevel_negative_out_of_range = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = -5 + } + } + lastLevel_0 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = 0 + } + } + lastLevel_1 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = 1 + } + } + filter_nonExisting = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Non.Existing:NodeType' + } + } + filter_DocumentType1 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Neos.Neos:Test.DocumentType1' + } + } + filter_DocumentType2 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Neos.Neos:Test.DocumentType2' + } + } + + startingPoint_a1b1 = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + } + } + startingPoint_a1b1_entryLevel_negative = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + entryLevel = -1 + } + } + startingPoint_a1b1_lastLevel_negative = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + lastLevel = -1 + } + } + startingPoint_a1b_filter_DocumentType2a = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').get(0)} + filter = 'Neos.Neos:Test.DocumentType2a' + } + } + } + test.@process.join = ${Array.join(Array.map(Array.keys(value), k => k + ':' + String.chr(10) + String.trim(value[k])), String.chr(10) + String.chr(10))} + """ + Then I expect the following Fusion rendering result: + """ + default: + a1. (1) + a1a* (2) + a1b (2) + + maximumLevels_3: + a1. (1) + a1a* (2) + a1b (2) + a1b1 (3) + a1b2 (3) + a1b3 (3) + + entryLevel_negative: + a1a* (1) + a1b (1) + a1b1 (2) + a1b2 (2) + a1b3 (2) + + entryLevel_negative_out_of_range: + a1. (1) + a1a* (2) + a1b (2) + + entryLevel_0: + + + entryLevel_2: + a1a* (1) + a1b (1) + a1b1 (2) + a1b2 (2) + a1b3 (2) + + entryLevel_positive_out_of_range: + + + lastLevel_negative: + a1. (1) + a1a* (2) + a1b (2) + + lastLevel_negative_out_of_range: + a1. (1) + + lastLevel_0: + a1. (1) + a1a* (2) + a1b (2) + + lastLevel_1: + a1. (1) + + filter_nonExisting: + + + filter_DocumentType1: + a1. (1) + a1b (2) + + filter_DocumentType2: + + + startingPoint_a1b1: + a1. (1) + a1a* (2) + a1b (2) + + startingPoint_a1b1_entryLevel_negative: + a1a* (1) + a1b (1) + a1b1 (2) + a1b2 (2) + a1b3 (2) + + startingPoint_a1b1_lastLevel_negative: + a1. (1) + a1a* (2) + a1b (2) + + startingPoint_a1b_filter_DocumentType2a: + + """ + + Scenario: Menu + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:Menu + """ + Then I expect the following Fusion rendering result as HTML: + """html + + """ From 735b7b31c703a5c49d8c3f573933e2a5d1a56073 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:53:26 +0200 Subject: [PATCH 040/113] TASK: Remove some `@phpstan-ignore-next-line` from Neos.Neos --- .../Module/Management/WorkspacesController.php | 12 +----------- Neos.Neos/Classes/Security/ImpersonateAspect.php | 6 ++---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php index cc3942cdf54..26d7046e851 100644 --- a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php +++ b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php @@ -577,17 +577,7 @@ public function discardNodeAction(string $nodeAddress, WorkspaceName $selectedWo } /** - * Publishes or discards the given nodes - * - * @param array $nodes - * @throws \Exception - * @throws \Neos\Flow\Property\Exception - * @throws \Neos\Flow\Security\Exception - */ - /** @phpstan-ignore-next-line - * @param array $nodes - * @param string $action - * @param string $selectedWorkspace + * @psalm-param list $nodes * @throws IndexOutOfBoundsException * @throws InvalidFormatPlaceholderException * @throws StopActionException diff --git a/Neos.Neos/Classes/Security/ImpersonateAspect.php b/Neos.Neos/Classes/Security/ImpersonateAspect.php index a38b05ff820..78c481acb99 100644 --- a/Neos.Neos/Classes/Security/ImpersonateAspect.php +++ b/Neos.Neos/Classes/Security/ImpersonateAspect.php @@ -34,10 +34,9 @@ class ImpersonateAspect protected bool $alreadyLoggedAuthenticateCall = false; /** - * @var ImpersonateService * @Flow\Inject */ - protected $impersonateService; + protected ImpersonateService $impersonateService; /** * @Flow\After("within(Neos\Flow\Security\Authentication\AuthenticationManagerInterface) && method(.*->authenticate())") @@ -61,8 +60,7 @@ public function logManagerAuthenticate(JoinPointInterface $joinPoint): void return; } - /** @phpstan-ignore-next-line might still be null in strange Flow DI cases */ - if ($this->impersonateService && $this->impersonateService->isActive()) { + if ($this->impersonateService->isActive()) { $impersonation = $this->impersonateService->getImpersonation(); foreach ($proxy->getSecurityContext()->getAuthenticationTokens() as $token) { $token->setAccount($impersonation); From 329330e02b6b3aec50c1c3e041306f67ce59809d Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 25 Oct 2023 10:03:36 +0200 Subject: [PATCH 041/113] TASK: Use correct `@template-covariant` tag for `ProjectionInterface` See https://phpstan.org/blog/whats-up-with-template-covariant --- .../src/DoctrineDbalContentGraphProjectionFactory.php | 1 - .../Classes/Projection/ProjectionInterface.php | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php index 51373f5d428..a264b39f8d7 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php @@ -41,7 +41,6 @@ public function build( ); return new ContentGraphProjection( - // @phpstan-ignore-next-line new DoctrineDbalContentGraphProjection( $this->dbalClient, new NodeFactory( diff --git a/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php index 61f96e5fee3..249683514cf 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php @@ -4,14 +4,10 @@ namespace Neos\ContentRepository\Core\Projection; -use Neos\ContentRepository\Core\CommandHandler\PendingProjections; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\EventStore\CatchUp\CheckpointStorageInterface; use Neos\EventStore\Model\EventEnvelope; -use Neos\EventStore\Model\EventStream\EventStreamInterface; -use Neos\EventStore\Model\Event\SequenceNumber; -use Neos\EventStore\Model\Event; /** * Common interface for a Content Repository projection. This API is NOT exposed to the outside world, but is @@ -20,7 +16,7 @@ * If the Projection needs to be notified that a catchup is about to happen, you can additionally * implement {@see WithMarkStaleInterface}. This is useful f.e. to disable runtime caches in the ProjectionState. * - * @template TState of ProjectionStateInterface + * @template-covariant TState of ProjectionStateInterface * @api you can write custom projections */ interface ProjectionInterface From 49da2daa8f0cbcb847f4f52be39ea38bd45d44a7 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Wed, 25 Oct 2023 12:18:40 +0200 Subject: [PATCH 042/113] =?UTF-8?q?TASK:=20Adjust=20tests=20now=20that=20t?= =?UTF-8?q?he=20schema=20doesn=E2=80=99t=20contain=20every=20abstract=20no?= =?UTF-8?q?detype=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Functional/Service/NodeTypeSchemaBuilderTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Neos.Neos/Tests/Functional/Service/NodeTypeSchemaBuilderTest.php b/Neos.Neos/Tests/Functional/Service/NodeTypeSchemaBuilderTest.php index e2f6ad07c1d..87ebb3cb455 100644 --- a/Neos.Neos/Tests/Functional/Service/NodeTypeSchemaBuilderTest.php +++ b/Neos.Neos/Tests/Functional/Service/NodeTypeSchemaBuilderTest.php @@ -80,11 +80,11 @@ public function theNodeTypeSchemaIncludesSubTypesInheritanceMap() { $subTypesDefinition = $this->schema['inheritanceMap']['subTypes']; - self::assertContains('Neos.Neos.BackendSchemaControllerTest:Document', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Node']); - self::assertContains('Neos.Neos.BackendSchemaControllerTest:Content', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Node']); - self::assertContains('Neos.Neos.BackendSchemaControllerTest:Page', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Node']); - self::assertContains('Neos.Neos.BackendSchemaControllerTest:SubPage', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Node']); - self::assertContains('Neos.Neos.BackendSchemaControllerTest:Text', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Node']); + self::assertContains('Neos.Neos.BackendSchemaControllerTest:Page', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Document']); + self::assertContains('Neos.Neos.BackendSchemaControllerTest:Folder', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Document']); + self::assertContains('Neos.Neos.BackendSchemaControllerTest:SubPage', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Page']); + self::assertContains('Neos.Neos.BackendSchemaControllerTest:Text', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Content']); + self::assertContains('Neos.Neos.BackendSchemaControllerTest:TwoColumn', $subTypesDefinition['Neos.Neos.BackendSchemaControllerTest:Content']); } /** From d738b9041ffc9777220e47a069c939b74a82778e Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 25 Oct 2023 15:45:02 +0200 Subject: [PATCH 043/113] TASK: Remove legacy `unstructured` node type --- Neos.Neos/NodeTypes/Unstructured.yaml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 Neos.Neos/NodeTypes/Unstructured.yaml diff --git a/Neos.Neos/NodeTypes/Unstructured.yaml b/Neos.Neos/NodeTypes/Unstructured.yaml deleted file mode 100644 index 91b17e7d48e..00000000000 --- a/Neos.Neos/NodeTypes/Unstructured.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# legacy type for nodes without type -'unstructured': - constraints: - nodeTypes: - '*': true From 884956855ddedf0e9806f272ac05970c6bf9161b Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:08:22 +0200 Subject: [PATCH 044/113] TASK: Make `InterDimensionalVariationGraph` final --- .../InterDimensionalVariationGraph.php | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php index d300435da44..52725f6ec9e 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php @@ -21,50 +21,50 @@ * Represents the specialization and generalization mechanism between dimension space points * @api */ -class InterDimensionalVariationGraph +final class InterDimensionalVariationGraph { /** * Weighed dimension space points, indexed by identity (DSP) hash * * @var array */ - protected array $weightedDimensionSpacePoints; + private array $weightedDimensionSpacePoints; /** * Generalization dimension space point sets, indexed by specialization hash * * @var array */ - protected array $indexedGeneralizations; + private array $indexedGeneralizations; /** * Specialization dimension space point sets, indexed by generalization hash * * @var array */ - protected array $indexedSpecializations; + private array $indexedSpecializations; /** * Weighed generalizations, indexed by specialization hash and relative weight * * @var array> */ - protected array $weightedGeneralizations; + private array $weightedGeneralizations; /** * Weighed specializations, indexed by generalization hash, relative weight and specialization hash * @var array>> */ - protected array $weightedSpecializations; + private array $weightedSpecializations; /** * Primary generalization dimension space points, indexed by specialization hash * * @var array */ - protected array $primaryGeneralizations; + private array $primaryGeneralizations; - protected int $weightNormalizationBase; + private int $weightNormalizationBase; public function __construct( private readonly Dimension\ContentDimensionSourceInterface $contentDimensionSource, @@ -72,7 +72,7 @@ public function __construct( ) { } - protected function initializeWeightedDimensionSpacePoints(): void + private function initializeWeightedDimensionSpacePoints(): void { $this->weightedDimensionSpacePoints = []; foreach ($this->contentDimensionZookeeper->getAllowedCombinations() as $dimensionValues) { @@ -96,9 +96,7 @@ public function getWeightedDimensionSpacePoints(): array if (!isset($this->weightedDimensionSpacePoints)) { $this->initializeWeightedDimensionSpacePoints(); } - $weighedDimensionSpacePoints = $this->weightedDimensionSpacePoints; - - return $weighedDimensionSpacePoints; + return $this->weightedDimensionSpacePoints; } public function getWeightedDimensionSpacePointByDimensionSpacePoint( @@ -133,7 +131,7 @@ public function getRootGeneralizations(): array return $rootGeneralizations; } - protected function determineWeightNormalizationBase(): int + private function determineWeightNormalizationBase(): int { if (!isset($this->weightNormalizationBase)) { $base = 0; @@ -147,7 +145,7 @@ protected function determineWeightNormalizationBase(): int return $this->weightNormalizationBase; } - protected function initializeVariations(): void + private function initializeVariations(): void { $normalizedVariationWeights = []; $lowestVariationWeights = []; @@ -226,7 +224,7 @@ protected function initializeVariations(): void * @param-out array> $indexedGeneralizations * @param-out array> $indexedSpecializations */ - protected function initializeVariationsForDimensionSpacePointPair( + private function initializeVariationsForDimensionSpacePointPair( WeightedDimensionSpacePoint $specialization, WeightedDimensionSpacePoint $generalization, array $normalizedVariationWeights, @@ -237,9 +235,9 @@ protected function initializeVariationsForDimensionSpacePointPair( if (isset($indexedGeneralizations[$generalization->getIdentityHash()])) { $generalizations = $indexedGeneralizations[$generalization->getIdentityHash()]; foreach ($generalizations as $parentGeneralizationHash => $parentGeneralization) { - $weighedParent = $this->getWeightedDimensionSpacePointByHash($parentGeneralizationHash); - assert($weighedParent !== null); - $generalizationsToProcess[$parentGeneralizationHash] = $weighedParent; + $weightedParent = $this->getWeightedDimensionSpacePointByHash($parentGeneralizationHash); + assert($weightedParent !== null); + $generalizationsToProcess[$parentGeneralizationHash] = $weightedParent; } } From dc4e77b789ee1ee788fc2105aa4daf16f7e272f4 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Wed, 25 Oct 2023 14:49:13 +0000 Subject: [PATCH 045/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 949fe3fcb78..99d24ba759e 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-21 +The following reference was automatically generated from code on 2023-10-25 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 2a36c870d79..09b1c1ffca3 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 582e91c9267..acdd26f71cf 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 66dd6924281..8af3eda3275 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 359257c7ed2..b4d9bdf8585 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 350cb44df2c..2eb5a9499c7 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 937847a87a7..94135d27f2d 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index fe603202ce7..611d5f555fb 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 9e9407aff36..4063fc97fba 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 7f7479f57ad..caf315703c0 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index b073d7b8500..01e5748c355 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 6f6aaf4574e..3f4527cd249 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 032e57f64b7..b2c9a72e608 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index d578688b50b..1416e17f2b3 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index d25b770036d..e061e4a9d27 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index c5191e870e1..0a54dfe46a0 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 6a3a594c574..554eb74ea77 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-25 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 0737aa03db2de7c2037abf922da55ff0437f7760 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:50:54 +0200 Subject: [PATCH 046/113] TASK: Command constructor adjustments for #4489 --- .../Command/SetNodeReferences.php | 2 +- .../Command/RemoveNodeAggregate.php | 36 ++++++++++--------- .../PublishIndividualNodesFromWorkspace.php | 36 +++++++++---------- .../Bootstrap/Features/NodeReferencing.php | 2 +- 4 files changed, 40 insertions(+), 36 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php index d0ea7f49e90..ce969843ef1 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php @@ -25,7 +25,7 @@ final class SetNodeReferences implements CommandInterface * @param ReferenceName $referenceName Name of the reference to set * @param NodeReferencesToWrite $references Unserialized reference(s) to set */ - public function __construct( + private function __construct( public readonly ContentStreamId $contentStreamId, public readonly NodeAggregateId $sourceNodeAggregateId, public readonly OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php index 060135a4f4e..6c3836dc81c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php @@ -33,31 +33,27 @@ final class RemoveNodeAggregate implements MatchableWithNodeIdToPublishOrDiscardInterface { /** - * @param ContentStreamId $contentStreamId + * @param ContentStreamId $contentStreamId The content stream in which the remove operation is to be performed + * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove + * @param DimensionSpacePoint $coveredDimensionSpacePoint One of the dimension space points covered by the node aggregate in which the user intends to remove it + * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be removed + * @param NodeAggregateId|null $removalAttachmentPoint Internal. It stores the document node id of the removed node, as that is what the UI needs later on for the change display. {@see self::withRemovalAttachmentPoint()} */ - public function __construct( + private function __construct( public readonly ContentStreamId $contentStreamId, public readonly NodeAggregateId $nodeAggregateId, - /** One of the dimension space points covered by the node aggregate in which the user intends to remove it */ public readonly DimensionSpacePoint $coveredDimensionSpacePoint, public readonly NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, - /** - * This is usually the NodeAggregateId of the parent node of the deleted node. It is needed for instance - * in the Neos UI for the following scenario: - * - when removing a node, you still need to be able to publish the removal. - * - For this to work, the Neos UI needs to know the id of the removed Node, **on the page - * where the removal happened** (so that the user can decide to publish a single page INCLUDING the removal - * on the page) - * - Because this command will *remove* the edge, - * we cannot know the position in the tree after doing the removal anymore. - * - * That's why we need this field: For the Neos UI, it stores the document node of the removed node - * (see Remove.php), as that is what the UI needs lateron for the change display. - */ public readonly ?NodeAggregateId $removalAttachmentPoint ) { } + /** + * @param ContentStreamId $contentStreamId The content stream in which the remove operation is to be performed + * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove + * @param DimensionSpacePoint $coveredDimensionSpacePoint One of the dimension space points covered by the node aggregate in which the user intends to remove it + * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be removed + */ public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self { return new self($contentStreamId, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy, null); @@ -80,6 +76,14 @@ public static function fromArray(array $array): self } /** + * This adds usually the NodeAggregateId of the parent document node of the deleted node. + * It is needed for instance in the Neos UI for the following scenario: + * - when removing a node, you still need to be able to publish the removal. + * - For this to work, the Neos UI needs to know the id of the removed Node, **on the page where the removal happened** + * (so that the user can decide to publish a single page INCLUDING the removal on the page) + * - Because this command will *remove* the edge, + * we cannot know the position in the tree after doing the removal anymore. + * * @param NodeAggregateId $removalAttachmentPoint * @internal */ diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php index 873d00e5925..5f4100b6e2f 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php @@ -29,29 +29,13 @@ final class PublishIndividualNodesFromWorkspace implements CommandInterface /** * @param WorkspaceName $workspaceName Name of the affected workspace * @param NodeIdsToPublishOrDiscard $nodesToPublish Ids of the nodes to publish or discard - * @param ContentStreamId $contentStreamIdForMatchingPart The id of the new content stream that will contain all events to be published - * @param ContentStreamId $contentStreamIdForRemainingPart The id of the new content stream that will contain all remaining events + * @param ContentStreamId $contentStreamIdForMatchingPart The id of the new content stream that will contain all events to be published {@see self::withContentStreamIdForMatchingPart()} + * @param ContentStreamId $contentStreamIdForRemainingPart The id of the new content stream that will contain all remaining events {@see self::withContentStreamIdForRemainingPart()} */ private function __construct( public readonly WorkspaceName $workspaceName, public readonly NodeIdsToPublishOrDiscard $nodesToPublish, - /** - * during the publish process, we sort the events so that the events we want to publish - * come first. In this process, two new content streams are generated: - * - the first one contains all events which we want to publish - * - the second one is based on the first one, and contains all the remaining events (which we want to keep - * in the user workspace). - * - * This property contains the ID of the first content stream, so that this command - * can run fully deterministic - we need this for the test cases. - */ public readonly ContentStreamId $contentStreamIdForMatchingPart, - /** - * See the description of {@see $contentStreamIdForMatchingPart}. - * - * This property contains the ID of the second content stream, so that this command - * can run fully deterministic - we need this for the test cases. - */ public readonly ContentStreamId $contentStreamIdForRemainingPart ) { } @@ -70,11 +54,27 @@ public static function create(WorkspaceName $workspaceName, NodeIdsToPublishOrDi ); } + /** + * During the publish process, we sort the events so that the events we want to publish + * come first. In this process, two new content streams are generated: + * - the first one contains all events which we want to publish + * - the second one is based on the first one, and contains all the remaining events (which we want to keep + * in the user workspace). + * + * This method adds the ID of the first content stream, so that the command + * can run fully deterministic - we need this for the test cases. + */ public function withContentStreamIdForMatchingPart(ContentStreamId $contentStreamIdForMatchingPart): self { return new self($this->workspaceName, $this->nodesToPublish, $contentStreamIdForMatchingPart, $this->contentStreamIdForRemainingPart); } + /** + * See the description of {@see self::withContentStreamIdForMatchingPart()}. + * + * This property adds the ID of the second content stream, so that the command + * can run fully deterministic - we need this for the test cases. + */ public function withContentStreamIdForRemainingPart(ContentStreamId $contentStreamIdForRemainingPart): self { return new self($this->workspaceName, $this->nodesToPublish, $this->contentStreamIdForMatchingPart, $contentStreamIdForRemainingPart); diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php index 3f9deb68f63..d43d4b26628 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php @@ -66,7 +66,7 @@ public function theCommandSetNodeReferencesIsExecutedWithPayload(TableNode $payl ) ); - $command = new SetNodeReferences( + $command = SetNodeReferences::create( $contentStreamId, NodeAggregateId::fromString($commandArguments['sourceNodeAggregateId']), $sourceOriginDimensionSpacePoint, From 50e8ff69eaeb36d4b2bed42deb6a4d30b24ebccc Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:29:25 +0200 Subject: [PATCH 047/113] TASK: Remove `'unstructured': {}` NodeType declaration from behat tests --- .../Tests/Behavior/Features/Assets.feature | 1 - .../Tests/Behavior/Features/Basic.feature | 1 - .../Tests/Behavior/Features/Errors.feature | 1 - .../Tests/Behavior/Features/References.feature | 1 - .../Tests/Behavior/Features/Variants.feature | 1 - 5 files changed, 5 deletions(-) diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature index bc5cf9671ea..f4ca3e07455 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature @@ -7,7 +7,6 @@ Feature: Export of used Assets, Image Variants and Persistent Resources | language | en | en, de, ch | ch->de | And using the following node types: """yaml - 'unstructured': {} 'Neos.Neos:Site': {} 'Some.Package:Homepage': superTypes: diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature index 3623e2fe61a..a1dea4af085 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature @@ -5,7 +5,6 @@ Feature: Simple migrations without content dimensions Given using no content dimensions And using the following node types: """yaml - 'unstructured': {} 'Neos.Neos:Site': {} 'Some.Package:Homepage': superTypes: diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature index 4cf57e96a4c..33af167cd03 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature @@ -5,7 +5,6 @@ Feature: Exceptional cases during migrations Given using no content dimensions And using the following node types: """yaml - 'unstructured': {} 'Neos.Neos:Site': {} 'Some.Package:Homepage': superTypes: diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature index 7c67812eb50..52e659f6017 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature @@ -5,7 +5,6 @@ Feature: Migrations that contain nodes with "reference" or "references propertie Given using no content dimensions And using the following node types: """yaml - 'unstructured': {} 'Neos.Neos:Site': {} 'Some.Package:Homepage': superTypes: diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature index e6285a44323..a0e35e8fc92 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature @@ -7,7 +7,6 @@ Feature: Migrating nodes with content dimensions | language | en | en, de, ch | ch->de | And using the following node types: """yaml - 'unstructured': {} 'Neos.Neos:Site': {} 'Some.Package:Homepage': superTypes: From 13b6f2af0b33e4509bfa018c88225f24cce4af58 Mon Sep 17 00:00:00 2001 From: Manuel Meister Date: Thu, 26 Oct 2023 11:55:24 +0200 Subject: [PATCH 048/113] BUGFIX: Fix typos in deprecated Fusion object reference Fix broken references introduced in #4537 --- .../Documentation/References/NeosFusionReference.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Neos.Neos/Documentation/References/NeosFusionReference.rst b/Neos.Neos/Documentation/References/NeosFusionReference.rst index af991b249d7..bd125203351 100644 --- a/Neos.Neos/Documentation/References/NeosFusionReference.rst +++ b/Neos.Neos/Documentation/References/NeosFusionReference.rst @@ -1470,7 +1470,7 @@ Built a URI to a controller action :argumentsToBeExcludedFromQueryString: (array) Query parameters to exclude for ``addQueryString`` :absolute: (boolean) Whether to create an absolute URI -.. note:: The use of ``Neos.Fusion:UriBuilder`` is deprecated. Use :ref:`_Neos_Fusion__ActionUri` instead. +.. note:: The use of ``Neos.Fusion:UriBuilder`` is deprecated. Use :ref:`Neos_Fusion__ActionUri` instead. Example:: @@ -1486,15 +1486,15 @@ Removed Fusion Prototypes The following Fusion Prototypes have been removed: .. _Neos_Fusion__Array: -* `Neos.Fusion:Array` replaced with :ref:`_Neos_Fusion__Join` +* `Neos.Fusion:Array` replaced with :ref:`Neos_Fusion__Join` .. _Neos_Fusion__RawArray: -* `Neos.Fusion:RawArray` replaced with :ref:`_Neos_Fusion__DataStructure` +* `Neos.Fusion:RawArray` replaced with :ref:`Neos_Fusion__DataStructure` .. _Neos_Fusion__Collection: -* `Neos.Fusion:Collection` replaced with :ref:`_Neos_Fusion__Loop` +* `Neos.Fusion:Collection` replaced with :ref:`Neos_Fusion__Loop` .. _Neos_Fusion__RawCollection: -* `Neos.Fusion:RawCollection` replaced with :ref:`_Neos_Fusion__Map` +* `Neos.Fusion:RawCollection` replaced with :ref:`Neos_Fusion__Map` .. _Neos_Fusion__Attributes: -* `Neos.Fusion:Attributes` use property `attributes` in :ref:`_Neos_Fusion__Tag` +* `Neos.Fusion:Attributes` use property `attributes` in :ref:`Neos_Fusion__Tag` From 452c2e41d6e2571e5d0dcdf4bc9fdff1fa3fd6ae Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Thu, 26 Oct 2023 11:57:21 +0200 Subject: [PATCH 049/113] Cosmetic fix to `FusionTrait` to satisfy linter --- Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php index 2bb32f1e706..b2f21b6d9f2 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -36,7 +36,6 @@ */ trait FusionTrait { - use NodeOperationsTrait; private ?ActionRequest $fusionRequest = null; @@ -130,5 +129,4 @@ public function iExpectTheFollowingFusionRenderingResultAsHtml(PyStringNode $exp { Assert::assertXmlStringEqualsXmlString($expectedResult->getRaw(), $this->renderingResult); } - } From 567f6cfab19c2a80201e9532a20abf2429e214b9 Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Thu, 26 Oct 2023 11:57:41 +0200 Subject: [PATCH 050/113] chaos monkey to make tests fail --- Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index 3da578d58c5..7529ed82678 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -205,7 +205,7 @@ Feature: a1b (1) a1b1 (2) a1b2 (2) - a1b3 (2) + a1b3 (3) entryLevel_positive_out_of_range: From 55ff095bfc23f2703cd5c52ac56b4d4713cb93b1 Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Thu, 26 Oct 2023 11:58:09 +0200 Subject: [PATCH 051/113] kill chaos monkey (softly) --- Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index 7529ed82678..3da578d58c5 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -205,7 +205,7 @@ Feature: a1b (1) a1b1 (2) a1b2 (2) - a1b3 (3) + a1b3 (2) entryLevel_positive_out_of_range: From 058ec3286f1e3e6a4727e7901d019f34ae539521 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 26 Oct 2023 12:11:40 +0200 Subject: [PATCH 052/113] TASK: Document use case of `RebasableToOtherContentStreamsInterface::fromArray()` --- .../Classes/Feature/WorkspaceCommandHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php index d3bd1557328..7fc7d47f176 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php @@ -476,6 +476,10 @@ private function extractCommandsFromContentStreamMetadata( $commandToRebaseClass ), 1547815341); } + /** + * The "fromArray" might be declared via {@see RebasableToOtherContentStreamsInterface::fromArray()} + * or any other command can just implement it. + */ $commands[] = $commandToRebaseClass::fromArray($commandToRebasePayload); } } From 9fce857f72e3ba60bf45732e3afd1637743c0434 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 26 Oct 2023 13:47:35 +0200 Subject: [PATCH 053/113] TASK: Legacy Asset extractor, handle if "unstructured" nodetype is not available --- .../Classes/NodeDataToAssetsProcessor.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php index a1495d6174e..6f67d5ea3bf 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php @@ -36,15 +36,15 @@ public function run(): ProcessorResult $numberOfErrors = 0; foreach ($this->nodeDataRows as $nodeDataRow) { $nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']); - try { + if ($this->nodeTypeManager->hasNodeType($nodeTypeName)) { $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); - } catch (NodeTypeNotFoundException $exception) { - $numberOfErrors ++; - $this->dispatch(Severity::ERROR, '%s. Node: "%s"', $exception->getMessage(), $nodeDataRow['identifier']); - continue; + foreach ($nodeType->getProperties() as $nodeTypePropertyName => $nodeTypePropertyValue) { + $propertyTypes[$nodeTypePropertyName] = $nodeTypePropertyValue['type'] ?? null; + } + } else { + $this->dispatch(Severity::WARNING, 'The node type "%s" of node "%s" is not available. Falling back to "string" typed properties.', $nodeTypeName->value, $nodeDataRow['identifier']); + $propertyTypes = []; } - // HACK the following line is required in order to fully initialize the node type - $nodeType->getFullConfiguration(); try { $properties = json_decode($nodeDataRow['properties'], true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -53,7 +53,7 @@ public function run(): ProcessorResult continue; } foreach ($properties as $propertyName => $propertyValue) { - $propertyType = $nodeType->getPropertyType($propertyName); + $propertyType = $propertyTypes[$propertyName] ?? 'string'; // string is the fallback, in case the property is not defined or the node type does not exist. foreach ($this->extractAssetIdentifiers($propertyType, $propertyValue) as $assetId) { if (array_key_exists($assetId, $this->processedAssetIds)) { continue; From 208a896de33d8becdfedd4425ee03830286fd9d9 Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Thu, 26 Oct 2023 17:34:37 +0200 Subject: [PATCH 054/113] Improve feature classes and add more scenarios --- .../Bootstrap/NodeOperationsTrait.php | 14 +- .../Features/Bootstrap/FeatureContext.php | 24 ++- .../Features/Bootstrap/FusionTrait.php | 40 ++++- .../Features/Fusion/ContentCase.feature | 60 +++++++ .../Features/Fusion/ContentCollection.feature | 94 ++++++++++ .../Features/Fusion/ConvertUris.feature | 162 ++++++++++++++++++ .../Behavior/Features/Fusion/Menu.feature | 85 +++++++-- 7 files changed, 452 insertions(+), 27 deletions(-) create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature diff --git a/Neos.ContentRepository/Tests/Behavior/Features/Bootstrap/NodeOperationsTrait.php b/Neos.ContentRepository/Tests/Behavior/Features/Bootstrap/NodeOperationsTrait.php index 399e6301d35..cd7578f85a8 100755 --- a/Neos.ContentRepository/Tests/Behavior/Features/Bootstrap/NodeOperationsTrait.php +++ b/Neos.ContentRepository/Tests/Behavior/Features/Bootstrap/NodeOperationsTrait.php @@ -111,12 +111,6 @@ public function iHaveTheFollowingNodes($table) $identifier = null; } - if (isset($row['Hidden']) && $row['Hidden'] === 'true') { - $hidden = true; - } else { - $hidden = false; - } - $parentNode = $context->getNode($parentPath); if ($parentNode === null) { throw new \Exception(sprintf('Could not get parent node with path %s to create node %s', $parentPath, $path)); @@ -133,8 +127,12 @@ public function iHaveTheFollowingNodes($table) $node->setProperty($propertyName, $propertyValue); } } - - $node->setHidden($hidden); + if (isset($row['Hidden']) && $row['Hidden'] === 'true') { + $node->setHidden(true); + } + if (isset($row['Hidden in index']) && $row['Hidden in index'] === 'true') { + $node->setHiddenInIndex(true); + } } // Make sure we do not use cached instances diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php index d1f1083ba5b..962dca45862 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php @@ -23,10 +23,14 @@ use Neos\ContentRepository\Tests\Behavior\Features\Bootstrap\NodeAuthorizationTrait; use Neos\ContentRepository\Tests\Behavior\Features\Bootstrap\NodeOperationsTrait; use Neos\Flow\ObjectManagement\ObjectManagerInterface; +use Neos\Flow\ResourceManagement\ResourceManager; use Neos\Flow\Security\AccountRepository; use Neos\Flow\Tests\Behavior\Features\Bootstrap\IsolatedBehatStepsTrait; use Neos\Flow\Tests\Behavior\Features\Bootstrap\SecurityOperationsTrait; use Neos\Flow\Utility\Environment; +use Neos\Media\Domain\Model\Image; +use Neos\Media\Domain\Repository\AssetRepository; +use Neos\Media\Domain\Repository\ImageRepository; use Neos\Neos\Domain\Model\Site; use Neos\Neos\Domain\Repository\SiteRepository; use Neos\Neos\Domain\Service\SiteExportService; @@ -133,10 +137,6 @@ public function theFollowingUsersExist(TableNode $table) $rows = $table->getHash(); /** @var UserService $userService */ $userService = $this->objectManager->get(UserService::class); - /** @var PartyRepository $partyRepository */ - $partyRepository = $this->objectManager->get(PartyRepository::class); - /** @var AccountRepository $accountRepository */ - $accountRepository = $this->objectManager->get(AccountRepository::class); foreach ($rows as $row) { $roleIdentifiers = array_map(function ($role) { return 'Neos.Neos:' . $role; @@ -146,6 +146,22 @@ public function theFollowingUsersExist(TableNode $table) $this->persistAll(); } + /** + * @Given an asset exists with id :assetId + */ + public function anAssetExistsWithId(string $assetId): void + { + /** @var ResourceManager $resourceManager */ + $resourceManager = $this->objectManager->get(ResourceManager::class); + $resourceContent = 'neos_avatar_monochrome'; + $resource = $resourceManager->importResourceFromContent($resourceContent, 'test.svg'); + $asset = new Image($resource); + ObjectAccess::setProperty($asset, 'Persistence_Object_Identifier', $assetId, true); + + $this->objectManager->get(AssetRepository::class)->add($asset); + $this->persistAll(); + } + /** * @Given /^I am authenticated with "([^"]*)" and "([^"]*)" for the backend$/ */ diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php index b2f21b6d9f2..6358b8a5aab 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -16,11 +16,14 @@ use Behat\Gherkin\Node\PyStringNode; use Neos\ContentRepository\Tests\Behavior\Features\Bootstrap\NodeOperationsTrait; use Neos\Eel\FlowQuery\FlowQuery; +use Neos\Flow\Cli\CommandRequestHandler; +use Neos\Flow\Http\RequestHandler; use Neos\Flow\Mvc\ActionRequest; use Neos\Flow\Mvc\ActionResponse; use Neos\Flow\Mvc\Controller\Arguments; use Neos\Flow\Mvc\Controller\ControllerContext; use Neos\Flow\Mvc\Routing\UriBuilder; +use Neos\Flow\Tests\FunctionalTestRequestHandler; use Neos\Flow\Tests\Unit\Http\Fixtures\SpyRequestHandler; use Neos\Fusion\Core\FusionSourceCodeCollection; use Neos\Fusion\Core\Parser; @@ -43,6 +46,8 @@ trait FusionTrait private ?string $renderingResult = null; + private ?\Throwable $lastRenderingException = null; + /** * @BeforeScenario */ @@ -103,6 +108,11 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string if ($this->fusionRequest === null) { $this->theFusionContextRequestIs('http://localhost'); } + $requestHandler = new FunctionalTestRequestHandler(self::$bootstrap); + $requestHandler->setHttpRequest($this->fusionRequest->getHttpRequest()); + self::$bootstrap->setActiveRequestHandler($requestHandler); + $this->throwExceptionIfLastRenderingLedToAnError(); + $this->renderingResult = null; $fusionAst = (new Parser())->parseFromSource(FusionSourceCodeCollection::fromString($fusionCode->getRaw())); $uriBuilder = new UriBuilder(); $uriBuilder->setRequest($this->fusionRequest); @@ -110,7 +120,11 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string $fusionRuntime = (new RuntimeFactory())->createFromConfiguration($fusionAst, $controllerContext); $fusionRuntime->pushContextArray($this->fusionContext); - $this->renderingResult = $fusionRuntime->render($path); + try { + $this->renderingResult = $fusionRuntime->render($path); + } catch (\Throwable $exception) { + $this->lastRenderingException = $exception; + } $fusionRuntime->popContext(); } @@ -122,11 +136,33 @@ public function iExpectTheFollowingFusionRenderingResult(PyStringNode $expectedR Assert::assertSame($expectedResult->getRaw(), $this->renderingResult); } + /** + * @Then I expect the following Fusion rendering error: + */ + public function iExpectTheFollowingFusionRenderingError(PyStringNode $expectedError): void + { + Assert::assertNotNull($this->lastRenderingException, 'The previous rendering did not lead to an error'); + Assert::assertSame($expectedError->getRaw(), $this->lastRenderingException->getMessage()); + $this->lastRenderingException = null; + } + + /** * @Then I expect the following Fusion rendering result as HTML: */ public function iExpectTheFollowingFusionRenderingResultAsHtml(PyStringNode $expectedResult): void { - Assert::assertXmlStringEqualsXmlString($expectedResult->getRaw(), $this->renderingResult); + $stripWhitespace = static fn (string $input): string => preg_replace(['/>[^\S ]+/s', '/[^\S ]+ ', '<', '\\1', '><'], $input); + Assert::assertXmlStringEqualsXmlString($stripWhitespace($expectedResult->getRaw()), $stripWhitespace($this->renderingResult)); + } + + /** + * @AfterScenario + */ + public function throwExceptionIfLastRenderingLedToAnError(): void + { + if ($this->lastRenderingException !== null) { + throw new \RuntimeException(sprintf('The last rendering led to an error: %s', $this->lastRenderingException->getMessage()), 1698319254, $this->lastRenderingException); + } } } diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature new file mode 100644 index 00000000000..c18aaffdb6b --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature @@ -0,0 +1,60 @@ +@fixtures +Feature: Tests for the "Neos.Neos:ContentCase" Fusion prototype + + Background: + Given I have the site "a" + And I have the following NodeTypes configuration: + """yaml + 'unstructured': {} + 'Neos.Neos:FallbackNode': {} + 'Neos.Neos:Document': {} + 'Neos.Neos:Test.DocumentType1': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType2': + superTypes: + 'Neos.Neos:Document': true + """ + And I have the following nodes: + | Identifier | Path | Node Type | + | root | /sites | unstructured | + | a | /sites/a | Neos.Neos:Test.DocumentType1 | + | a1 | /sites/a/a1 | Neos.Neos:Test.DocumentType2 | + And the Fusion context node is "a1" + And the Fusion context request URI is "http://localhost" + + Scenario: ContentCase without corresponding implementation + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCase + """ + Then I expect the following Fusion rendering error: + """ + The Fusion object "Neos.Neos:Test.DocumentType2" cannot be rendered: + Most likely you mistyped the prototype name or did not define + the Fusion prototype with "prototype(Neos.Neos:Test.DocumentType2) < prototype(...)". + Other possible reasons are a missing parent-prototype or + a missing "@class" annotation for prototypes without parent. + It is also possible your Fusion file is not read because + of a missing "include:" statement. + """ + + Scenario: ContentCase with corresponding implementation + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + prototype(Neos.Neos:Test.DocumentType2) < prototype(Neos.Fusion:Value) { + value = 'implementation for DocumentType2' + } + + test = Neos.Neos:ContentCase + """ + Then I expect the following Fusion rendering result: + """ + implementation for DocumentType2 + """ diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature new file mode 100644 index 00000000000..edadc686621 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature @@ -0,0 +1,94 @@ +@fixtures +Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype + + Background: + Given I have the site "a" + And I have the following NodeTypes configuration: + """yaml + 'unstructured': {} + 'Neos.Neos:FallbackNode': {} + 'Neos.Neos:Document': {} + 'Neos.Neos:ContentCollection': {} + 'Neos.Neos:Content': {} + 'Neos.Neos:Test.DocumentType': + superTypes: + 'Neos.Neos:Document': true + childNodes: + main: + type: 'Neos.Neos:ContentCollection' + 'Neos.Neos:Test.ContentType': + superTypes: + 'Neos.Neos:Content': true + """ + And I have the following nodes: + | Identifier | Path | Node Type | + | root | /sites | unstructured | + | a | /sites/a | Neos.Neos:Test.DocumentType | + And the Fusion context node is "a" + And the Fusion context request URI is "http://localhost" + + Scenario: missing Neos.Neos.ContentCollection node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection + """ + Then I expect the following Fusion rendering error: + """ + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. + """ + + Scenario: invalid nodePath + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection { + nodePath = 'invalid' + } + """ + Then I expect the following Fusion rendering error: + """ + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. + """ + + Scenario: empty ContentCollection + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection { + nodePath = 'main' + } + """ + Then I expect the following Fusion rendering result as HTML: + """ +
+ """ + + Scenario: + When I have the following nodes: + | Identifier | Path | Node Type | + | content1 | /sites/a/main/content1 | Neos.Neos:Test.ContentType | + | content2 | /sites/a/main/content2 | Neos.Neos:Test.ContentType | + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + prototype(Neos.Neos:Test.ContentType) < prototype(Neos.Fusion:Value) { + value = ${node.identifier + ' (' + node.nodeType.name + ') '} + } + + test = Neos.Neos:ContentCollection { + nodePath = 'main' + } + """ + Then I expect the following Fusion rendering result as HTML: + """ +
content1 (Neos.Neos:Test.ContentType) content2 (Neos.Neos:Test.ContentType)
+ """ diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature new file mode 100644 index 00000000000..7802f322b6e --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature @@ -0,0 +1,162 @@ +@fixtures +Feature: Tests for the "Neos.Neos:ConvertUris" Fusion prototype + + Background: + Given I have the site "a" + And I have the following NodeTypes configuration: + """yaml + 'unstructured': {} + 'Neos.Neos:FallbackNode': {} + 'Neos.Neos:Document': {} + 'Neos.Neos:ContentCollection': {} + 'Neos.Neos:Content': {} + 'Neos.Neos:Test.DocumentType': + superTypes: + 'Neos.Neos:Document': true + childNodes: + main: + type: 'Neos.Neos:ContentCollection' + 'Neos.Neos:Test.ContentType': + superTypes: + 'Neos.Neos:Content': true + """ + And I have the following nodes: + | Identifier | Path | Node Type | Properties | + | root | /sites | unstructured | | + | a | /sites/a | Neos.Neos:Test.DocumentType | {"uriPathSegment": "a", "title": "Node a"} | + | a1 | /sites/a/a1 | Neos.Neos:Test.DocumentType | {"uriPathSegment": "a1", "title": "Node a1"} | + And the Fusion context node is "a" + And the Fusion context request URI is "http://localhost" + + Scenario: Default output + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris + """ + Then I expect the following Fusion rendering result: + """ + """ + + Scenario: Without URI + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value without URI' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value without URI + """ + + Scenario: URI to non-existing node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value with node URI to non-existing node: node://non-existing.' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value with node URI to non-existing node: . + """ + + Scenario: URI to existing node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value with node URI: node://a1.' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value with node URI: /en/a1. + """ + + Scenario: Anchor tag without node or asset URI + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'some Link' + } + """ + Then I expect the following Fusion rendering result: + """ + some Link + """ + + Scenario: Anchor tag with node URI to non-existing node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'some Link' + } + """ + Then I expect the following Fusion rendering result: + """ + some Link + """ + + Scenario: Anchor tag with URI to existing node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'some Link' + } + """ + Then I expect the following Fusion rendering result: + """ + some Link + """ + + Scenario: URI to non-existing asset + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value with node URI to non-existing asset: asset://non-existing.' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value with node URI to non-existing asset: . + """ + + Scenario: URI to existing asset + When an asset exists with id "362f3049-b9bb-454d-8769-6b35167e471e" + And I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value with node URI: asset://362f3049-b9bb-454d-8769-6b35167e471e.' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value with node URI: http://localhost/_Resources/Testing/Persistent/d0a1342bcb0e515bea83269427d8341d5f62a43d/test.svg. + """ diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index 3da578d58c5..328e4c452eb 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -1,5 +1,5 @@ @fixtures -Feature: +Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes Background: Given I have the site "a" @@ -31,17 +31,19 @@ Feature: 'Neos.Neos:Content': true """ And I have the following nodes: - | Identifier | Path | Node Type | Properties | - | root | /sites | unstructured | | - | a | /sites/a | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a", "title": "Node a"} | - | a1 | /sites/a/a1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1", "title": "Node a1"} | - | a1a | /sites/a/a1/a1a | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1a", "title": "Node a1a"} | - | a1b | /sites/a/a1/a1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b", "title": "Node a1b"} | - | a1b1 | /sites/a/a1/a1b/a1b1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1", "title": "Node a1b1"} | - | a1b1a | /sites/a/a1/a1b/a1b1/a1b1a | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1b1a", "title": "Node a1b1a"} | - | a1b1b | /sites/a/a1/a1b/a1b1/a1b1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1b", "title": "Node a1b1b"} | - | a1b2 | /sites/a/a1/a1b/a1b2 | Neos.Neos:Test.DocumentType2 | {"uriPathSegment": "a1b2", "title": "Node a1b2"} | - | a1b3 | /sites/a/a1/a1b/a1b3 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b3", "title": "Node a1b3"} | + | Identifier | Path | Node Type | Properties | Hidden in index | + | root | /sites | unstructured | | false | + | a | /sites/a | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a", "title": "Node a"} | false | + | a1 | /sites/a/a1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1", "title": "Node a1"} | false | + | a1a | /sites/a/a1/a1a | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1a", "title": "Node a1a"} | false | + | a1b | /sites/a/a1/a1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b", "title": "Node a1b"} | false | + | a1b1 | /sites/a/a1/a1b/a1b1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1", "title": "Node a1b1"} | false | + | a1b1a | /sites/a/a1/a1b/a1b1/a1b1a | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1b1a", "title": "Node a1b1a"} | false | + | a1b1b | /sites/a/a1/a1b/a1b1/a1b1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1b", "title": "Node a1b1b"} | false | + | a1b2 | /sites/a/a1/a1b/a1b2 | Neos.Neos:Test.DocumentType2 | {"uriPathSegment": "a1b2", "title": "Node a1b2"} | false | + | a1b3 | /sites/a/a1/a1b/a1b3 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b3", "title": "Node a1b3"} | false | + | a1c | /sites/a/a1/a1c | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1c", "title": "Node a1c"} | true | + | a1c1 | /sites/a/a1/a1c/a1c1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1c1", "title": "Node a1c1"} | false | And the Fusion context node is "a1a" And the Fusion context request URI is "http://localhost" @@ -143,7 +145,21 @@ Feature: filter = 'Neos.Neos:Test.DocumentType2' } } - + renderHiddenInIndex = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + renderHiddenInIndex = true + } + } + itemCollection_empty = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + itemCollection = ${[]} + } + } + itemCollection_documentNodes = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + itemCollection = ${q(site).filter('[instanceof Neos.Neos:Document]').get()} + } + } startingPoint_a1b1 = Neos.Neos:Test.Menu { items = Neos.Neos:MenuItems { startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} @@ -167,6 +183,12 @@ Feature: filter = 'Neos.Neos:Test.DocumentType2a' } } + startingPoint_a1c_renderHiddenInIndex = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).find('#a1c').get(0)} + renderHiddenInIndex = true + } + } } test.@process.join = ${Array.join(Array.map(Array.keys(value), k => k + ':' + String.chr(10) + String.trim(value[k])), String.chr(10) + String.chr(10))} """ @@ -236,6 +258,19 @@ Feature: filter_DocumentType2: + renderHiddenInIndex: + a1. (1) + a1a* (2) + a1b (2) + a1c (2) + + itemCollection_empty: + + + itemCollection_documentNodes: + a (1) + a1. (2) + startingPoint_a1b1: a1. (1) a1a* (2) @@ -255,6 +290,9 @@ Feature: startingPoint_a1b_filter_DocumentType2a: + + startingPoint_a1c_renderHiddenInIndex: + a1c1 (1) """ Scenario: Menu @@ -281,3 +319,24 @@ Feature: """ + + Scenario: BreadcrumbMenu + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:BreadcrumbMenu + """ + Then I expect the following Fusion rendering result as HTML: + """html + + """ From f3e6dedf90b851921327edaf7fc92353961dee90 Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Fri, 27 Oct 2023 09:56:55 +0200 Subject: [PATCH 055/113] Run all tests in CI (temporarily) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 673a5f565db..314ca3ef35b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,7 +182,7 @@ jobs: FLOW_CONTEXT=Testing/Behat ./flow behat:setup FLOW_CONTEXT=Testing/Behat ./flow doctrine:create FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationversion --add --version all - bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser + bin/behat -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.ContentRepository/Tests/Behavior/behat.yml.dist - name: Setup Flow configuration (PGSQL) From 2d9fd70a54e5eb9fd4ac201f3ffcfa5381e9e78e Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Fri, 27 Oct 2023 10:06:33 +0200 Subject: [PATCH 056/113] Remove unused namespace imports from feature classes --- Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php | 3 --- Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php | 2 -- 2 files changed, 5 deletions(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php index 962dca45862..b53374342dc 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php @@ -24,13 +24,11 @@ use Neos\ContentRepository\Tests\Behavior\Features\Bootstrap\NodeOperationsTrait; use Neos\Flow\ObjectManagement\ObjectManagerInterface; use Neos\Flow\ResourceManagement\ResourceManager; -use Neos\Flow\Security\AccountRepository; use Neos\Flow\Tests\Behavior\Features\Bootstrap\IsolatedBehatStepsTrait; use Neos\Flow\Tests\Behavior\Features\Bootstrap\SecurityOperationsTrait; use Neos\Flow\Utility\Environment; use Neos\Media\Domain\Model\Image; use Neos\Media\Domain\Repository\AssetRepository; -use Neos\Media\Domain\Repository\ImageRepository; use Neos\Neos\Domain\Model\Site; use Neos\Neos\Domain\Repository\SiteRepository; use Neos\Neos\Domain\Service\SiteExportService; @@ -40,7 +38,6 @@ use Neos\Neos\Service\PublishingService; use Neos\Neos\Tests\Behavior\Features\Bootstrap\FusionTrait; use Neos\Neos\Tests\Functional\Command\BehatTestHelper; -use Neos\Party\Domain\Repository\PartyRepository; use Neos\Utility\Arrays; use Neos\Utility\Files; use Neos\Utility\ObjectAccess; diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php index 6358b8a5aab..3b948f21592 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -16,8 +16,6 @@ use Behat\Gherkin\Node\PyStringNode; use Neos\ContentRepository\Tests\Behavior\Features\Bootstrap\NodeOperationsTrait; use Neos\Eel\FlowQuery\FlowQuery; -use Neos\Flow\Cli\CommandRequestHandler; -use Neos\Flow\Http\RequestHandler; use Neos\Flow\Mvc\ActionRequest; use Neos\Flow\Mvc\ActionResponse; use Neos\Flow\Mvc\Controller\Arguments; From d51c69b14769c5d252e102f42cbda78c5348b8ee Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Fri, 27 Oct 2023 10:17:32 +0200 Subject: [PATCH 057/113] Comment out failing tests --- .github/workflows/build.yml | 2 +- .../Features/Fusion/ContentCollection.feature | 54 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 314ca3ef35b..673a5f565db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,7 +182,7 @@ jobs: FLOW_CONTEXT=Testing/Behat ./flow behat:setup FLOW_CONTEXT=Testing/Behat ./flow doctrine:create FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationversion --add --version all - bin/behat -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser + bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.ContentRepository/Tests/Behavior/behat.yml.dist - name: Setup Flow configuration (PGSQL) diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature index edadc686621..ed84afac431 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature @@ -27,33 +27,33 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype And the Fusion context node is "a" And the Fusion context request URI is "http://localhost" - Scenario: missing Neos.Neos.ContentCollection node - When I execute the following Fusion code: - """fusion - include: resource://Neos.Fusion/Private/Fusion/Root.fusion - include: resource://Neos.Neos/Private/Fusion/Root.fusion - - test = Neos.Neos:ContentCollection - """ - Then I expect the following Fusion rendering error: - """ - No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. - """ - - Scenario: invalid nodePath - When I execute the following Fusion code: - """fusion - include: resource://Neos.Fusion/Private/Fusion/Root.fusion - include: resource://Neos.Neos/Private/Fusion/Root.fusion - - test = Neos.Neos:ContentCollection { - nodePath = 'invalid' - } - """ - Then I expect the following Fusion rendering error: - """ - No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. - """ +# Scenario: missing Neos.Neos.ContentCollection node +# When I execute the following Fusion code: +# """fusion +# include: resource://Neos.Fusion/Private/Fusion/Root.fusion +# include: resource://Neos.Neos/Private/Fusion/Root.fusion +# +# test = Neos.Neos:ContentCollection +# """ +# Then I expect the following Fusion rendering error: +# """ +# No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. +# """ +# +# Scenario: invalid nodePath +# When I execute the following Fusion code: +# """fusion +# include: resource://Neos.Fusion/Private/Fusion/Root.fusion +# include: resource://Neos.Neos/Private/Fusion/Root.fusion +# +# test = Neos.Neos:ContentCollection { +# nodePath = 'invalid' +# } +# """ +# Then I expect the following Fusion rendering error: +# """ +# No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. +# """ Scenario: empty ContentCollection When I execute the following Fusion code: From d2a6f817763d60b4dbf589bba97620902c8e151e Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Sun, 29 Oct 2023 13:51:30 +0100 Subject: [PATCH 058/113] Split up Menu Behat tests into separate scenarios and fix `ConvertUris.feature` --- .../Features/Bootstrap/FusionTrait.php | 40 +- .../Features/Fusion/ConvertUris.feature | 7 - .../Behavior/Features/Fusion/Menu.feature | 444 ++++++++++++------ 3 files changed, 330 insertions(+), 161 deletions(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php index 3b948f21592..ecd35ee994b 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -44,6 +44,8 @@ trait FusionTrait private ?string $renderingResult = null; + private ?string $fusionCode = null; + private ?\Throwable $lastRenderingException = null; /** @@ -53,6 +55,7 @@ public function setupFusionContext(): void { $this->fusionRequest = null; $this->fusionContext = []; + $this->fusionCode = null; $this->renderingResult = null; } @@ -96,6 +99,13 @@ private function addRoutingParameters(ServerRequestInterface $httpRequest): Serv return $spyMiddleware->getHandledRequest(); } + /** + * @When I have the following Fusion setup: + */ + public function iHaveTheFollowingFusionSetup(PyStringNode $fusionCode): void + { + $this->fusionCode = $fusionCode->getRaw(); + } /** * @When I execute the following Fusion code: @@ -111,7 +121,7 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string self::$bootstrap->setActiveRequestHandler($requestHandler); $this->throwExceptionIfLastRenderingLedToAnError(); $this->renderingResult = null; - $fusionAst = (new Parser())->parseFromSource(FusionSourceCodeCollection::fromString($fusionCode->getRaw())); + $fusionAst = (new Parser())->parseFromSource(FusionSourceCodeCollection::fromString($this->fusionCode . chr(10) . $fusionCode->getRaw())); $uriBuilder = new UriBuilder(); $uriBuilder->setRequest($this->fusionRequest); $controllerContext = new ControllerContext($this->fusionRequest, new ActionResponse(), new Arguments(), $uriBuilder); @@ -135,23 +145,31 @@ public function iExpectTheFollowingFusionRenderingResult(PyStringNode $expectedR } /** - * @Then I expect the following Fusion rendering error: + * @Then I expect the following Fusion rendering result as HTML: */ - public function iExpectTheFollowingFusionRenderingError(PyStringNode $expectedError): void + public function iExpectTheFollowingFusionRenderingResultAsHtml(PyStringNode $expectedResult): void { - Assert::assertNotNull($this->lastRenderingException, 'The previous rendering did not lead to an error'); - Assert::assertSame($expectedError->getRaw(), $this->lastRenderingException->getMessage()); - $this->lastRenderingException = null; - } + Assert::assertIsString($this->renderingResult, 'Previous Fusion rendering did not produce a string'); + $stripWhitespace = static fn (string $input): string => preg_replace(['/>[^\S ]+/s', '/[^\S ]+ ', '<', '\\1', '><'], $input); + + $expectedDom = new \DomDocument(); + $expectedDom->preserveWhiteSpace = false; + $expectedDom->loadHTML($stripWhitespace($expectedResult->getRaw())); + $actualDom = new \DomDocument(); + $actualDom->preserveWhiteSpace = false; + $actualDom->loadHTML($stripWhitespace($this->renderingResult)); + Assert::assertSame($expectedDom->saveHTML(), $actualDom->saveHTML()); + } /** - * @Then I expect the following Fusion rendering result as HTML: + * @Then I expect the following Fusion rendering error: */ - public function iExpectTheFollowingFusionRenderingResultAsHtml(PyStringNode $expectedResult): void + public function iExpectTheFollowingFusionRenderingError(PyStringNode $expectedError): void { - $stripWhitespace = static fn (string $input): string => preg_replace(['/>[^\S ]+/s', '/[^\S ]+ ', '<', '\\1', '><'], $input); - Assert::assertXmlStringEqualsXmlString($stripWhitespace($expectedResult->getRaw()), $stripWhitespace($this->renderingResult)); + Assert::assertNotNull($this->lastRenderingException, 'The previous rendering did not lead to an error'); + Assert::assertSame($expectedError->getRaw(), $this->lastRenderingException->getMessage()); + $this->lastRenderingException = null; } /** diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature index 7802f322b6e..41bac4f6d41 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature @@ -9,16 +9,9 @@ Feature: Tests for the "Neos.Neos:ConvertUris" Fusion prototype 'Neos.Neos:FallbackNode': {} 'Neos.Neos:Document': {} 'Neos.Neos:ContentCollection': {} - 'Neos.Neos:Content': {} 'Neos.Neos:Test.DocumentType': superTypes: 'Neos.Neos:Document': true - childNodes: - main: - type: 'Neos.Neos:ContentCollection' - 'Neos.Neos:Test.ContentType': - superTypes: - 'Neos.Neos:Content': true """ And I have the following nodes: | Identifier | Path | Node Type | Properties | diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index 328e4c452eb..8ce5188aeec 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -46,9 +46,7 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes | a1c1 | /sites/a/a1/a1c/a1c1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1c1", "title": "Node a1c1"} | false | And the Fusion context node is "a1a" And the Fusion context request URI is "http://localhost" - - Scenario: MenuItems - When I execute the following Fusion code: + And I have the following Fusion setup: """fusion include: resource://Neos.Fusion/Private/Fusion/Root.fusion include: resource://Neos.Neos/Private/Fusion/Root.fusion @@ -75,131 +73,34 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes ` } } + """ - test = Neos.Fusion:DataStructure { - default = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems - } - maximumLevels_3 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - maximumLevels = 3 - } - } - entryLevel_negative = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - entryLevel = -1 - } - } - entryLevel_negative_out_of_range = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - entryLevel = -5 - } - } - entryLevel_0 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - entryLevel = 0 - } - } - entryLevel_2 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - entryLevel = 2 - } - } - entryLevel_positive_out_of_range = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - entryLevel = 5 - } - } - lastLevel_negative = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - lastLevel = -1 - } - } - lastLevel_negative_out_of_range = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - lastLevel = -5 - } - } - lastLevel_0 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - lastLevel = 0 - } - } - lastLevel_1 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - lastLevel = 1 - } - } - filter_nonExisting = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - filter = 'Non.Existing:NodeType' - } - } - filter_DocumentType1 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - filter = 'Neos.Neos:Test.DocumentType1' - } - } - filter_DocumentType2 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - filter = 'Neos.Neos:Test.DocumentType2' - } - } - renderHiddenInIndex = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - renderHiddenInIndex = true - } - } - itemCollection_empty = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - itemCollection = ${[]} - } - } - itemCollection_documentNodes = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - itemCollection = ${q(site).filter('[instanceof Neos.Neos:Document]').get()} - } - } - startingPoint_a1b1 = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} - } - } - startingPoint_a1b1_entryLevel_negative = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} - entryLevel = -1 - } - } - startingPoint_a1b1_lastLevel_negative = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} - lastLevel = -1 - } - } - startingPoint_a1b_filter_DocumentType2a = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').get(0)} - filter = 'Neos.Neos:Test.DocumentType2a' - } - } - startingPoint_a1c_renderHiddenInIndex = Neos.Neos:Test.Menu { - items = Neos.Neos:MenuItems { - startingPoint = ${q(node).find('#a1c').get(0)} - renderHiddenInIndex = true - } - } + Scenario: MenuItems (default) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems } - test.@process.join = ${Array.join(Array.map(Array.keys(value), k => k + ':' + String.chr(10) + String.trim(value[k])), String.chr(10) + String.chr(10))} """ Then I expect the following Fusion rendering result: """ - default: a1. (1) a1a* (2) a1b (2) - maximumLevels_3: + """ + + Scenario: MenuItems (maximumLevels = 3) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + maximumLevels = 3 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) a1a* (2) a1b (2) @@ -207,94 +108,351 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes a1b2 (3) a1b3 (3) - entryLevel_negative: + """ + + Scenario: MenuItems (entryLevel = -5) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = -5 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + + """ + + + Scenario: MenuItems (entryLevel = -1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1a* (1) a1b (1) a1b1 (2) a1b2 (2) a1b3 (2) - entryLevel_negative_out_of_range: - a1. (1) - a1a* (2) - a1b (2) + """ - entryLevel_0: + Scenario: MenuItems (entryLevel = 0) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 0 + } + } + """ + Then I expect the following Fusion rendering result: + """ + """ - entryLevel_2: + Scenario: MenuItems (entryLevel = 2) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 2 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1a* (1) a1b (1) a1b1 (2) a1b2 (2) a1b3 (2) - entryLevel_positive_out_of_range: + """ + Scenario: MenuItems (entryLevel = 5) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 5 + } + } + """ + Then I expect the following Fusion rendering result: + """ - lastLevel_negative: + """ + + Scenario: MenuItems (lastLevel = -5) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = -5 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + + """ + + Scenario: MenuItems (lastLevel = -1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) a1a* (2) a1b (2) - lastLevel_negative_out_of_range: - a1. (1) + """ - lastLevel_0: + Scenario: MenuItems (lastLevel = 0) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = 0 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) a1a* (2) a1b (2) - lastLevel_1: + """ + + Scenario: MenuItems (lastLevel = 1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = 1 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) - filter_nonExisting: + """ + Scenario: MenuItems (filter non existing node type) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Non.Existing:NodeType' + } + } + """ + Then I expect the following Fusion rendering result: + """ + """ - filter_DocumentType1: + Scenario: MenuItems (filter = DocumentType1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Neos.Neos:Test.DocumentType1' + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) a1b (2) - filter_DocumentType2: + """ + + Scenario: MenuItems (filter = DocumentType2) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Neos.Neos:Test.DocumentType2' + } + } + """ + Then I expect the following Fusion rendering result: + """ + """ - renderHiddenInIndex: + Scenario: MenuItems (renderHiddenInIndex) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + renderHiddenInIndex = true + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) a1a* (2) a1b (2) a1c (2) - itemCollection_empty: + """ + Scenario: MenuItems (empty itemCollection) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + itemCollection = ${[]} + } + } + """ + Then I expect the following Fusion rendering result: + """ + """ - itemCollection_documentNodes: + Scenario: MenuItems (itemCollection document nodes) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + itemCollection = ${q(site).filter('[instanceof Neos.Neos:Document]').get()} + } + } + """ + Then I expect the following Fusion rendering result: + """ a (1) a1. (2) - startingPoint_a1b1: + """ + + Scenario: MenuItems (startingPoint a1b1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) a1a* (2) a1b (2) - startingPoint_a1b1_entryLevel_negative: + """ + + Scenario: MenuItems (startingPoint a1b1, negative entryLevel) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + entryLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1a* (1) a1b (1) a1b1 (2) a1b2 (2) a1b3 (2) - startingPoint_a1b1_lastLevel_negative: + """ + + Scenario: MenuItems (startingPoint a1b1, negative lastLevel) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + lastLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ a1. (1) a1a* (2) a1b (2) - startingPoint_a1b_filter_DocumentType2a: + """ + Scenario: MenuItems (startingPoint a1b, filter DocumentType2a) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').get(0)} + filter = 'Neos.Neos:Test.DocumentType2a' + } + } + """ + Then I expect the following Fusion rendering result: + """ + + """ - startingPoint_a1c_renderHiddenInIndex: + Scenario: MenuItems (startingPoint a1c, renderHiddenInIndex) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).find('#a1c').get(0)} + renderHiddenInIndex = true + } + } + """ + Then I expect the following Fusion rendering result: + """ a1c1 (1) + """ +# +# +# entryLevel_negative: +# a1a* (1) +# a1b (1) +# a1b1 (2) +# a1b2 (2) +# a1b3 (2) +# +# entryLevel_negative_out_of_range: +# a1. (1) +# a1a* (2) +# a1b (2) +# +# entryLevel_0: +# + +# """ + Scenario: Menu When I execute the following Fusion code: """fusion From cade98c7cee85d272daaef61e8da6c0b0aca748d Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Sun, 29 Oct 2023 13:51:52 +0100 Subject: [PATCH 059/113] cleanup --- .../Behavior/Features/Fusion/Menu.feature | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index 8ce5188aeec..58dab2f4ebe 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -434,25 +434,6 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes """ -# -# -# entryLevel_negative: -# a1a* (1) -# a1b (1) -# a1b1 (2) -# a1b2 (2) -# a1b3 (2) -# -# entryLevel_negative_out_of_range: -# a1. (1) -# a1a* (2) -# a1b (2) -# -# entryLevel_0: -# - -# """ - Scenario: Menu When I execute the following Fusion code: """fusion From 4f9efcfb8248b10dac4087112a58fe07ab4aaa12 Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Sun, 29 Oct 2023 14:28:46 +0100 Subject: [PATCH 060/113] TASK: Behat-based Fusion tests (v1) Related: #3594 --- .../Features/Bootstrap/FeatureContext.php | 1 + .../Features/Bootstrap/FusionTrait.php | 186 ++++++ .../Features/Fusion/ContentCase.feature | 96 ++++ .../Features/Fusion/ContentCollection.feature | 143 +++++ .../Features/Fusion/ConvertUris.feature | 193 +++++++ .../Behavior/Features/Fusion/Menu.feature | 533 ++++++++++++++++++ 6 files changed, 1152 insertions(+) create mode 100644 Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature create mode 100644 Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php index 733c0ee5373..0aab4eb1d01 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php @@ -37,6 +37,7 @@ class FeatureContext implements BehatContext use CRBehavioralTestsSubjectProvider; use RoutingTrait; use MigrationsTrait; + use FusionTrait; protected Environment $environment; diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php new file mode 100644 index 00000000000..1acd071db60 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -0,0 +1,186 @@ +fusionGlobalContext = []; + $this->fusionContext = []; + $this->fusionCode = null; + $this->renderingResult = null; + } + + /** + * @When I am in Fusion rendering mode: + */ + public function iAmInFusionRenderingMode(TableNode $renderingModeData): void + { + $data = $renderingModeData->getHash()[0]; + $this->fusionGlobalContext['renderingMode'] = new RenderingMode($data['name'] ?? 'Testing', strtolower($data['isEdit'] ?? 'false') === 'true', strtolower($data['isPreview'] ?? 'false') === 'true', $data['title'] ?? 'Testing', $data['fusionPath'] ?? 'root', []); + } + + /** + * @When the Fusion context node is :nodeAggregateId + */ + public function theFusionContextNodeIs(string $nodeAggregateId): void + { + $subgraph = $this->getCurrentSubgraph(); + $this->fusionContext['node'] = $subgraph->findNodeById(NodeAggregateId::fromString($nodeAggregateId)); + if ($this->fusionContext['node'] === null) { + throw new InvalidArgumentException(sprintf('Node with aggregate id "%s" could not be found in the current subgraph', $nodeAggregateId), 1696700222); + } + $this->fusionContext['documentNode'] = $subgraph->findClosestNode(NodeAggregateId::fromString($nodeAggregateId), FindClosestNodeFilter::create('Neos.Neos:Document')); + if ($this->fusionContext['documentNode'] === null) { + throw new \RuntimeException(sprintf('Failed to find closest document node for node with aggregate id "%s"', $nodeAggregateId), 1697790940); + } + $this->fusionContext['site'] = $subgraph->findClosestNode($this->fusionContext['documentNode']->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: NodeTypeNameFactory::NAME_SITE)); + if ($this->fusionContext['site'] === null) { + throw new \RuntimeException(sprintf('Failed to resolve site node for node with aggregate id "%s"', $nodeAggregateId), 1697790963); + } + } + + /** + * @When the Fusion context request URI is :requestUri + */ + public function theFusionContextRequestIs(string $requestUri = null): void + { + $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', $requestUri); + $httpRequest = $this->addRoutingParameters($httpRequest); + + $this->fusionGlobalContext['request'] = ActionRequest::fromHttpRequest($httpRequest); + } + + /** + * @When I have the following Fusion setup: + */ + public function iHaveTheFollowingFusionSetup(PyStringNode $fusionCode): void + { + $this->fusionCode = $fusionCode->getRaw(); + } + + + /** + * @When I execute the following Fusion code: + * @When I execute the following Fusion code on path :path: + */ + public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string $path = 'test'): void + { + if (isset($this->fusionGlobalContext['request'])) { + $requestHandler = new FunctionalTestRequestHandler(self::$bootstrap); + $requestHandler->setHttpRequest($this->fusionGlobalContext['request']->getHttpRequest()); + } + $this->throwExceptionIfLastRenderingLedToAnError(); + $this->renderingResult = null; + $fusionAst = (new Parser())->parseFromSource(FusionSourceCodeCollection::fromString($this->fusionCode . chr(10) . $fusionCode->getRaw())); + + $fusionGlobals = FusionGlobals::fromArray($this->fusionGlobalContext); + + $fusionRuntime = (new RuntimeFactory())->createFromConfiguration($fusionAst, $fusionGlobals); + $fusionRuntime->overrideExceptionHandler($this->getObjectManager()->get(ThrowingHandler::class)); + $fusionRuntime->pushContextArray($this->fusionContext); + try { + $this->renderingResult = $fusionRuntime->render($path); + } catch (\Throwable $exception) { + $this->lastRenderingException = $exception; + } + $fusionRuntime->popContext(); + } + + /** + * @Then I expect the following Fusion rendering result: + */ + public function iExpectTheFollowingFusionRenderingResult(PyStringNode $expectedResult): void + { + Assert::assertSame($expectedResult->getRaw(), $this->renderingResult); + } + + /** + * @Then I expect the following Fusion rendering result as HTML: + */ + public function iExpectTheFollowingFusionRenderingResultAsHtml(PyStringNode $expectedResult): void + { + Assert::assertIsString($this->renderingResult, 'Previous Fusion rendering did not produce a string'); + $stripWhitespace = static fn (string $input): string => preg_replace(['/>[^\S ]+/s', '/[^\S ]+ ', '<', '\\1', '><'], $input); + + $expectedDom = new DomDocument(); + $expectedDom->preserveWhiteSpace = false; + $expectedDom->loadHTML($stripWhitespace($expectedResult->getRaw())); + + $actualDom = new DomDocument(); + $actualDom->preserveWhiteSpace = false; + $actualDom->loadHTML($stripWhitespace($this->renderingResult)); + + Assert::assertSame($expectedDom->saveHTML(), $actualDom->saveHTML()); + } + + /** + * @Then I expect the following Fusion rendering error: + */ + public function iExpectTheFollowingFusionRenderingError(PyStringNode $expectedError): void + { + Assert::assertNotNull($this->lastRenderingException, 'The previous rendering did not lead to an error'); + Assert::assertSame($expectedError->getRaw(), $this->lastRenderingException->getMessage()); + $this->lastRenderingException = null; + } + + /** + * @AfterScenario + */ + public function throwExceptionIfLastRenderingLedToAnError(): void + { + if ($this->lastRenderingException !== null) { + throw new \RuntimeException(sprintf('The last rendering led to an error: %s', $this->lastRenderingException->getMessage()), 1698319254, $this->lastRenderingException); + } + } + +} diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature new file mode 100644 index 00000000000..ca7472cda93 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature @@ -0,0 +1,96 @@ +@fixtures +Feature: Tests for the "Neos.Neos:ContentCase" Fusion prototype + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository:Root': {} + 'Neos.Neos:Sites': + superTypes: + 'Neos.ContentRepository:Root': true + 'Neos.Neos:Document': + properties: + title: + type: string + uriPathSegment: + type: string + 'Neos.Neos:Site': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType1': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType2': + superTypes: + 'Neos.Neos:Document': true + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And I am user identified by "initiating-user-identifier" + + When the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | newContentStreamId | "cs-identifier" | + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "root" | + | nodeTypeName | "Neos.Neos:Sites" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" and dimension space point {} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | parentNodeAggregateId | nodeTypeName | + | a | root | Neos.Neos:Site | + | a1 | a | Neos.Neos:Test.DocumentType2 | + And A site exists for node name "a" and domain "http://localhost" + And the sites configuration is: + """yaml + Neos: + Neos: + sites: + '*': + contentRepository: default + contentDimensions: + resolver: + factoryClassName: Neos\Neos\FrontendRouting\DimensionResolution\Resolver\NoopResolverFactory + """ + And the Fusion context node is "a1" + And the Fusion context request URI is "http://localhost" + + Scenario: ContentCase without corresponding implementation + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCase + """ + Then I expect the following Fusion rendering error: + """ + The Fusion object "Neos.Neos:Test.DocumentType2" cannot be rendered: + Most likely you mistyped the prototype name or did not define + the Fusion prototype with "prototype(Neos.Neos:Test.DocumentType2) < prototype(...)". + Other possible reasons are a missing parent-prototype or + a missing "@class" annotation for prototypes without parent. + It is also possible your Fusion file is not read because + of a missing "include:" statement. + """ + + Scenario: ContentCase with corresponding implementation + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + prototype(Neos.Neos:Test.DocumentType2) < prototype(Neos.Fusion:Value) { + value = 'implementation for DocumentType2' + } + + test = Neos.Neos:ContentCase + """ + Then I expect the following Fusion rendering result: + """ + implementation for DocumentType2 + """ diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature new file mode 100644 index 00000000000..449cc021952 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature @@ -0,0 +1,143 @@ +@fixtures +Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository:Root': {} + 'Neos.Neos:ContentCollection': {} + 'Neos.Neos:Content': {} + 'Neos.Neos:Sites': + superTypes: + 'Neos.ContentRepository:Root': true + 'Neos.Neos:Document': + properties: + title: + type: string + uriPathSegment: + type: string + 'Neos.Neos:Site': + superTypes: + 'Neos.Neos:Document': true + childNodes: + main: + type: 'Neos.Neos:ContentCollection' + 'Neos.Neos:Test.DocumentType': + superTypes: + 'Neos.Neos:Document': true + childNodes: + main: + type: 'Neos.Neos:ContentCollection' + 'Neos.Neos:Test.ContentType': + superTypes: + 'Neos.Neos:Content': true + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And I am user identified by "initiating-user-identifier" + + When the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | newContentStreamId | "cs-identifier" | + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "root" | + | nodeTypeName | "Neos.Neos:Sites" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" and dimension space point {} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | parentNodeAggregateId | nodeTypeName | + | a | root | Neos.Neos:Site | + And A site exists for node name "a" and domain "http://localhost" + And the sites configuration is: + """yaml + Neos: + Neos: + sites: + '*': + contentRepository: default + contentDimensions: + resolver: + factoryClassName: Neos\Neos\FrontendRouting\DimensionResolution\Resolver\NoopResolverFactory + """ + And the Fusion context node is "a" + And the Fusion context request URI is "http://localhost" + + Scenario: missing Neos.Neos.ContentCollection node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection + """ + Then I expect the following Fusion rendering error: + """ + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/[root]) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "flow structureadjustments:fix --node-type Neos.Neos:Site" command. + """ + + Scenario: invalid nodePath + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection { + nodePath = 'invalid' + } + """ + Then I expect the following Fusion rendering error: + """ + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/[root]) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "flow structureadjustments:fix --node-type Neos.Neos:Site" command. + """ + + Scenario: empty ContentCollection + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection { + nodePath = 'main' + } + """ + Then I expect the following Fusion rendering result as HTML: + """ +
+ """ + + Scenario: + When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "a1" | + | nodeTypeName | "Neos.Neos:Test.DocumentType" | + | parentNodeAggregateId | "a" | + | initialPropertyValues | {} | + | tetheredDescendantNodeAggregateIds | { "main": "a1-main"} | + And the graph projection is fully up to date + When the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | parentNodeAggregateId | nodeTypeName | + | content1 | a1-main | Neos.Neos:Test.ContentType | + | content2 | a1-main | Neos.Neos:Test.ContentType | + And the Fusion context node is "a1" + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + prototype(Neos.Neos:Test.ContentType) < prototype(Neos.Fusion:Value) { + value = ${node.nodeAggregateId.value + ' (' + node.nodeType.name.value + ') '} + } + + test = Neos.Neos:ContentCollection { + nodePath = 'main' + } + """ + Then I expect the following Fusion rendering result as HTML: + """ +
content1 (Neos.Neos:Test.ContentType) content2 (Neos.Neos:Test.ContentType)
+ """ diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature new file mode 100644 index 00000000000..a895188a3ae --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature @@ -0,0 +1,193 @@ +@fixtures +Feature: Tests for the "Neos.Neos:ConvertUris" Fusion prototype + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository:Root': {} + 'Neos.Neos:Sites': + superTypes: + 'Neos.ContentRepository:Root': true + 'Neos.Neos:Document': + properties: + title: + type: string + uriPathSegment: + type: string + 'Neos.Neos:Site': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType': + superTypes: + 'Neos.Neos:Document': true + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And I am user identified by "initiating-user-identifier" + + When the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | newContentStreamId | "cs-identifier" | + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "root" | + | nodeTypeName | "Neos.Neos:Sites" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" and dimension space point {} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | parentNodeAggregateId | nodeTypeName |initialPropertyValues | nodeName | + | a | root | Neos.Neos:Site |{"title": "Node a"} | a | + | a1 | a | Neos.Neos:Test.DocumentType |{"uriPathSegment": "a1", "title": "Node a1"} | a1 | + And A site exists for node name "a" and domain "http://localhost" + And the sites configuration is: + """yaml + Neos: + Neos: + sites: + '*': + contentRepository: default + contentDimensions: + resolver: + factoryClassName: Neos\Neos\FrontendRouting\DimensionResolution\Resolver\NoopResolverFactory + """ + And the Fusion context node is "a" + And the Fusion context request URI is "http://localhost" + + Scenario: Default output + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris + """ + Then I expect the following Fusion rendering result: + """ + """ + + Scenario: Without URI + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value without URI' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value without URI + """ + +# NOTE: This scenario currently breaks because it leads to an exception "Could not resolve a route and its corresponding URI for the given parameters" +# Scenario: URI to non-existing node +# When I execute the following Fusion code: +# """fusion +# include: resource://Neos.Fusion/Private/Fusion/Root.fusion +# include: resource://Neos.Neos/Private/Fusion/Root.fusion +# +# test = Neos.Neos:ConvertUris { +# value = 'Some value with node URI to non-existing node: node://non-existing.' +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# Some value with node URI to non-existing node: . +# """ + + Scenario: URI to existing node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value with node URI: node://a1.' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value with node URI: /a1. + """ + +# NOTE: This scenario currently breaks because the rel attribute is just "noopener" instead of "noopener external" +# Scenario: Anchor tag without node or asset URI +# When I execute the following Fusion code: +# """fusion +# include: resource://Neos.Fusion/Private/Fusion/Root.fusion +# include: resource://Neos.Neos/Private/Fusion/Root.fusion +# +# test = Neos.Neos:ConvertUris { +# value = 'some Link' +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# some Link +# """ + +# NOTE: This scenario currently breaks because it leads to an exception "Could not resolve a route and its corresponding URI for the given parameters" +# Scenario: Anchor tag with node URI to non-existing node +# When I execute the following Fusion code: +# """fusion +# include: resource://Neos.Fusion/Private/Fusion/Root.fusion +# include: resource://Neos.Neos/Private/Fusion/Root.fusion +# +# test = Neos.Neos:ConvertUris { +# value = 'some Link' +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# some Link +# """ + + Scenario: Anchor tag with URI to existing node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'some Link' + } + """ + Then I expect the following Fusion rendering result: + """ + some Link + """ + + Scenario: URI to non-existing asset + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ConvertUris { + value = 'Some value with node URI to non-existing asset: asset://non-existing.' + } + """ + Then I expect the following Fusion rendering result: + """ + Some value with node URI to non-existing asset: . + """ + +# Scenario: URI to existing asset +# When an asset exists with id "362f3049-b9bb-454d-8769-6b35167e471e" +# And I execute the following Fusion code: +# """fusion +# include: resource://Neos.Fusion/Private/Fusion/Root.fusion +# include: resource://Neos.Neos/Private/Fusion/Root.fusion +# +# test = Neos.Neos:ConvertUris { +# value = 'Some value with node URI: asset://362f3049-b9bb-454d-8769-6b35167e471e.' +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# Some value with node URI: http://localhost/_Resources/Testing/Persistent/d0a1342bcb0e515bea83269427d8341d5f62a43d/test.svg. +# """ diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature new file mode 100644 index 00000000000..ad7915da3b5 --- /dev/null +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -0,0 +1,533 @@ +@fixtures @contentrepository +Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository:Root': {} + 'Neos.Neos:Sites': + superTypes: + 'Neos.ContentRepository:Root': true + 'Neos.Neos:Document': + properties: + title: + type: string + uriPathSegment: + type: string + _hiddenInIndex: + type: bool + 'Neos.Neos:Site': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Content': + properties: + title: + type: string + 'Neos.Neos:Test.DocumentType1': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType2': + superTypes: + 'Neos.Neos:Document': true + 'Neos.Neos:Test.DocumentType2a': + superTypes: + 'Neos.Neos:Test.DocumentType2': true + 'Neos.Neos:Test.Content': + superTypes: + 'Neos.Neos:Content': true + + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And I am user identified by "initiating-user-identifier" + + When the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | newContentStreamId | "cs-identifier" | + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "root" | + | nodeTypeName | "Neos.Neos:Sites" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" and dimension space point {} + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | parentNodeAggregateId | nodeTypeName | initialPropertyValues | nodeName | + | a | root | Neos.Neos:Site | {"title": "Node a"} | a | + | a1 | a | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1", "title": "Node a1"} | a1 | + | a1a | a1 | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1a", "title": "Node a1a"} | a1a | + | a1b | a1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b", "title": "Node a1b"} | a1b | + | a1b1 | a1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1", "title": "Node a1b1"} | a1b1 | + | a1b1a | a1b1 | Neos.Neos:Test.DocumentType2a | {"uriPathSegment": "a1b1a", "title": "Node a1b1a"} | a1b1a | + | a1b1b | a1b1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b1b", "title": "Node a1b1b"} | a1b1b | + | a1b2 | a1b | Neos.Neos:Test.DocumentType2 | {"uriPathSegment": "a1b2", "title": "Node a1b2"} | a1b2 | + | a1b3 | a1b | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1b3", "title": "Node a1b3"} | a1b3 | + | a1c | a1 | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1c", "title": "Node a1c", "_hiddenInIndex": true} | a1c | + | a1c1 | a1c | Neos.Neos:Test.DocumentType1 | {"uriPathSegment": "a1c1", "title": "Node a1c1"} | a1c1 | + And A site exists for node name "a" and domain "http://localhost" + And the sites configuration is: + """yaml + Neos: + Neos: + sites: + '*': + contentRepository: default + contentDimensions: + resolver: + factoryClassName: Neos\Neos\FrontendRouting\DimensionResolution\Resolver\NoopResolverFactory + """ + And the Fusion context node is "a1a" + And the Fusion context request URI is "http://localhost" + And I have the following Fusion setup: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + prototype(Neos.Neos:Test.Menu.ItemStateIndicator) < prototype(Neos.Fusion:Component) { + state = null + renderer = Neos.Fusion:Match { + @subject = ${props.state} + @default = '?' + normal = '' + current = '*' + active = '.' + absent = 'x' + } + } + + prototype(Neos.Neos:Test.Menu) < prototype(Neos.Fusion:Component) { + items = ${[]} + renderer = Neos.Fusion:Loop { + items = ${props.items} + itemRenderer = afx` + {item.node.nodeAggregateId.value} ({item.menuLevel}){String.chr(10)} + + ` + } + } + + # Always calculate menu item state to get Neos < 9 behavior + prototype(Neos.Neos:MenuItems) { + calculateItemStates = true + } + + """ + + Scenario: MenuItems (default) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + + """ + + Scenario: MenuItems (maximumLevels = 3) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + maximumLevels = 3 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + a1b1 (3) + a1b2 (3) + a1b3 (3) + + """ + +# NOTE: This scenario currently breaks because the actual output is empty +# Scenario: MenuItems (entryLevel = -5) +# When I execute the following Fusion code: +# """fusion +# test = Neos.Neos:Test.Menu { +# items = Neos.Neos:MenuItems { +# entryLevel = -5 +# } +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# a1. (1) +# a1a* (2) +# a1b (2) +# +# """ + + + Scenario: MenuItems (entryLevel = -1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1a* (1) + a1b (1) + a1b1 (2) + a1b2 (2) + a1b3 (2) + + """ + + Scenario: MenuItems (entryLevel = 0) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 0 + } + } + """ + Then I expect the following Fusion rendering result: + """ + + """ + + Scenario: MenuItems (entryLevel = 2) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 2 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1a* (1) + a1b (1) + a1b1 (2) + a1b2 (2) + a1b3 (2) + + """ + + Scenario: MenuItems (entryLevel = 5) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = 5 + } + } + """ + Then I expect the following Fusion rendering result: + """ + + """ + +# NOTE: This scenario currently breaks because the actual output is "a1., a1a*, a1b" +# Scenario: MenuItems (lastLevel = -5) +# When I execute the following Fusion code: +# """fusion +# test = Neos.Neos:Test.Menu { +# items = Neos.Neos:MenuItems { +# lastLevel = -5 +# } +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# a1. (1) +# +# """ + + Scenario: MenuItems (lastLevel = -1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + + """ + + Scenario: MenuItems (lastLevel = 0) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = 0 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + + """ + +# NOTE: This scenario currently breaks because the actual output is "a1., a1a*, a1b" +# Scenario: MenuItems (lastLevel = 1) +# When I execute the following Fusion code: +# """fusion +# test = Neos.Neos:Test.Menu { +# items = Neos.Neos:MenuItems { +# lastLevel = 1 +# } +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# a1. (1) +# +# """ + + Scenario: MenuItems (filter non existing node type) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Non.Existing:NodeType' + } + } + """ + Then I expect the following Fusion rendering result: + """ + """ + +# NOTE: This scenario currently breaks because the actual output is empty +# Scenario: MenuItems (filter = DocumentType1) +# When I execute the following Fusion code: +# """fusion +# test = Neos.Neos:Test.Menu { +# items = Neos.Neos:MenuItems { +# filter = 'Neos.Neos:Test.DocumentType1' +# } +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# a1. (1) +# a1b (2) +# +# """ + + Scenario: MenuItems (filter = DocumentType2) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Neos.Neos:Test.DocumentType2' + } + } + """ + Then I expect the following Fusion rendering result: + """ + + """ + + Scenario: MenuItems (renderHiddenInIndex) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + renderHiddenInIndex = true + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + a1c (2) + + """ + + Scenario: MenuItems (empty itemCollection) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + itemCollection = ${[]} + } + } + """ + Then I expect the following Fusion rendering result: + """ + """ + +# NOTE: This scenario currently breaks because the actual output is "a., a1., a1a*, a1b" +# Scenario: MenuItems (itemCollection document nodes) +# When I execute the following Fusion code: +# """fusion +# test = Neos.Neos:Test.Menu { +# items = Neos.Neos:MenuItems { +# itemCollection = ${q(site).filter('[instanceof Neos.Neos:Document]').get()} +# } +# } +# """ +# Then I expect the following Fusion rendering result: +# """ +# a (1) +# a1. (2) +# +# """ + + Scenario: MenuItems (startingPoint a1b1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + + """ + + Scenario: MenuItems (startingPoint a1b1, negative entryLevel) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + entryLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1a* (1) + a1b (1) + a1b1 (2) + a1b2 (2) + a1b3 (2) + + """ + + Scenario: MenuItems (startingPoint a1b1, negative lastLevel) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').children('[instanceof Neos.Neos:Document]').get(0)} + lastLevel = -1 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + + """ + + Scenario: MenuItems (startingPoint a1b, filter DocumentType2a) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).children('[instanceof Neos.Neos:Document]').get(0)} + filter = 'Neos.Neos:Test.DocumentType2a' + } + } + """ + Then I expect the following Fusion rendering result: + """ + + """ + + Scenario: MenuItems (startingPoint a1c, renderHiddenInIndex) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + startingPoint = ${q(node).find('#a1c').get(0)} + renderHiddenInIndex = true + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1c1 (1) + + """ + + Scenario: Menu + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:Menu { + # calculate menu item state to get Neos < 9 behavior + calculateItemStates = true + } + """ + Then I expect the following Fusion rendering result as HTML: + """html + + """ + +# NOTE: This scenario currently breaks because the "breadcrumb" class attribute is missing and the item states are different than expected "active" vs "normal" for homepage +# Scenario: BreadcrumbMenu +# When I execute the following Fusion code: +# """fusion +# include: resource://Neos.Fusion/Private/Fusion/Root.fusion +# include: resource://Neos.Neos/Private/Fusion/Root.fusion +# +# test = Neos.Neos:BreadcrumbMenu { +# # calculate menu item state to get Neos < 9 behavior +# calculateItemStates = true +# } +# """ +# Then I expect the following Fusion rendering result as HTML: +# """html +# +# """ From 2d166df81358e10bf9a9c1048b34ae676ebda360 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Sun, 29 Oct 2023 17:53:11 +0100 Subject: [PATCH 061/113] TASK: Restore functionality of RenderingMode view-helpers The functionality of the view-helpers `neos:rendering.inBackend`, `neos:rendering.inEditMode`, `neos:rendering.inPreviewMode` and `neos:rendering.live` is restored. Since the rendering mode is now a global property the optional `node` argument of those view-helpers has been removed. --- .../ViewHelpers/FusionContextTrait.php | 11 ++- .../AbstractRenderingStateViewHelper.php | 96 ------------------- .../Rendering/InBackendViewHelper.php | 25 ++--- .../Rendering/InEditModeViewHelper.php | 21 ++-- .../Rendering/InPreviewModeViewHelper.php | 21 ++-- .../ViewHelpers/Rendering/LiveViewHelper.php | 25 ++--- 6 files changed, 54 insertions(+), 145 deletions(-) delete mode 100644 Neos.Neos/Classes/ViewHelpers/Rendering/AbstractRenderingStateViewHelper.php diff --git a/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php b/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php index 511868cc4af..29133108fb5 100644 --- a/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php +++ b/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php @@ -33,18 +33,19 @@ trait FusionContextTrait */ protected function getContextVariable($variableName) { - $value = null; - $view = $this->viewHelperVariableContainer->getView(); if ($view instanceof FusionAwareViewInterface) { $fusionObject = $view->getFusionObject(); $currentContext = $fusionObject->getRuntime()->getCurrentContext(); if (isset($currentContext[$variableName])) { - $value = $currentContext[$variableName]; + return $currentContext[$variableName]; + } + $fusionGlobals = $fusionObject->getRuntime()->fusionGlobals; + if ($fusionGlobals->has($variableName)) { + return $fusionGlobals->get($variableName); } } - - return $value; + return null; } /** diff --git a/Neos.Neos/Classes/ViewHelpers/Rendering/AbstractRenderingStateViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Rendering/AbstractRenderingStateViewHelper.php deleted file mode 100644 index 8fe7291cdad..00000000000 --- a/Neos.Neos/Classes/ViewHelpers/Rendering/AbstractRenderingStateViewHelper.php +++ /dev/null @@ -1,96 +0,0 @@ -contentRepositoryRegistry->get( - $node->subgraphIdentity->contentRepositoryId - ); - return NodeAddressFactory::create($contentRepository)->createFromNode($node); - } - - $baseNode = null; - $view = $this->viewHelperVariableContainer->getView(); - if ($view instanceof FusionAwareViewInterface) { - $fusionObject = $view->getFusionObject(); - $currentContext = $fusionObject->getRuntime()->getCurrentContext(); - if (isset($currentContext['node'])) { - $baseNode = $currentContext['node']; - } - } - if ($baseNode === null) { - throw new ViewHelperException( - 'The ' . get_class($this) . ' needs a Node to determine the state.' - . ' We could not find one in your context so please provide it as "node" argument to the ViewHelper.', - 1427267133 - ); - } - /** @var Node $baseNode */ - $contentRepository = $this->contentRepositoryRegistry->get( - $baseNode->subgraphIdentity->contentRepositoryId - ); - return NodeAddressFactory::create($contentRepository)->createFromNode($baseNode); - } - - - protected function hasAccessToBackend(): bool - { - try { - return $this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess'); - } catch (Exception $exception) { - return false; - } - } -} diff --git a/Neos.Neos/Classes/ViewHelpers/Rendering/InBackendViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Rendering/InBackendViewHelper.php index e7565bcdf60..cc56d427269 100644 --- a/Neos.Neos/Classes/ViewHelpers/Rendering/InBackendViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Rendering/InBackendViewHelper.php @@ -14,7 +14,9 @@ namespace Neos\Neos\ViewHelpers\Rendering; -use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper; +use Neos\Fusion\ViewHelpers\FusionContextTrait; +use Neos\Neos\Domain\Model\RenderingMode; /** * ViewHelper to find out if Neos is rendering the backend. @@ -37,19 +39,9 @@ * Shown in the backend. * */ -class InBackendViewHelper extends AbstractRenderingStateViewHelper +class InBackendViewHelper extends AbstractViewHelper { - /** - * Initialize the arguments. - * - * @return void - * @throws \Neos\FluidAdaptor\Core\ViewHelper\Exception - */ - public function initializeArguments() - { - parent::initializeArguments(); - $this->registerArgument('node', Node::class, 'Node'); - } + use FusionContextTrait; /** * @return boolean @@ -57,7 +49,10 @@ public function initializeArguments() */ public function render() { - $nodeAddress = $this->getNodeAddressOfContextNode($this->arguments['node']); - return (!$nodeAddress->isInLiveWorkspace() && $this->hasAccessToBackend()); + $renderingMode = $this->getContextVariable('renderingMode'); + if ($renderingMode instanceof RenderingMode) { + return $renderingMode->isEdit || $renderingMode->isPreview; + } + return false; } } diff --git a/Neos.Neos/Classes/ViewHelpers/Rendering/InEditModeViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Rendering/InEditModeViewHelper.php index 6d4f9ece5c1..3104fd71919 100644 --- a/Neos.Neos/Classes/ViewHelpers/Rendering/InEditModeViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Rendering/InEditModeViewHelper.php @@ -15,6 +15,9 @@ namespace Neos\Neos\ViewHelpers\Rendering; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper; +use Neos\Fusion\ViewHelpers\FusionContextTrait; +use Neos\Neos\Domain\Model\RenderingMode; /** * ViewHelper to find out if Neos is rendering an edit mode. @@ -55,8 +58,10 @@ * Shown in all other cases. * */ -class InEditModeViewHelper extends AbstractRenderingStateViewHelper +class InEditModeViewHelper extends AbstractViewHelper { + use FusionContextTrait; + /** * Initialize the arguments. * @@ -66,11 +71,6 @@ class InEditModeViewHelper extends AbstractRenderingStateViewHelper public function initializeArguments() { parent::initializeArguments(); - $this->registerArgument( - 'node', - Node::class, - 'Optional Node to use context from' - ); $this->registerArgument( 'mode', 'string', @@ -84,7 +84,14 @@ public function initializeArguments() */ public function render() { - // TODO: implement + $renderingMode = $this->getContextVariable('renderingMode'); + if ($renderingMode instanceof RenderingMode) { + $mode = $this->arguments['mode']; + if ($mode) { + return $renderingMode->isEdit && $renderingMode->name === $mode; + } + return $renderingMode->isEdit; + } return false; } } diff --git a/Neos.Neos/Classes/ViewHelpers/Rendering/InPreviewModeViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Rendering/InPreviewModeViewHelper.php index 480bb4d30f8..831395f256c 100644 --- a/Neos.Neos/Classes/ViewHelpers/Rendering/InPreviewModeViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Rendering/InPreviewModeViewHelper.php @@ -15,6 +15,9 @@ namespace Neos\Neos\ViewHelpers\Rendering; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper; +use Neos\Fusion\ViewHelpers\FusionContextTrait; +use Neos\Neos\Domain\Model\RenderingMode; /** * ViewHelper to find out if Neos is rendering a preview mode. @@ -55,8 +58,10 @@ * Shown in all other cases. * */ -class InPreviewModeViewHelper extends AbstractRenderingStateViewHelper +class InPreviewModeViewHelper extends AbstractViewHelper { + use FusionContextTrait; + /** * Initialize the arguments. * @@ -66,11 +71,6 @@ class InPreviewModeViewHelper extends AbstractRenderingStateViewHelper public function initializeArguments() { parent::initializeArguments(); - $this->registerArgument( - 'node', - Node::class, - 'Optional Node to use context from' - ); $this->registerArgument( 'mode', 'string', @@ -80,7 +80,14 @@ public function initializeArguments() public function render(Node $node = null, string $mode = null): bool { - // TODO: implement + $renderingMode = $this->getContextVariable('renderingMode'); + if ($renderingMode instanceof RenderingMode) { + $mode = $this->arguments['mode']; + if ($mode) { + return $renderingMode->isPreview && $renderingMode->name === $mode; + } + return $renderingMode->isPreview; + } return false; } } diff --git a/Neos.Neos/Classes/ViewHelpers/Rendering/LiveViewHelper.php b/Neos.Neos/Classes/ViewHelpers/Rendering/LiveViewHelper.php index 597221bd3ad..41e1452fc12 100644 --- a/Neos.Neos/Classes/ViewHelpers/Rendering/LiveViewHelper.php +++ b/Neos.Neos/Classes/ViewHelpers/Rendering/LiveViewHelper.php @@ -15,6 +15,9 @@ namespace Neos\Neos\ViewHelpers\Rendering; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper; +use Neos\Fusion\ViewHelpers\FusionContextTrait; +use Neos\Neos\Domain\Model\RenderingMode; /** * ViewHelper to find out if Neos is rendering the live website. @@ -39,27 +42,19 @@ * Shown in the backend. * */ -class LiveViewHelper extends AbstractRenderingStateViewHelper +class LiveViewHelper extends AbstractViewHelper { - /** - * Initialize the arguments. - * - * @return void - * @throws \Neos\FluidAdaptor\Core\ViewHelper\Exception - */ - public function initializeArguments() - { - parent::initializeArguments(); - $this->registerArgument('node', Node::class, 'Node'); - } + use FusionContextTrait; /** * @throws \Neos\FluidAdaptor\Core\ViewHelper\Exception */ public function render(): bool { - $nodeAddress = $this->getNodeAddressOfContextNode($this->arguments['node']); - - return $nodeAddress->isInLiveWorkspace(); + $renderingMode = $this->getContextVariable('renderingMode'); + if ($renderingMode instanceof RenderingMode) { + return $renderingMode->name === RenderingMode::FRONTEND; + } + return true; } } From 055806d5f866420c312aeb661ebbc9f024765377 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Mon, 30 Oct 2023 10:24:13 +0100 Subject: [PATCH 062/113] TASK: Implement flowQuery `parents` operations via `findAncestors` instead of recursive do while --- .../FlowQueryOperations/ParentsOperation.php | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php index 2310ee2d59f..9cd08ef42f3 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php @@ -11,6 +11,10 @@ * source code. */ +use Neos\ContentRepository\Core\NodeType\NodeTypeNames; +use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter; +use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes; +use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; use Neos\ContentRepository\Core\NodeType\NodeTypeName; @@ -65,26 +69,28 @@ public function canEvaluate($context) */ public function evaluate(FlowQuery $flowQuery, array $arguments) { - $parents = []; + $parents = Nodes::createEmpty(); + $findAncestorNodesFilter = FindAncestorNodesFilter::create( + NodeTypeConstraints::create( + NodeTypeNames::createEmpty(), + NodeTypeNames::fromArray( + [NodeTypeName::fromString('Neos.ContentRepository:Root')] + ) + ) + ); + /* @var Node $contextNode */ foreach ($flowQuery->getContext() as $contextNode) { - $node = $contextNode; - do { - $node = $this->contentRepositoryRegistry->subgraphForNode($node) - ->findParentNode($node->nodeAggregateId); - if ($node === null) { - // no parent found - break; - } - // stop at sites - if ($node->nodeTypeName === NodeTypeName::fromString('Neos.Neos:Sites')) { - break; - } - $parents[] = $node; - } while (true); + $ancestorNodes = $this->contentRepositoryRegistry + ->subgraphForNode($contextNode) + ->findAncestorNodes( + $contextNode->nodeAggregateId, + $findAncestorNodesFilter + ); + $parents = $parents->merge($ancestorNodes); } - $flowQuery->setContext($parents); + $flowQuery->setContext(iterator_to_array($parents)); if (isset($arguments[0]) && !empty($arguments[0])) { $flowQuery->pushOperation('filter', $arguments); From c49a1a8a48ff928b07f2ac551e0bd49e12018c49 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Mon, 30 Oct 2023 10:11:17 +0000 Subject: [PATCH 063/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 7ce67ac5624..db800a743dd 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-21 +The following reference was automatically generated from code on 2023-10-30 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 00005d0d80d..ef9a41d5ec3 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 582e91c9267..b00941e25fb 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 66dd6924281..427e9499787 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 5895a7d401f..5cc7411beb5 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 350cb44df2c..b86f113cb4f 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index d32d606fadd..d67b163e8d5 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index e4c5c45cf0f..be27b8852ad 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 9e9407aff36..daa32be4523 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 7f7479f57ad..019af82d8bb 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index b073d7b8500..63b58bea995 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 6f6aaf4574e..aaa1ecd7da7 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 032e57f64b7..97f22e73474 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index d578688b50b..ac0f131011f 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index d25b770036d..2088e00139b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index c5191e870e1..ca89fd6aa87 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 6a3a594c574..75758d9a5d4 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-10-30 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From cd2b720e6aa003be66e41216139686ff9f8bc416 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Mon, 30 Oct 2023 14:05:40 +0100 Subject: [PATCH 064/113] FEATURE: Add additional factory methods `createWithAllowedNodeTypeNames` and `createWithDisallowedNodeTypeNames` to the nodeTypeConstraints. This makes defining constraints more straight forward as one does not have to specify empty constraints unused conditions. --- .../Projection/ContentGraph/NodeTypeConstraints.php | 8 ++++++++ .../Classes/FlowQueryOperations/ParentsOperation.php | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php index 8709e95a734..84f21f863f1 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php @@ -63,6 +63,14 @@ public static function create( return new self($explicitlyAllowedNodeTypeNames, $explicitlyDisallowedNodeTypeNames); } + public static function createWithAllowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self { + return new self($nodeTypeNames, NodeTypeNames::createEmpty()); + } + + public static function createWithDisallowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self { + return new self(NodeTypeNames::createEmpty(), $nodeTypeNames); + } + public static function fromFilterString(string $serializedFilters): self { $explicitlyAllowedNodeTypeNames = []; diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php index 9cd08ef42f3..a52ebd63cd4 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php @@ -71,8 +71,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) { $parents = Nodes::createEmpty(); $findAncestorNodesFilter = FindAncestorNodesFilter::create( - NodeTypeConstraints::create( - NodeTypeNames::createEmpty(), + NodeTypeConstraints::createWithDisallowedNodeTypeNames( NodeTypeNames::fromArray( [NodeTypeName::fromString('Neos.ContentRepository:Root')] ) From dee386ba1af7b216aa7aef7bae2302ad4327ff5d Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:28:02 +0100 Subject: [PATCH 065/113] TASK: Improve documentation of `createWithoutDimensions` --- .../Classes/DimensionSpace/DimensionSpacePoint.php | 8 +++++--- .../Classes/DimensionSpace/DimensionSpacePointSet.php | 6 +++--- .../Classes/DimensionSpace/OriginDimensionSpacePoint.php | 8 +++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php index 7b5a7730765..9a31aef29ad 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php @@ -62,11 +62,13 @@ public static function fromJsonString(string $jsonString): self } /** - * Creates a dimension space point for a simple zero-dimensional content repository. + * Creates a dimension space point for a zero-dimensional content repository. + * + * This applies to content repositories without any dimensions configured. */ - public static function zeroDimensional(): self + public static function createWithoutDimensions(): self { - return self::instance([]); + return self::fromArray([]); } /** diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php index c96732c4644..e53145727a6 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php @@ -20,7 +20,7 @@ * A set of points in the dimension space. * * In case this set is a member of an {@see EventInterface} as $coveredDimensionSpacePoints, you can be sure that it is not empty. - * There is always at least one dimension space point covered, even in a zero-dimensional content repository. {@see DimensionSpacePoint::zeroDimensional()}. + * There is always at least one dimension space point covered, even in a zero-dimensional content repository. {@see DimensionSpacePoint::createWithoutDimensions()}. * * E.g.: {[language => es, country => ar], [language => es, country => es]} * @implements \IteratorAggregate @@ -100,12 +100,12 @@ public function offsetGet(mixed $offset): ?DimensionSpacePoint return $this->points[$offset] ?? null; } - public function offsetSet(mixed $offset, mixed $value): void + public function offsetSet(mixed $offset, mixed $value): never { throw new \BadMethodCallException('Cannot modify immutable DimensionSpacePointSet', 1697802335); } - public function offsetUnset(mixed $offset): void + public function offsetUnset(mixed $offset): never { throw new \BadMethodCallException('Cannot modify immutable DimensionSpacePointSet', 1697802337); } diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php index 2ab75d92e9b..8a689481c0c 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php @@ -55,11 +55,13 @@ public static function fromArray(array $data): self } /** - * Creates an origin dimension space point for a simple zero-dimensional content repository. + * Creates a dimension space point for a zero-dimensional content repository. + * + * This applies to content repositories without any dimensions configured. */ - public static function zeroDimensional(): self + public static function createWithoutDimensions(): self { - return self::instance([]); + return self::fromArray([]); } /** From e1cf5449a045848ae510630a57eb42cd868848fb Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:30:14 +0100 Subject: [PATCH 066/113] TASK: Use new `createWithoutDimensions` --- .../src/DoctrineDbalContentGraphProjection.php | 4 ++-- .../src/Domain/Projection/Feature/NodeCreation.php | 2 +- .../Classes/Unit/NodeSubjectProvider.php | 4 ++-- Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php | 2 +- .../RequestToDimensionSpacePointContext.php | 2 +- .../DimensionResolution/Resolver/UriPathResolver.php | 2 +- Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index be851203b64..807679337c5 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -233,7 +233,7 @@ public function markStale(): void private function whenRootNodeAggregateWithNodeWasCreated(RootNodeAggregateWithNodeWasCreated $event, EventEnvelope $eventEnvelope): void { $nodeRelationAnchorPoint = NodeRelationAnchorPoint::create(); - $originDimensionSpacePoint = OriginDimensionSpacePoint::fromArray([]); + $originDimensionSpacePoint = OriginDimensionSpacePoint::createWithoutDimensions(); $node = new NodeRecord( $nodeRelationAnchorPoint, $event->nodeAggregateId, @@ -272,7 +272,7 @@ private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDim ->getAnchorPointForNodeAndOriginDimensionSpacePointAndContentStream( $event->nodeAggregateId, /** the origin DSP of the root node is always the empty dimension ({@see whenRootNodeAggregateWithNodeWasCreated}) */ - OriginDimensionSpacePoint::fromArray([]), + OriginDimensionSpacePoint::createWithoutDimensions(), $event->contentStreamId ); if ($rootNodeAnchorPoint === null) { diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php index 56bd658091f..767eb7c064b 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php @@ -44,7 +44,7 @@ trait NodeCreation private function whenRootNodeAggregateWithNodeWasCreated(RootNodeAggregateWithNodeWasCreated $event): void { $nodeRelationAnchorPoint = NodeRelationAnchorPoint::create(); - $originDimensionSpacePoint = OriginDimensionSpacePoint::fromArray([]); + $originDimensionSpacePoint = OriginDimensionSpacePoint::createWithoutDimensions(); $node = new NodeRecord( $nodeRelationAnchorPoint, diff --git a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php index ecf9d8f3160..8825aaab050 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php +++ b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php @@ -94,11 +94,11 @@ public function createMinimalNodeOfType( ContentSubgraphIdentity::create( ContentRepositoryId::fromString('default'), ContentStreamId::fromString('cs-id'), - DimensionSpacePoint::fromArray([]), + DimensionSpacePoint::createWithoutDimensions(), VisibilityConstraints::withoutRestrictions() ), NodeAggregateId::create(), - OriginDimensionSpacePoint::fromArray([]), + OriginDimensionSpacePoint::createWithoutDimensions(), NodeAggregateClassification::CLASSIFICATION_REGULAR, $nodeType->name, $nodeType, diff --git a/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php b/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php index 9f5e7b9a4ff..a93df26f963 100644 --- a/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php +++ b/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php @@ -48,7 +48,7 @@ public function __construct( * $siteNode = $this->siteNodeUtility->findSiteNodeBySite( * $site, * $liveWorkspace->currentContentStreamId, - * DimensionSpacePoint::fromArray([]), + * DimensionSpacePoint::createWithoutDimensions(), * VisibilityConstraints::frontend() * ); * ``` diff --git a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/RequestToDimensionSpacePointContext.php b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/RequestToDimensionSpacePointContext.php index f615f766c44..abec0874482 100644 --- a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/RequestToDimensionSpacePointContext.php +++ b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/RequestToDimensionSpacePointContext.php @@ -32,7 +32,7 @@ public static function fromUriPathAndRouteParametersAndResolvedSite(string $init $initialUriPath, $routeParameters, $initialUriPath, - DimensionSpacePoint::fromArray([]), + DimensionSpacePoint::createWithoutDimensions(), $resolvedSite, ); } diff --git a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php index 300586962a8..d84976d2f43 100644 --- a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php +++ b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php @@ -83,7 +83,7 @@ public static function createForNoDimensions(): self [], [], Segments::create(), - DimensionSpacePoint::fromArray([]) + DimensionSpacePoint::createWithoutDimensions() ); } diff --git a/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php b/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php index 7ae29c33826..59a6c145b07 100644 --- a/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php +++ b/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php @@ -160,11 +160,11 @@ protected function setUp(): void ContentSubgraphIdentity::create( $contentRepositoryId, ContentStreamId::fromString("cs"), - DimensionSpacePoint::fromArray([]), + DimensionSpacePoint::createWithoutDimensions(), VisibilityConstraints::withoutRestrictions() ), NodeAggregateId::fromString("na"), - OriginDimensionSpacePoint::fromArray([]), + OriginDimensionSpacePoint::createWithoutDimensions(), NodeAggregateClassification::CLASSIFICATION_REGULAR, $nodeTypeName, $textNodeType, From 2a71f73d96fb14e5453fb6a412f4a97e19d12092 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Sun, 29 Oct 2023 21:01:35 +0100 Subject: [PATCH 067/113] TASK: Remove Template from `Neos.Neos:Page`-`body` The page body was by default initialized as a Template with assigned default values. Those defaults caused issues when the body was redefined as a different component or a Join. The PR adjusts the body to a `Neos.Fusion:Join` similar to the `head` of the page. --- .../Documentation/References/NeosFusionReference.rst | 4 +--- .../Resources/Private/Fusion/Prototypes/Page.fusion | 9 +++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Neos.Neos/Documentation/References/NeosFusionReference.rst b/Neos.Neos/Documentation/References/NeosFusionReference.rst index 742e8445eef..58d3a67e902 100644 --- a/Neos.Neos/Documentation/References/NeosFusionReference.rst +++ b/Neos.Neos/Documentation/References/NeosFusionReference.rst @@ -741,12 +741,10 @@ into rendering a page; responsible for rendering the ```` tag and everythi :head.titleTag: (:ref:`Neos_Fusion__Tag`) The ```` tag :head.javascripts: (:ref:`Neos_Fusion__Join`) Script includes in the head should go here :head.stylesheets: (:ref:`Neos_Fusion__Join`) Link tags for stylesheets in the head should go here -:body.templatePath: (string) Path to a fluid template for the page body :bodyTag: (:ref:`Neos_Fusion__Tag`) The opening ``<body>`` tag :bodyTag.attributes: (:ref:`Neos_Fusion__DataStructure`) Attributes for the ``<body>`` tag -:body: (:ref:`Neos_Fusion__Template`) HTML markup for the ``<body>`` tag +:body: (:ref:`Neos_Fusion__Join`) HTML markup for the ``<body>`` tag. :body.javascripts: (:ref:`Neos_Fusion__Join`) Body footer JavaScript includes -:body.[key]: (mixed) Body template variables Examples: ^^^^^^^^^ diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Page.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Page.fusion index b0cdf9685c0..b60602bcf73 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Page.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Page.fusion @@ -68,15 +68,12 @@ prototype(Neos.Neos:Page) < prototype(Neos.Fusion:Http.Message) { } # Content of the body tag. To be defined by the integrator. - body = Neos.Fusion:Template { + body = Neos.Fusion:Join { @position = 'after bodyTag' - node = ${node} - site = ${site} - # Script includes before the closing body tag should go here + # Scripts before the closing body tag javascripts = Neos.Fusion:Join - # This processor appends the rendered javascripts Array to the rendered template - @process.appendJavaScripts = ${value + this.javascripts} + javascripts.@position = 'end 100' } closingBodyTag = '</body>' From b63a6dd36df263087f8395934a2ab2250ceadd9f Mon Sep 17 00:00:00 2001 From: Martin Ficzel <martin.ficzel@gmx.de> Date: Mon, 30 Oct 2023 16:53:02 +0100 Subject: [PATCH 068/113] Apply suggestions from code review Co-authored-by: Bastian Waidelich <b.waidelich@wwwision.de> --- .../Classes/FlowQueryOperations/ParentsOperation.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php index a52ebd63cd4..381ed9c5186 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php @@ -72,9 +72,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $parents = Nodes::createEmpty(); $findAncestorNodesFilter = FindAncestorNodesFilter::create( NodeTypeConstraints::createWithDisallowedNodeTypeNames( - NodeTypeNames::fromArray( - [NodeTypeName::fromString('Neos.ContentRepository:Root')] - ) + NodeTypeNames::fromStringArray(['Neos.ContentRepository:Root')]) ) ); From 32d1b9c518f671d7957dbdfdcae4a0d479d74937 Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Mon, 30 Oct 2023 16:57:10 +0100 Subject: [PATCH 069/113] 4343 - Apply constraint checks to ChangeNodeAggregateName --- ...moveNodeAggregate_ConstraintChecks.feature | 38 +++++----- ...NodeAggregateName_ConstraintChecks.feature | 73 +++++++++++++++++++ .../Feature/NodeRenaming/NodeRenaming.php | 15 +++- .../Bootstrap/Features/NodeRenaming.php | 40 +++++++++- 4 files changed, 144 insertions(+), 22 deletions(-) create mode 100644 Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRenaming/01_ChangeNodeAggregateName_ConstraintChecks.feature diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature index 970c803e274..53561be51c4 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature @@ -21,27 +21,27 @@ Feature: Remove NodeAggregate And I am in content repository "default" And I am user identified by "initiating-user-identifier" And the command CreateRootWorkspace is executed with payload: - | Key | Value | - | workspaceName | "live" | - | workspaceTitle | "Live" | - | workspaceDescription | "The live workspace" | - | newContentStreamId | "cs-identifier" | + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | And the graph projection is fully up to date And I am in content stream "cs-identifier" and dimension space point {"language":"de"} And the command CreateRootNodeAggregateWithNode is executed with payload: - | Key | Value | + | Key | Value | | nodeAggregateId | "lady-eleonode-rootford" | - | nodeTypeName | "Neos.ContentRepository:Root" | + | nodeTypeName | "Neos.ContentRepository:Root" | And the graph projection is fully up to date And the following CreateNodeAggregateWithNode commands are executed: - | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | tetheredDescendantNodeAggregateIds | - | sir-david-nodenborough | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | document | {"tethered":"nodewyn-tetherton"} | + | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | tetheredDescendantNodeAggregateIds | + | sir-david-nodenborough | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | document | {"tethered":"nodewyn-tetherton"} | Scenario: Try to remove a node aggregate in a non-existing content stream When the command RemoveNodeAggregate is executed with payload and exceptions are caught: | Key | Value | - | contentStreamId | "i-do-not-exist" | - | nodeAggregateId | "sir-david-nodenborough" | + | contentStreamId | "i-do-not-exist" | + | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allVariants" | Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet" @@ -49,7 +49,7 @@ Feature: Remove NodeAggregate Scenario: Try to remove a non-existing node aggregate When the command RemoveNodeAggregate is executed with payload and exceptions are caught: | Key | Value | - | nodeAggregateId | "i-do-not-exist" | + | nodeAggregateId | "i-do-not-exist" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allVariants" | Then the last command should have thrown an exception of type "NodeAggregateCurrentlyDoesNotExist" @@ -57,7 +57,7 @@ Feature: Remove NodeAggregate Scenario: Try to remove a tethered node aggregate When the command RemoveNodeAggregate is executed with payload and exceptions are caught: | Key | Value | - | nodeAggregateId | "nodewyn-tetherton" | + | nodeAggregateId | "nodewyn-tetherton" | | nodeVariantSelectionStrategy | "allVariants" | | coveredDimensionSpacePoint | {"language":"de"} | Then the last command should have thrown an exception of type "TetheredNodeAggregateCannotBeRemoved" @@ -65,23 +65,23 @@ Feature: Remove NodeAggregate Scenario: Try to remove a node aggregate in a non-existing dimension space point When the command RemoveNodeAggregate is executed with payload and exceptions are caught: | Key | Value | - | nodeAggregateId | "sir-david-nodenborough" | + | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"undeclared": "undefined"} | | nodeVariantSelectionStrategy | "allVariants" | Then the last command should have thrown an exception of type "DimensionSpacePointNotFound" Scenario: Try to remove a node aggregate in a dimension space point the node aggregate does not cover When the command RemoveNodeAggregate is executed with payload and exceptions are caught: - | Key | Value | - | nodeAggregateId | "sir-david-nodenborough" | - | coveredDimensionSpacePoint | {"language": "en"} | - | nodeVariantSelectionStrategy | "allVariants" | + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | coveredDimensionSpacePoint | {"language": "en"} | + | nodeVariantSelectionStrategy | "allVariants" | Then the last command should have thrown an exception of type "NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint" Scenario: Try to remove a node aggregate using a non-existent removalAttachmentPoint When the command RemoveNodeAggregate is executed with payload and exceptions are caught: | Key | Value | - | nodeAggregateId | "sir-david-nodenborough" | + | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | | coveredDimensionSpacePoint | {"language":"de"} | | removalAttachmentPoint | "i-do-not-exist" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRenaming/01_ChangeNodeAggregateName_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRenaming/01_ChangeNodeAggregateName_ConstraintChecks.feature new file mode 100644 index 00000000000..613c3bb4213 --- /dev/null +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRenaming/01_ChangeNodeAggregateName_ConstraintChecks.feature @@ -0,0 +1,73 @@ +@contentrepository @adapters=DoctrineDBAL +Feature: Change node name + + As a user of the CR I want to change the name of a hierarchical relation between two nodes (e.g. in taxonomies) + + These are the base test cases for the NodeAggregateCommandHandler to block invalid commands. + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:Content': [] + 'Neos.ContentRepository.Testing:Document': + childNodes: + tethered: + type: 'Neos.ContentRepository.Testing:Content' + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" and dimension space point {} + + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + And the graph projection is fully up to date + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeName | nodeTypeName | parentNodeAggregateId | initialPropertyValues | tetheredDescendantNodeAggregateIds | + | sir-david-nodenborough | null | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | {} | {"tethered": "nodewyn-tetherton"} | + | nody-mc-nodeface | occupied | Neos.ContentRepository.Testing:Document | sir-david-nodenborough | {} | {} | + + Scenario: Try to rename a node aggregate in a non-existing content stream + When the command ChangeNodeAggregateName is executed with payload and exceptions are caught: + | Key | Value | + | contentStreamId | "i-do-not-exist" | + | nodeAggregateId | "sir-david-nodenborough" | + | newNodeName | "new-name" | + Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet" + + Scenario: Try to rename a non-existing node aggregate + When the command ChangeNodeAggregateName is executed with payload and exceptions are caught: + | Key | Value | + | nodeAggregateId | "i-do-not-exist" | + | newNodeName | "new-name" | + Then the last command should have thrown an exception of type "NodeAggregateCurrentlyDoesNotExist" + + Scenario: Try to rename a root node aggregate + When the command ChangeNodeAggregateName is executed with payload and exceptions are caught: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | newNodeName | "new-name" | + Then the last command should have thrown an exception of type "NodeAggregateIsRoot" + + Scenario: Try to rename a tethered node aggregate + When the command ChangeNodeAggregateName is executed with payload and exceptions are caught: + | Key | Value | + | nodeAggregateId | "nodewyn-tetherton" | + | newNodeName | "new-name" | + Then the last command should have thrown an exception of type "NodeAggregateIsTethered" + + Scenario: Try to rename a node aggregate using an already occupied name + When the command ChangeNodeAggregateName is executed with payload and exceptions are caught: + | Key | Value | + | nodeAggregateId | "nody-mc-nodeface" | + | newNodeName | "tethered" | + Then the last command should have thrown an exception of type "NodeNameIsAlreadyOccupied" diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php index b4e3e85049c..9c04390f074 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeRenaming; use Neos\ContentRepository\Core\ContentRepository; +use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; @@ -33,7 +34,6 @@ trait NodeRenaming private function handleChangeNodeAggregateName(ChangeNodeAggregateName $command, ContentRepository $contentRepository): EventsToPublish { - $this->requireContentStreamToExist($command->contentStreamId, $contentRepository); $nodeAggregate = $this->requireProjectedNodeAggregate( $command->contentStreamId, @@ -41,6 +41,19 @@ private function handleChangeNodeAggregateName(ChangeNodeAggregateName $command, $contentRepository ); $this->requireNodeAggregateToNotBeRoot($nodeAggregate, 'and Root Node Aggregates cannot be renamed'); + $this->requireNodeAggregateToBeUntethered($nodeAggregate); + foreach ($contentRepository->getContentGraph()->findParentNodeAggregates($command->contentStreamId, $command->nodeAggregateId) as $parentNodeAggregate) { + foreach ($parentNodeAggregate->occupiedDimensionSpacePoints as $occupiedParentDimensionSpacePoint) { + $this->requireNodeNameToBeUnoccupied( + $command->contentStreamId, + $command->newNodeName, + $parentNodeAggregate->nodeAggregateId, + $occupiedParentDimensionSpacePoint, + $parentNodeAggregate->coveredDimensionSpacePoints, + $contentRepository + ); + } + } $events = Events::with( new NodeAggregateNameWasChanged( diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php index 9de587eb916..bae8d6d1163 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php @@ -15,10 +15,11 @@ namespace Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features; use Behat\Gherkin\Node\TableNode; -use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface; +use Neos\ContentRepository\Core\Feature\NodeRenaming\Command\ChangeNodeAggregateName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; +use Neos\ContentRepository\Core\SharedModel\Node\NodeName; +use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteRuntimeVariables; -use Neos\EventStore\Model\Event\StreamName; use PHPUnit\Framework\Assert; /** @@ -28,6 +29,41 @@ trait NodeRenaming { use CRTestSuiteRuntimeVariables; + /** + * @Given /^the command ChangeNodeAggregateName is executed with payload:$/ + * @param TableNode $payloadTable + * @throws \Exception + */ + public function theCommandChangeNodeAggregateNameIsExecutedWithPayload(TableNode $payloadTable) + { + $commandArguments = $this->readPayloadTable($payloadTable); + $contentStreamId = isset($commandArguments['contentStreamId']) + ? ContentStreamId::fromString($commandArguments['contentStreamId']) + : $this->currentContentStreamId; + + $command = ChangeNodeAggregateName::create( + $contentStreamId, + NodeAggregateId::fromString($commandArguments['nodeAggregateId']), + NodeName::fromString($commandArguments['newNodeName']), + ); + + $this->lastCommandOrEventResult = $this->currentContentRepository->handle($command); + } + + /** + * @Given /^the command ChangeNodeAggregateName is executed with payload and exceptions are caught:$/ + * @param TableNode $payloadTable + * @throws \Exception + */ + public function theCommandChangeNodeAggregateNameIsExecutedWithPayloadAndExceptionsAreCaught(TableNode $payloadTable) + { + try { + $this->theCommandChangeNodeAggregateNameIsExecutedWithPayload($payloadTable); + } catch (\Exception $exception) { + $this->lastCommandException = $exception; + } + } + /** * @Then /^I expect the node "([^"]*)" to have the name "([^"]*)"$/ * @param string $nodeAggregateId From 046db8857230c9689883b5daa0cf997f7d2c6fa4 Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Mon, 30 Oct 2023 17:01:49 +0100 Subject: [PATCH 070/113] Clean up code --- .../Classes/Feature/NodeRenaming/NodeRenaming.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php index 9c04390f074..f38e032ce57 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php @@ -15,7 +15,6 @@ namespace Neos\ContentRepository\Core\Feature\NodeRenaming; use Neos\ContentRepository\Core\ContentRepository; -use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; From fcc7cbcb29a839021465753c2f4fe00f1917693f Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Mon, 30 Oct 2023 18:09:22 +0000 Subject: [PATCH 071/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 99d24ba759e..26610f8ca47 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-25 +The following reference was automatically generated from code on 2023-10-30 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 09b1c1ffca3..76349c2ab6d 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index acdd26f71cf..b00941e25fb 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 8af3eda3275..427e9499787 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index b4d9bdf8585..7cdacff934b 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 2eb5a9499c7..b86f113cb4f 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 94135d27f2d..9abe6765be8 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 611d5f555fb..c5aae5fbdc2 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 4063fc97fba..daa32be4523 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index caf315703c0..019af82d8bb 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 01e5748c355..63b58bea995 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 3f4527cd249..aaa1ecd7da7 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index b2c9a72e608..97f22e73474 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 1416e17f2b3..ac0f131011f 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index e061e4a9d27..2088e00139b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index 0a54dfe46a0..ca89fd6aa87 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 554eb74ea77..75758d9a5d4 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-25 +This reference was automatically generated from code on 2023-10-30 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 7629515e47508539fbf29c8702b87ed989d6065b Mon Sep 17 00:00:00 2001 From: Martin Ficzel <ficzel@sitegeist.de> Date: Mon, 30 Oct 2023 17:09:17 +0100 Subject: [PATCH 072/113] TASK: Shorten argument names of `NodeTypeConstraints::create` for easier use with named arguments and apply psr12 formatting --- .../ContentGraph/NodeTypeConstraints.php | 16 +++++++++++----- .../FlowQueryOperations/ParentsOperation.php | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php index 84f21f863f1..114496f9e81 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php @@ -56,18 +56,24 @@ private function __construct( ) { } + /** + * We recommended to call this method with named arguments to better + * understand the distinction between allowed and disallowed NodeTypeNames + */ public static function create( - NodeTypeNames $explicitlyAllowedNodeTypeNames, - NodeTypeNames $explicitlyDisallowedNodeTypeNames + NodeTypeNames $allowed, + NodeTypeNames $disallowed ): self { - return new self($explicitlyAllowedNodeTypeNames, $explicitlyDisallowedNodeTypeNames); + return new self($allowed, $disallowed); } - public static function createWithAllowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self { + public static function createWithAllowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self + { return new self($nodeTypeNames, NodeTypeNames::createEmpty()); } - public static function createWithDisallowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self { + public static function createWithDisallowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self + { return new self(NodeTypeNames::createEmpty(), $nodeTypeNames); } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php index 381ed9c5186..d0677eb075c 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php @@ -72,7 +72,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $parents = Nodes::createEmpty(); $findAncestorNodesFilter = FindAncestorNodesFilter::create( NodeTypeConstraints::createWithDisallowedNodeTypeNames( - NodeTypeNames::fromStringArray(['Neos.ContentRepository:Root')]) + NodeTypeNames::fromStringArray(['Neos.ContentRepository:Root']) ) ); From 0341a5e568f645e05cb5a0a40e070e2eed4e0282 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:30:21 +0100 Subject: [PATCH 073/113] TASK: Adjust `Neos.Neos:Shortcut` to work with Neos 9 --- Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion index 8b050ee433d..4224aa85e23 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion @@ -62,7 +62,7 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { parentNode = Neos.Fusion:Value { targetUriTag = Neos.Neos:NodeLink { - node = ${props.node.parent} + node = ${q(node).parent().get(0)} } value = ${props.i18n.id('shortcut.clickToContinueToParentNode').arguments([this.targetUriTag]).translate()} } From 8c27d3e30dba66f28ab0d4f92918dbe11d06ebfd Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:50:19 +0100 Subject: [PATCH 074/113] TASK: Rename Neos.scss Main.scss to be consistent The compiled file is also named Main.css --- Neos.Neos/Resources/Private/Styles/{Neos.scss => Main.scss} | 0 Neos.Neos/webpack.styles.config.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename Neos.Neos/Resources/Private/Styles/{Neos.scss => Main.scss} (100%) diff --git a/Neos.Neos/Resources/Private/Styles/Neos.scss b/Neos.Neos/Resources/Private/Styles/Main.scss similarity index 100% rename from Neos.Neos/Resources/Private/Styles/Neos.scss rename to Neos.Neos/Resources/Private/Styles/Main.scss diff --git a/Neos.Neos/webpack.styles.config.js b/Neos.Neos/webpack.styles.config.js index 15fc8667b8f..c877b20fa76 100644 --- a/Neos.Neos/webpack.styles.config.js +++ b/Neos.Neos/webpack.styles.config.js @@ -6,7 +6,7 @@ const stylesConfig = { context: __dirname, devtool: "source-map", entry: { - Main: ["./Resources/Private/Styles/Neos.scss"], + Main: ["./Resources/Private/Styles/Main.scss"], Lite: ["./Resources/Private/Styles/Lite.scss"], Minimal: ["./Resources/Private/Styles/Minimal.scss"], Login: ["./Resources/Private/Styles/Login.scss"], From 07d750591b462fa2370c85cba2b9678c017c714e Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Tue, 31 Oct 2023 09:54:31 +0100 Subject: [PATCH 075/113] 4610 - save thered nodes from disallowedChildnodes structure adjustments --- ...sallowedChildNodesAndTetheredNodes.feature | 49 +++++++++++++++++++ .../DisallowedChildNodeAdjustment.php | 3 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNodesAndTetheredNodes.feature diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNodesAndTetheredNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNodesAndTetheredNodes.feature new file mode 100644 index 00000000000..9dc7063bf5d --- /dev/null +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNodesAndTetheredNodes.feature @@ -0,0 +1,49 @@ +@contentrepository @adapters=DoctrineDBAL +Feature: Remove disallowed Child Nodes and grandchild nodes + + As a user of the CR I want to be able to keep tethered child nodes although their type is not allowed below their parent + + Scenario: Direct constraints + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository:Root': + constraints: + nodeTypes: + '*': false + 'Neos.ContentRepository.Testing:Document': true + 'Neos.ContentRepository.Testing:Document': + constraints: + nodeTypes: + '*': false + childNodes: + tethered: + type: 'Neos.ContentRepository.Testing:AnotherDocument' + + 'Neos.ContentRepository.Testing:AnotherDocument': [] + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" and dimension space point {} + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + And the graph projection is fully up to date + And the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | parentNodeAggregateId | nodeTypeName | + | nody-mc-nodeface | lady-eleonode-rootford | Neos.ContentRepository.Testing:Document | + + ######################## + # Actual Test + ######################## + Then I expect no needed structure adjustments for type "Neos.ContentRepository:Root" + Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document" + Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:AnotherDocument" diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php index d19b762ace8..1111146fc21 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php @@ -67,7 +67,8 @@ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generat if ($parentNode !== null) { if ($this->nodeTypeManager->hasNodeType($parentNode->nodeTypeName)) { $parentNodeType = $this->nodeTypeManager->getNodeType($parentNode->nodeTypeName); - $allowedByParent = $parentNodeType->allowsChildNodeType($nodeType); + $allowedByParent = $parentNodeType->allowsChildNodeType($nodeType) + || $nodeAggregate->nodeName && $parentNodeType->hasTetheredNode($nodeAggregate->nodeName); } } From d9ea8cae1d8f0fd8b8ceb6fa60e8d1361143c0d3 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:31:22 +0100 Subject: [PATCH 076/113] TASK: Move Shortcut.css from Ui to Neos --- .../Private/Fusion/Prototypes/Shortcut.fusion | 27 ++++++++++----- .../Resources/Private/Fusion/RootCase.fusion | 8 ++--- .../Resources/Private/Styles/Shortcut.scss | 32 ++++++++++++++++++ .../Resources/Private/Styles/_Global.scss | 33 ------------------- .../Resources/Public/Styles/Shortcut.css | 1 + Neos.Neos/webpack.styles.config.js | 1 + 6 files changed, 55 insertions(+), 47 deletions(-) create mode 100644 Neos.Neos/Resources/Private/Styles/Shortcut.scss create mode 100644 Neos.Neos/Resources/Public/Styles/Shortcut.css diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion index 4224aa85e23..7ffe67d67e5 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion @@ -1,6 +1,23 @@ # Neos.Neos.Shortcut is given a representation for editing purposes # -prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { +prototype(Neos.Neos:Shortcut) < prototype(Neos.Neos:Page) { + head.stylesheets { + shortcut = afx` + <link rel="stylesheet" href={StaticResource.uri('Neos.Neos', 'Public/Styles/Shortcut.css')} /> + ` + } + + body = afx` + <div id="neos-shortcut"> + <p> + <Neos.Neos:Shortcut.Link /> + </p> + </div> + ` +} + +/** @internal */ +prototype(Neos.Neos:Shortcut.Link) < prototype(Neos.Fusion:Component) { targetMode = ${q(node).property('targetMode')} firstChildNode = ${q(node).children('[instanceof Neos.Neos:Document]').get(0)} target = ${q(node).property('target')} @@ -68,14 +85,6 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) { } } - renderer.@process.contentWrap = afx` - <div id="neos-shortcut"> - <p> - {value} - </p> - </div> - ` - @cache { mode = "uncached" context { diff --git a/Neos.Neos/Resources/Private/Fusion/RootCase.fusion b/Neos.Neos/Resources/Private/Fusion/RootCase.fusion index ea6596c38e7..7a7f304c411 100644 --- a/Neos.Neos/Resources/Private/Fusion/RootCase.fusion +++ b/Neos.Neos/Resources/Private/Fusion/RootCase.fusion @@ -6,13 +6,11 @@ root = Neos.Fusion:Case root { shortcut { - prototype(Neos.Neos:Page) { - body = Neos.Neos:Shortcut - } - + # this code path will only be taken for backend views, as the node controller + # will take care of resolving the shortcut in the frontend @position = 'start' condition = ${q(node).is('[instanceof Neos.Neos:Shortcut]')} - type = 'Neos.Neos:Page' + renderer = Neos.Neos:Shortcut } editPreviewMode { diff --git a/Neos.Neos/Resources/Private/Styles/Shortcut.scss b/Neos.Neos/Resources/Private/Styles/Shortcut.scss new file mode 100644 index 00000000000..5a80bb6f8bb --- /dev/null +++ b/Neos.Neos/Resources/Private/Styles/Shortcut.scss @@ -0,0 +1,32 @@ +#neos-shortcut { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: $grayMedium; + z-index: 9999; + @include font; + + p { + position: relative; + margin: 0 auto; + width: 500px; + height: 60px; + top: 50%; + margin-top: -30px; + color: #fff; + font-size: 22px; + line-height: 1.4; + text-align: center; + + a { + color: $blue; + text-decoration: none; + + &:hover { + color: $blueLight; + } + } + } +} diff --git a/Neos.Neos/Resources/Private/Styles/_Global.scss b/Neos.Neos/Resources/Private/Styles/_Global.scss index 76d8bea161c..b44a7102229 100644 --- a/Neos.Neos/Resources/Private/Styles/_Global.scss +++ b/Neos.Neos/Resources/Private/Styles/_Global.scss @@ -5,36 +5,3 @@ .neos-rendering-exception { word-wrap: break-word; } - -#neos-shortcut { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: $grayMedium; - z-index: 9999; - @include font; - - p { - position: relative; - margin: 0 auto; - width: 500px; - height: 60px; - top: 50%; - margin-top: -30px; - color: #fff; - font-size: 22px; - line-height: 1.4; - text-align: center; - - a { - color: $blue; - text-decoration: none; - - &:hover { - color: $blueLight; - } - } - } -} diff --git a/Neos.Neos/Resources/Public/Styles/Shortcut.css b/Neos.Neos/Resources/Public/Styles/Shortcut.css new file mode 100644 index 00000000000..4b7c4b242cf --- /dev/null +++ b/Neos.Neos/Resources/Public/Styles/Shortcut.css @@ -0,0 +1 @@ +#neos-shortcut {position: fixed;top: 0;left: 0;width: 100%;height: 100%;background-color: #323232;z-index: 9999;font-family: "Noto Sans", sans-serif;-webkit-font-smoothing: antialiased;}#neos-shortcut p {position: relative;margin: 0 auto;width: 500px;height: 60px;top: 50%;margin-top: -30px;color: #fff;font-size: 22px;line-height: 1.4;text-align: center;}#neos-shortcut p a {color: #00b5ff;text-decoration: none;}#neos-shortcut p a:hover {color: #39c6ff;} diff --git a/Neos.Neos/webpack.styles.config.js b/Neos.Neos/webpack.styles.config.js index c877b20fa76..057d95fecd5 100644 --- a/Neos.Neos/webpack.styles.config.js +++ b/Neos.Neos/webpack.styles.config.js @@ -13,6 +13,7 @@ const stylesConfig = { Error: ["./Resources/Private/Styles/Error.scss"], RawContentMode: ["./Resources/Private/Styles/RawContentMode.scss"], Welcome: ["./Resources/Private/Styles/Welcome.scss"], + Shortcut: ["./Resources/Private/Styles/Shortcut.scss"], }, output: { path: __dirname + "/Resources/Public/Styles", From 9c8f3077b337ae38556d43cbd75142ee1484944a Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Tue, 31 Oct 2023 15:03:57 +0100 Subject: [PATCH 077/113] 4663 - Support tethered children for root nodes --- ...TetheredChildren_WithoutDimensions.feature | 164 ++++++++++ ...AndTetheredChildren_WithDimensions.feature | 293 ++++++++++++++++++ ...eAggregateWithNode_WithDimensions.feature} | 0 .../Feature/NodeCreation/NodeCreation.php | 1 - .../CreateRootNodeAggregateWithNode.php | 61 +++- .../RootNodeCreation/RootNodeHandling.php | 112 ++++++- .../Bootstrap/Features/NodeCreation.php | 3 + 7 files changed, 624 insertions(+), 10 deletions(-) create mode 100644 Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithoutDimensions.feature create mode 100644 Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/04-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithDimensions.feature rename Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/{03-CreateRootNodeAggregateWithNode_WithDimensions.feature => 05-CreateRootNodeAggregateWithNode_WithDimensions.feature} (100%) diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithoutDimensions.feature new file mode 100644 index 00000000000..7678cbc51e4 --- /dev/null +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithoutDimensions.feature @@ -0,0 +1,164 @@ +@contentrepository @adapters=DoctrineDBAL +Feature: Create a root node aggregate with tethered children + + As a user of the CR I want to create a new root node aggregate with an initial node and tethered children. + + These are the test cases without dimensions involved + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:SubSubNode': + properties: + text: + defaultValue: 'my sub sub default' + type: string + 'Neos.ContentRepository.Testing:SubNode': + childNodes: + grandchild-node: + type: 'Neos.ContentRepository.Testing:SubSubNode' + properties: + text: + defaultValue: 'my sub default' + type: string + 'Neos.ContentRepository.Testing:RootWithTetheredChildNodes': + superTypes: + 'Neos.ContentRepository:Root': true + childNodes: + child-node: + type: 'Neos.ContentRepository.Testing:SubNode' + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" + And I am in dimension space point {} + And I am user identified by "initiating-user-identifier" + + Scenario: Create root node with tethered children + When the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" | + | tetheredDescendantNodeAggregateIds | {"child-node": "nody-mc-nodeface", "child-node/grandchild-node": "nodimus-prime"} | + And the graph projection is fully up to date + + Then I expect exactly 4 events to be published on stream "ContentStream:cs-identifier" + And event at index 1 is of type "RootNodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" | + | coveredDimensionSpacePoints | [[]] | + | nodeAggregateClassification | "root" | + And event at index 2 is of type "NodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nody-mc-nodeface" | + | nodeTypeName | "Neos.ContentRepository.Testing:SubNode" | + | originDimensionSpacePoint | [] | + | coveredDimensionSpacePoints | [[]] | + | parentNodeAggregateId | "lady-eleonode-rootford" | + | nodeName | "child-node" | + | initialPropertyValues | {"text": {"value": "my sub default", "type": "string"}} | + | nodeAggregateClassification | "tethered" | + And event at index 3 is of type "NodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nodimus-prime" | + | nodeTypeName | "Neos.ContentRepository.Testing:SubSubNode" | + | originDimensionSpacePoint | [] | + | coveredDimensionSpacePoints | [[]] | + | parentNodeAggregateId | "nody-mc-nodeface" | + | nodeName | "grandchild-node" | + | initialPropertyValues | {"text": {"value": "my sub sub default", "type": "string"}} | + | nodeAggregateClassification | "tethered" | + + And I expect the node aggregate "lady-eleonode-rootford" to exist + And I expect this node aggregate to be classified as "root" + And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" + And I expect this node aggregate to be unnamed + And I expect this node aggregate to occupy dimension space points [[]] + And I expect this node aggregate to cover dimension space points [[]] + And I expect this node aggregate to disable dimension space points [] + And I expect this node aggregate to have no parent node aggregates + And I expect this node aggregate to have the child node aggregates ["nody-mc-nodeface"] + + And I expect the node aggregate "nody-mc-nodeface" to exist + And I expect this node aggregate to be classified as "tethered" + And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubNode" + And I expect this node aggregate to be named "child-node" + And I expect this node aggregate to occupy dimension space points [[]] + And I expect this node aggregate to cover dimension space points [[]] + And I expect this node aggregate to disable dimension space points [] + And I expect this node aggregate to have the parent node aggregates ["lady-eleonode-rootford"] + And I expect this node aggregate to have the child node aggregates ["nodimus-prime"] + + And I expect the node aggregate "nodimus-prime" to exist + And I expect this node aggregate to be classified as "tethered" + And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubSubNode" + And I expect this node aggregate to be named "grandchild-node" + And I expect this node aggregate to occupy dimension space points [[]] + And I expect this node aggregate to cover dimension space points [[]] + And I expect this node aggregate to disable dimension space points [] + And I expect this node aggregate to have the parent node aggregates ["nody-mc-nodeface"] + And I expect this node aggregate to have no child node aggregates + + And I expect the graph projection to consist of exactly 3 nodes + And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph + And I expect this node to be classified as "root" + And I expect this node to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" + And I expect this node to be unnamed + And I expect this node to have no properties + + And I expect a node identified by cs-identifier;nody-mc-nodeface;{} to exist in the content graph + And I expect this node to be classified as "tethered" + And I expect this node to be of type "Neos.ContentRepository.Testing:SubNode" + And I expect this node to be named "child-node" + And I expect this node to have the following properties: + | Key | Value | + | text | "my sub default" | + + And I expect a node identified by cs-identifier;nodimus-prime;{} to exist in the content graph + And I expect this node to be classified as "tethered" + And I expect this node to be of type "Neos.ContentRepository.Testing:SubSubNode" + And I expect this node to be named "grandchild-node" + And I expect this node to have the following properties: + | Key | Value | + | text | "my sub sub default" | + + When I am in content stream "cs-identifier" and dimension space point [] + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have no parent node + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | child-node | cs-identifier;nody-mc-nodeface;{} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{} + And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | grandchild-node | cs-identifier;nodimus-prime;{} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{} + And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{} + And I expect this node to have no child nodes + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/04-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/04-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithDimensions.feature new file mode 100644 index 00000000000..cf15c9682e6 --- /dev/null +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/04-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithDimensions.feature @@ -0,0 +1,293 @@ +@contentrepository @adapters=DoctrineDBAL +Feature: Create a root node aggregate with tethered children + + As a user of the CR I want to create a new root node aggregate with an initial node and tethered children. + + These are the test cases with dimensions involved + + Background: + Given using the following content dimensions: + | Identifier | Values | Generalizations | + | language | de, en, gsw, en_US | en_US->en, gsw->de | + And using the following node types: + """yaml + 'Neos.ContentRepository.Testing:SubSubNode': + properties: + text: + defaultValue: 'my sub sub default' + type: string + 'Neos.ContentRepository.Testing:SubNode': + childNodes: + grandchild-node: + type: 'Neos.ContentRepository.Testing:SubSubNode' + properties: + text: + defaultValue: 'my sub default' + type: string + 'Neos.ContentRepository.Testing:RootWithTetheredChildNodes': + superTypes: + 'Neos.ContentRepository:Root': true + childNodes: + child-node: + type: 'Neos.ContentRepository.Testing:SubNode' + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + And the graph projection is fully up to date + And I am in content stream "cs-identifier" + And I am user identified by "initiating-user-identifier" + + Scenario: Create root node with tethered children + When the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" | + | tetheredDescendantNodeAggregateIds | {"child-node": "nody-mc-nodeface", "child-node/grandchild-node": "nodimus-prime"} | + And the graph projection is fully up to date + + Then I expect exactly 6 events to be published on stream "ContentStream:cs-identifier" + And event at index 1 is of type "RootNodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" | + | coveredDimensionSpacePoints | [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}] | + | nodeAggregateClassification | "root" | + And event at index 2 is of type "NodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nody-mc-nodeface" | + | nodeTypeName | "Neos.ContentRepository.Testing:SubNode" | + | originDimensionSpacePoint | {"language": "de"} | + | coveredDimensionSpacePoints | [{"language": "de"},{"language": "gsw"}] | + | parentNodeAggregateId | "lady-eleonode-rootford" | + | nodeName | "child-node" | + | initialPropertyValues | {"text": {"value": "my sub default", "type": "string"}} | + | nodeAggregateClassification | "tethered" | + And event at index 3 is of type "NodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nodimus-prime" | + | nodeTypeName | "Neos.ContentRepository.Testing:SubSubNode" | + | originDimensionSpacePoint | {"language": "de"} | + | coveredDimensionSpacePoints | [{"language": "de"},{"language": "gsw"}] | + | parentNodeAggregateId | "nody-mc-nodeface" | + | nodeName | "grandchild-node" | + | initialPropertyValues | {"text": {"value": "my sub sub default", "type": "string"}} | + | nodeAggregateClassification | "tethered" | + And event at index 4 is of type "NodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nody-mc-nodeface" | + | nodeTypeName | "Neos.ContentRepository.Testing:SubNode" | + | originDimensionSpacePoint | {"language": "en"} | + | coveredDimensionSpacePoints | [{"language": "en"},{"language": "en_US"}] | + | parentNodeAggregateId | "lady-eleonode-rootford" | + | nodeName | "child-node" | + | initialPropertyValues | {"text": {"value": "my sub default", "type": "string"}} | + | nodeAggregateClassification | "tethered" | + And event at index 5 is of type "NodeAggregateWithNodeWasCreated" with payload: + | Key | Expected | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nodimus-prime" | + | nodeTypeName | "Neos.ContentRepository.Testing:SubSubNode" | + | originDimensionSpacePoint | {"language": "en"} | + | coveredDimensionSpacePoints | [{"language": "en"},{"language": "en_US"}] | + | parentNodeAggregateId | "nody-mc-nodeface" | + | nodeName | "grandchild-node" | + | initialPropertyValues | {"text": {"value": "my sub sub default", "type": "string"}} | + | nodeAggregateClassification | "tethered" | + + And I expect the node aggregate "lady-eleonode-rootford" to exist + And I expect this node aggregate to be classified as "root" + And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" + And I expect this node aggregate to be unnamed + And I expect this node aggregate to occupy dimension space points [{}] + And I expect this node aggregate to cover dimension space points [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}] + And I expect this node aggregate to disable dimension space points [] + And I expect this node aggregate to have no parent node aggregates + And I expect this node aggregate to have the child node aggregates ["nody-mc-nodeface"] + + And I expect the node aggregate "nody-mc-nodeface" to exist + And I expect this node aggregate to be classified as "tethered" + And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubNode" + And I expect this node aggregate to be named "child-node" + And I expect this node aggregate to occupy dimension space points [{"language": "de"}, {"language": "en"}] + And I expect this node aggregate to cover dimension space points [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}] + And I expect this node aggregate to disable dimension space points [] + And I expect this node aggregate to have the parent node aggregates ["lady-eleonode-rootford"] + And I expect this node aggregate to have the child node aggregates ["nodimus-prime"] + + And I expect the node aggregate "nodimus-prime" to exist + And I expect this node aggregate to be classified as "tethered" + And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubSubNode" + And I expect this node aggregate to be named "grandchild-node" + And I expect this node aggregate to occupy dimension space points [{"language": "de"}, {"language": "en"}] + And I expect this node aggregate to cover dimension space points [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}] + And I expect this node aggregate to disable dimension space points [] + And I expect this node aggregate to have the parent node aggregates ["nody-mc-nodeface"] + And I expect this node aggregate to have no child node aggregates + + And I expect the graph projection to consist of exactly 5 nodes + And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph + And I expect this node to be classified as "root" + And I expect this node to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" + And I expect this node to be unnamed + And I expect this node to have no properties + + And I expect a node identified by cs-identifier;nody-mc-nodeface;{"language": "de"} to exist in the content graph + And I expect this node to be classified as "tethered" + And I expect this node to be of type "Neos.ContentRepository.Testing:SubNode" + And I expect this node to be named "child-node" + And I expect this node to have the following properties: + | Key | Value | + | text | "my sub default" | + + And I expect a node identified by cs-identifier;nody-mc-nodeface;{"language": "en"} to exist in the content graph + And I expect this node to be classified as "tethered" + And I expect this node to be of type "Neos.ContentRepository.Testing:SubNode" + And I expect this node to be named "child-node" + And I expect this node to have the following properties: + | Key | Value | + | text | "my sub default" | + + And I expect a node identified by cs-identifier;nodimus-prime;{"language": "de"} to exist in the content graph + And I expect this node to be classified as "tethered" + And I expect this node to be of type "Neos.ContentRepository.Testing:SubSubNode" + And I expect this node to be named "grandchild-node" + And I expect this node to have the following properties: + | Key | Value | + | text | "my sub sub default" | + + And I expect a node identified by cs-identifier;nodimus-prime;{"language": "en"} to exist in the content graph + And I expect this node to be classified as "tethered" + And I expect this node to be of type "Neos.ContentRepository.Testing:SubSubNode" + And I expect this node to be named "grandchild-node" + And I expect this node to have the following properties: + | Key | Value | + | text | "my sub sub default" | + + When I am in content stream "cs-identifier" and dimension space point {"language": "de"} + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have no parent node + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | child-node | cs-identifier;nody-mc-nodeface;{"language": "de"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "de"} + And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | grandchild-node | cs-identifier;nodimus-prime;{"language": "de"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "de"} + And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "de"} + And I expect this node to have no child nodes + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + When I am in content stream "cs-identifier" and dimension space point {"language": "gsw"} + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have no parent node + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | child-node | cs-identifier;nody-mc-nodeface;{"language": "de"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "de"} + And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | grandchild-node | cs-identifier;nodimus-prime;{"language": "de"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "de"} + And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "de"} + And I expect this node to have no child nodes + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + + When I am in content stream "cs-identifier" and dimension space point {"language": "en"} + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have no parent node + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | child-node | cs-identifier;nody-mc-nodeface;{"language": "en"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "en"} + And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | grandchild-node | cs-identifier;nodimus-prime;{"language": "en"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "en"} + And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "en"} + And I expect this node to have no child nodes + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + + When I am in content stream "cs-identifier" and dimension space point {"language": "en_US"} + And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have no parent node + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | child-node | cs-identifier;nody-mc-nodeface;{"language": "en"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "en"} + And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | grandchild-node | cs-identifier;nodimus-prime;{"language": "en"} | + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + + And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "en"} + And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "en"} + And I expect this node to have no child nodes + And I expect this node to have no preceding siblings + And I expect this node to have no succeeding siblings + And I expect this node to have no references + And I expect this node to not be referenced + diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNode_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/05-CreateRootNodeAggregateWithNode_WithDimensions.feature similarity index 100% rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNode_WithDimensions.feature rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/05-CreateRootNodeAggregateWithNode_WithDimensions.feature diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php index 739a7b38a5c..07c0518e54b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php @@ -222,7 +222,6 @@ private function handleCreateNodeAggregateWithNodeAndSerializedProperties( ); } - $defaultPropertyValues = SerializedPropertyValues::defaultFromNodeType($nodeType); $initialPropertyValues = $defaultPropertyValues->merge($command->initialPropertyValues); diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php index ec57b71854f..0e2ceab99de 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php @@ -16,6 +16,7 @@ use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -28,7 +29,7 @@ * * @api commands are the write-API of the ContentRepository */ -final class CreateRootNodeAggregateWithNode implements +final readonly class CreateRootNodeAggregateWithNode implements CommandInterface, \JsonSerializable, RebasableToOtherContentStreamsInterface @@ -37,11 +38,13 @@ final class CreateRootNodeAggregateWithNode implements * @param ContentStreamId $contentStreamId The content stream in which the root node should be created in * @param NodeAggregateId $nodeAggregateId The id of the root node aggregate to create * @param NodeTypeName $nodeTypeName Name of type of the new node to create + * @param NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds Predefined aggregate ids of tethered child nodes per path. For any tethered node that has no matching entry in this set, the node aggregate id is generated randomly. Since tethered nodes may have tethered child nodes themselves, this works for multiple levels ({@see self::withTetheredDescendantNodeAggregateIds()}) */ private function __construct( - public readonly ContentStreamId $contentStreamId, - public readonly NodeAggregateId $nodeAggregateId, - public readonly NodeTypeName $nodeTypeName, + public ContentStreamId $contentStreamId, + public NodeAggregateId $nodeAggregateId, + public NodeTypeName $nodeTypeName, + public NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds, ) { } @@ -52,12 +55,54 @@ private function __construct( */ public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName): self { - return new self($contentStreamId, $nodeAggregateId, $nodeTypeName); + return new self( + $contentStreamId, + $nodeAggregateId, + $nodeTypeName, + NodeAggregateIdsByNodePaths::createEmpty() + ); } + /** + * Specify explicitly the node aggregate ids for the tethered children {@see tetheredDescendantNodeAggregateIds}. + * + * In case you want to create a batch of commands where one creates the root node and a succeeding command needs + * a tethered node aggregate id, you need to generate the child node aggregate ids in advance. + * + * _Alternatively you would need to fetch the created tethered node first from the subgraph. + * {@see ContentSubgraphInterface::findChildNodeConnectedThroughEdgeName()}_ + * + * The helper method {@see NodeAggregateIdsByNodePaths::createForNodeType()} will generate recursively + * node aggregate ids for every tethered child node: + * + * ```php + * $tetheredDescendantNodeAggregateIds = NodeAggregateIdsByNodePaths::createForNodeType( + * $command->nodeTypeName, + * $nodeTypeManager + * ); + * $command = $command->withTetheredDescendantNodeAggregateIds($tetheredDescendantNodeAggregateIds): + * ``` + * + * The generated node aggregate id for the tethered node "main" is this way known before the command is issued: + * + * ```php + * $mainNodeAggregateId = $command->tetheredDescendantNodeAggregateIds->getNodeAggregateId(NodePath::fromString('main')); + * ``` + * + * Generating the node aggregate ids from user land is totally optional. + */ + public function withTetheredDescendantNodeAggregateIds(NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds): self + { + return new self( + $this->contentStreamId, + $this->nodeAggregateId, + $this->nodeTypeName, + $tetheredDescendantNodeAggregateIds, + ); + } /** - * @param array<string,string> $array + * @param array<string,mixed> $array */ public static function fromArray(array $array): self { @@ -65,6 +110,9 @@ public static function fromArray(array $array): self ContentStreamId::fromString($array['contentStreamId']), NodeAggregateId::fromString($array['nodeAggregateId']), NodeTypeName::fromString($array['nodeTypeName']), + isset($array['tetheredDescendantNodeAggregateIds']) + ? NodeAggregateIdsByNodePaths::fromArray($array['tetheredDescendantNodeAggregateIds']) + : NodeAggregateIdsByNodePaths::createEmpty() ); } @@ -82,6 +130,7 @@ public function createCopyForContentStream(ContentStreamId $target): self $target, $this->nodeAggregateId, $this->nodeTypeName, + $this->tetheredDescendantNodeAggregateIds ); } } diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php index 844f63f7c24..20de19bc5c6 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php @@ -16,13 +16,18 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; +use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; +use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths; +use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; +use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateDimensionsWereUpdated; use Neos\ContentRepository\Core\NodeType\NodeType; use Neos\ContentRepository\Core\NodeType\NodeTypeName; +use Neos\ContentRepository\Core\Projection\ContentGraph\NodePath; use Neos\ContentRepository\Core\SharedModel\Exception\ContentStreamDoesNotExistYet; use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregateIsNotRoot; use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregatesTypeIsAmbiguous; @@ -31,8 +36,11 @@ use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFound; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated; +use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFoundException; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepository\Core\Feature\Common\NodeAggregateEventPublisher; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; +use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\EventStore\Model\EventStream\ExpectedVersion; /** @@ -76,12 +84,33 @@ private function handleCreateRootNodeAggregateWithNode( $contentRepository ); - $events = Events::with( + $descendantNodeAggregateIds = $command->tetheredDescendantNodeAggregateIds->completeForNodeOfType( + $command->nodeTypeName, + $this->nodeTypeManager + ); + // Write the auto-created descendant node aggregate ids back to the command; + // so that when rebasing the command, it stays fully deterministic. + $command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds); + + $events = [ $this->createRootWithNode( $command, $this->getAllowedDimensionSubspace() ) - ); + ]; + + foreach ($this->getInterDimensionalVariationGraph()->getRootGeneralizations() as $rootGeneralization) { + array_push($events, ...iterator_to_array($this->handleTetheredRootChildNodes( + $command, + $nodeType, + OriginDimensionSpacePoint::fromDimensionSpacePoint($rootGeneralization), + $this->getInterDimensionalVariationGraph()->getSpecializationSet($rootGeneralization, true), + $command->nodeAggregateId, + $command->tetheredDescendantNodeAggregateIds, + null, + $contentRepository + ))); + } $contentStreamEventStream = ContentStreamEventStreamName::fromContentStreamId( $command->contentStreamId @@ -90,7 +119,7 @@ private function handleCreateRootNodeAggregateWithNode( $contentStreamEventStream->getEventStreamName(), NodeAggregateEventPublisher::enrichWithCommand( $command, - $events + Events::fromArray($events) ), ExpectedVersion::ANY() ); @@ -147,4 +176,81 @@ private function handleUpdateRootNodeAggregateDimensions( ExpectedVersion::ANY() ); } + + /** + * @throws ContentStreamDoesNotExistYet + * @throws NodeTypeNotFoundException + */ + private function handleTetheredRootChildNodes( + CreateRootNodeAggregateWithNode $command, + NodeType $nodeType, + OriginDimensionSpacePoint $originDimensionSpacePoint, + DimensionSpacePointSet $coveredDimensionSpacePoints, + NodeAggregateId $parentNodeAggregateId, + NodeAggregateIdsByNodePaths $nodeAggregateIdsByNodePath, + ?NodePath $nodePath, + ContentRepository $contentRepository, + ): Events { + $events = []; + foreach ($this->getNodeTypeManager()->getTetheredNodesConfigurationForNodeType($nodeType) as $rawNodeName => $childNodeType) { + assert($childNodeType instanceof NodeType); + $nodeName = NodeName::fromString($rawNodeName); + $childNodePath = $nodePath + ? $nodePath->appendPathSegment($nodeName) + : NodePath::fromString($nodeName->value); + $childNodeAggregateId = $nodeAggregateIdsByNodePath->getNodeAggregateId($childNodePath) + ?? NodeAggregateId::create(); + $initialPropertyValues = SerializedPropertyValues::defaultFromNodeType($childNodeType); + + $this->requireContentStreamToExist($command->contentStreamId, $contentRepository); + $events[] = $this->createTetheredWithNodeForRoot( + $command, + $childNodeAggregateId, + $childNodeType->name, + $originDimensionSpacePoint, + $coveredDimensionSpacePoints, + $parentNodeAggregateId, + $nodeName, + $initialPropertyValues + ); + + array_push($events, ...iterator_to_array($this->handleTetheredRootChildNodes( + $command, + $childNodeType, + $originDimensionSpacePoint, + $coveredDimensionSpacePoints, + $childNodeAggregateId, + $nodeAggregateIdsByNodePath, + $childNodePath, + $contentRepository + ))); + } + + return Events::fromArray($events); + } + + private function createTetheredWithNodeForRoot( + CreateRootNodeAggregateWithNode $command, + NodeAggregateId $nodeAggregateId, + NodeTypeName $nodeTypeName, + OriginDimensionSpacePoint $originDimensionSpacePoint, + DimensionSpacePointSet $coveredDimensionSpacePoints, + NodeAggregateId $parentNodeAggregateId, + NodeName $nodeName, + SerializedPropertyValues $initialPropertyValues, + NodeAggregateId $precedingNodeAggregateId = null + ): NodeAggregateWithNodeWasCreated { + return new NodeAggregateWithNodeWasCreated( + $command->contentStreamId, + $nodeAggregateId, + $nodeTypeName, + $originDimensionSpacePoint, + $coveredDimensionSpacePoints, + $parentNodeAggregateId, + $nodeName, + $initialPropertyValues, + NodeAggregateClassification::CLASSIFICATION_TETHERED, + $precedingNodeAggregateId + ); + } } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php index 9d7eb8ee253..41f04d7afff 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php @@ -64,6 +64,9 @@ public function theCommandCreateRootNodeAggregateWithNodeIsExecutedWithPayload(T $nodeAggregateId, NodeTypeName::fromString($commandArguments['nodeTypeName']), ); + if (isset($commandArguments['tetheredDescendantNodeAggregateIds'])) { + $command = $command->withTetheredDescendantNodeAggregateIds(NodeAggregateIdsByNodePaths::fromArray($commandArguments['tetheredDescendantNodeAggregateIds'])); + } $this->lastCommandOrEventResult = $this->currentContentRepository->handle($command); $this->currentRootNodeAggregateId = $nodeAggregateId; From 42f3d5e3939990b51e52d52cf1549933c072916f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= <christian@flownative.com> Date: Tue, 31 Oct 2023 16:07:24 +0100 Subject: [PATCH 078/113] FEATURE: Add `Neos.Node.subgraphForNode()` to EEL helper Helps migration and usage in Fusion. Fixes: #4232 --- Neos.Neos/Classes/Fusion/Helper/NodeHelper.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php b/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php index 54384747a8b..906d9c2ebb7 100644 --- a/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/NodeHelper.php @@ -16,6 +16,7 @@ use Neos\ContentRepository\Core\NodeType\NodeType; use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath; +use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\NodePath; @@ -150,6 +151,11 @@ public function serializedNodeAddress(Node $node): string return $nodeAddressFactory->createFromNode($node)->serializeForUri(); } + public function subgraphForNode(Node $node): ContentSubgraphInterface + { + return $this->contentRepositoryRegistry->subgraphForNode($node); + } + /** * @param string $methodName * @return boolean From 7fde45256fc7dad1baa4522022d82351def7bfa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= <christian@flownative.com> Date: Tue, 31 Oct 2023 16:42:38 +0100 Subject: [PATCH 079/113] TASK: All dependencies within collection point to `self.version` Re-adjusts dependencies to point to self.version for easier maintenance. Fixes: #4257 --- Neos.Neos/composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Neos.Neos/composer.json b/Neos.Neos/composer.json index 5ef62092daa..92588751cda 100644 --- a/Neos.Neos/composer.json +++ b/Neos.Neos/composer.json @@ -7,17 +7,17 @@ "description": "An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.", "require": { "php": "^7.3 || ^8.0", - "neos/diff": "~7.3.0", + "neos/diff": "self.version", "neos/flow": "~7.3.0", - "neos/media-browser": "~7.3.0", + "neos/media-browser": "self.version", "neos/party": "*", "neos/twitter-bootstrap": "*", - "neos/content-repository": "~7.3.0", - "neos/fusion": "~7.3.0", + "neos/content-repository": "self.version", + "neos/fusion": "self.version", "neos/fusion-afx": "self.version", "neos/fusion-form": "^1.0 || ^2.0", "neos/fluid-adaptor": "~7.3.0", - "neos/media": "~7.3.0", + "neos/media": "self.version", "behat/transliterator": "~1.0" }, "suggest": { From ebd304d82e71907ba3c5e45ef161d0ce1439419d Mon Sep 17 00:00:00 2001 From: bwaidelich <b.waidelich@wwwision.de> Date: Tue, 31 Oct 2023 16:53:28 +0100 Subject: [PATCH 080/113] TASK: Static Node constructor This is a follow-up to #4318 that makes the constructor of the `Node` read model private in favor of a new static `create` constructor. Background: Adding the `@internal` annotation to the constructor marked all promoted properties internal, too. Additionally, a named constructor gives us more options to adjust this class without breaking changes --- .../src/Domain/Repository/NodeFactory.php | 2 +- .../src/Domain/Repository/NodeFactory.php | 2 +- .../Classes/Projection/ContentGraph/Node.php | 49 +++++++------------ .../Classes/Unit/NodeSubjectProvider.php | 2 +- .../Functional/Fusion/NodeHelperTest.php | 2 +- 5 files changed, 22 insertions(+), 35 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php index 0ac6f2e1aad..c93abc75f93 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php @@ -67,7 +67,7 @@ public function mapNodeRowToNode( ? $this->nodeTypeManager->getNodeType($nodeRow['nodetypename']) : null; - return new Node( + return Node::create( ContentSubgraphIdentity::create( $this->contentRepositoryId, ContentStreamId::fromString($nodeRow['contentstreamid']), diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php index 797c0001b0e..894b86cc3b2 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php @@ -75,7 +75,7 @@ public function mapNodeRowToNode( ? $this->nodeTypeManager->getNodeType($nodeRow['nodetypename']) : null; - return new Node( + return Node::create( ContentSubgraphIdentity::create( $this->contentRepositoryId, $contentStreamId ?: ContentStreamId::fromString($nodeRow['contentstreamid']), diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php index 6d2e63d2037..d29f4191ec9 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php @@ -37,50 +37,37 @@ final readonly class Node { /** - * @internal + * @param ContentSubgraphIdentity $subgraphIdentity This is part of the node's "Read Model" identity which is defined by: {@see self::subgraphIdentity} and {@see self::nodeAggregateId} + * @param NodeAggregateId $nodeAggregateId NodeAggregateId (identifier) of this node. This is part of the node's "Read Model" identity which is defined by: {@see self::subgraphIdentity} and {@see self::nodeAggregateId} + * @param OriginDimensionSpacePoint $originDimensionSpacePoint The DimensionSpacePoint the node originates in. Usually needed to address a Node in a NodeAggregate in order to update it. + * @param NodeAggregateClassification $classification The classification (regular, root, tethered) of this node + * @param NodeTypeName $nodeTypeName The node's node type name; always set, even if unknown to the NodeTypeManager + * @param NodeType|null $nodeType The node's node type, null if unknown to the NodeTypeManager - @deprecated Don't rely on this too much, as the capabilities of the NodeType here will probably change a lot; Ask the {@see NodeTypeManager} instead + * @param PropertyCollection $properties All properties of this node. References are NOT part of this API; To access references, {@see ContentSubgraphInterface::findReferences()} can be used; To read the serialized properties, call properties->serialized(). + * @param NodeName|null $nodeName The optional name of this node {@see ContentSubgraphInterface::findChildNodeConnectedThroughEdgeName()} + * @param Timestamps $timestamps Creation and modification timestamps of this node */ - public function __construct( + private function __construct( public ContentSubgraphIdentity $subgraphIdentity, - /** - * NodeAggregateId (identifier) of this node - * This is part of the node's "Read Model" identity, whis is defined by: - * - {@see getSubgraphIdentitity} - * - {@see getNodeAggregateId} (this method) - * - * With the above information, you can fetch a Subgraph using {@see ContentGraphInterface::getSubgraph()}. - * or {@see \Neos\ContentRepositoryRegistry\ContentRepositoryRegistry::subgraphForNode()} - */ public NodeAggregateId $nodeAggregateId, - /** - * returns the DimensionSpacePoint the node is at home in. Usually needed to address a Node in a NodeAggregate - * in order to update it. - */ public OriginDimensionSpacePoint $originDimensionSpacePoint, public NodeAggregateClassification $classification, - /** - * The node's node type name; always set, even if unknown to the NodeTypeManager - */ public NodeTypeName $nodeTypeName, - /** - * The node's node type, null if unknown to the NodeTypeManager - * @deprecated Don't rely on this too much, as the capabilities of the NodeType here will probably change a lot; - * Ask the {@see NodeTypeManager} instead - */ public ?NodeType $nodeType, - /** - * Returns all properties of this node. References are NOT part of this API; - * there you need to check getReference() and getReferences(). - * - * To read the serialized properties, call properties->serialized(). - * - * @param PropertyCollection $properties Property values, indexed by their name - */ public PropertyCollection $properties, public ?NodeName $nodeName, public Timestamps $timestamps, ) { } + /** + * @internal The signature of this method can change in the future! + */ + public static function create(ContentSubgraphIdentity $subgraphIdentity, NodeAggregateId $nodeAggregateId, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, ?NodeType $nodeType, PropertyCollection $properties, ?NodeName $nodeName, Timestamps $timestamps): self + { + return new self($subgraphIdentity, $nodeAggregateId, $originDimensionSpacePoint, $classification, $nodeTypeName, $nodeType, $properties, $nodeName, $timestamps); + } + /** * Returns the specified property. * diff --git a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php index 8825aaab050..170db769f12 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php +++ b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php @@ -90,7 +90,7 @@ public function createMinimalNodeOfType( ); } $serializedDefaultPropertyValues = SerializedPropertyValues::fromArray($defaultPropertyValues); - return new Node( + return Node::create( ContentSubgraphIdentity::create( ContentRepositoryId::fromString('default'), ContentStreamId::fromString('cs-id'), diff --git a/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php b/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php index 59a6c145b07..08a59dd2c37 100644 --- a/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php +++ b/Neos.Neos/Tests/Functional/Fusion/NodeHelperTest.php @@ -156,7 +156,7 @@ protected function setUp(): void $now = new \DateTimeImmutable(); - $this->textNode = new Node( + $this->textNode = Node::create( ContentSubgraphIdentity::create( $contentRepositoryId, ContentStreamId::fromString("cs"), From adbb66d7cfaf9f8f0c905818c0ace86dd9d2b322 Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Tue, 31 Oct 2023 17:22:39 +0100 Subject: [PATCH 081/113] 4663 - Adjust StructureAdjustments to properly deal with root nodes --- .../StructureAdjustment/TetheredNodes.feature | 122 +++++++++++------- .../Feature/Common/TetheredNodeInternals.php | 72 ++++++++--- .../Feature/NodeTypeChange/NodeTypeChange.php | 5 +- .../src/Adjustment/DimensionAdjustment.php | 19 +-- .../src/Adjustment/StructureAdjustment.php | 31 ++++- .../Adjustment/TetheredNodeAdjustments.php | 70 +++++----- .../src/StructureAdjustmentService.php | 3 +- 7 files changed, 210 insertions(+), 112 deletions(-) diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature index 8f74410ec2b..6b8aa2ea3cd 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature @@ -10,6 +10,10 @@ Feature: Tethered Nodes integrity violations | language | en, de, gsw | gsw->de->en | And using the following node types: """yaml + 'Neos.ContentRepository:Root': + childNodes: + 'originally-tethered-node': + type: 'Neos.ContentRepository.Testing:Tethered' 'Neos.ContentRepository.Testing:Document': childNodes: 'tethered-node': @@ -27,59 +31,66 @@ Feature: Tethered Nodes integrity violations And using identifier "default", I define a content repository And I am in content repository "default" And the command CreateRootWorkspace is executed with payload: - | Key | Value | - | workspaceName | "live" | - | workspaceTitle | "Live" | - | workspaceDescription | "The live workspace" | - | newContentStreamId | "cs-identifier" | + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | And the graph projection is fully up to date And the command CreateRootNodeAggregateWithNode is executed with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "lady-eleonode-rootford" | - | nodeTypeName | "Neos.ContentRepository:Root" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + | tetheredDescendantNodeAggregateIds | {"originally-tethered-node": "originode-tetherton"} | # We have to add another node since root nodes have no dimension space points and thus cannot be varied # Node /document And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "sir-david-nodenborough" | - | nodeTypeName | "Neos.ContentRepository.Testing:Document" | - | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} | - | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] | - | parentNodeAggregateId | "lady-eleonode-rootford" | - | nodeName | "document" | - | nodeAggregateClassification | "regular" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "sir-david-nodenborough" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} | + | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] | + | parentNodeAggregateId | "lady-eleonode-rootford" | + | nodeName | "document" | + | nodeAggregateClassification | "regular" | # We add a tethered child node to provide for test cases for node aggregates of that classification # Node /document/tethered-node And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "nodewyn-tetherton" | - | nodeTypeName | "Neos.ContentRepository.Testing:Tethered" | - | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} | - | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] | - | parentNodeAggregateId | "sir-david-nodenborough" | - | nodeName | "tethered-node" | - | nodeAggregateClassification | "tethered" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nodewyn-tetherton" | + | nodeTypeName | "Neos.ContentRepository.Testing:Tethered" | + | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} | + | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] | + | parentNodeAggregateId | "sir-david-nodenborough" | + | nodeName | "tethered-node" | + | nodeAggregateClassification | "tethered" | # We add a tethered grandchild node to provide for test cases that this works recursively # Node /document/tethered-node/tethered-leaf And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "nodimer-tetherton" | - | nodeTypeName | "Neos.ContentRepository.Testing:TetheredLeaf" | - | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} | - | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] | - | parentNodeAggregateId | "nodewyn-tetherton" | - | nodeName | "tethered-leaf" | - | nodeAggregateClassification | "tethered" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nodimer-tetherton" | + | nodeTypeName | "Neos.ContentRepository.Testing:TetheredLeaf" | + | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} | + | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] | + | parentNodeAggregateId | "nodewyn-tetherton" | + | nodeName | "tethered-leaf" | + | nodeAggregateClassification | "tethered" | And the graph projection is fully up to date Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document" Scenario: Adjusting the schema adding a new tethered node leads to a MissingTetheredNode integrity violation Given I change the node types in content repository "default" to: """yaml + 'Neos.ContentRepository:Root': + childNodes: + 'originally-tethered-node': + type: 'Neos.ContentRepository.Testing:Tethered' + 'tethered-node': + type: 'Neos.ContentRepository.Testing:Tethered' 'Neos.ContentRepository.Testing:Document': childNodes: 'tethered-node': @@ -97,13 +108,21 @@ Feature: Tethered Nodes integrity violations 'Neos.ContentRepository.Testing:TetheredLeaf': [] """ Then I expect the following structure adjustments for type "Neos.ContentRepository.Testing:Document": - | Type | nodeAggregateId | - | TETHERED_NODE_MISSING | sir-david-nodenborough | - + | Type | nodeAggregateId | + | TETHERED_NODE_MISSING | sir-david-nodenborough | + And I expect the following structure adjustments for type "Neos.ContentRepository:Root": + | Type | nodeAggregateId | + | TETHERED_NODE_MISSING | lady-eleonode-rootford | Scenario: Adding missing tethered nodes resolves the corresponding integrity violations Given I change the node types in content repository "default" to: """yaml + 'Neos.ContentRepository:Root': + childNodes: + 'originally-tethered-node': + type: 'Neos.ContentRepository.Testing:Tethered' + 'tethered-node': + type: 'Neos.ContentRepository.Testing:Tethered' 'Neos.ContentRepository.Testing:Document': childNodes: 'tethered-node': @@ -122,12 +141,18 @@ Feature: Tethered Nodes integrity violations """ When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document" Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document" + When I adjust the node structure for node type "Neos.ContentRepository:Root" + Then I expect no needed structure adjustments for type "Neos.ContentRepository:Root" When I am in the active content stream of workspace "live" and dimension space point {"market":"CH", "language":"gsw"} And I get the node at path "document/some-new-child" And I expect this node to have the following properties: | Key | Value | | foo | "my default applied" | + And I get the node at path "tethered-node" + And I expect this node to have the following properties: + | Key | Value | + | foo | "my default applied" | Scenario: Adding the same Given I change the node types in content repository "default" to: @@ -149,13 +174,14 @@ Feature: Tethered Nodes integrity violations 'Neos.ContentRepository.Testing:TetheredLeaf': [] """ When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document" - Then I expect exactly 6 events to be published on stream "ContentStream:cs-identifier" + Then I expect exactly 8 events to be published on stream "ContentStream:cs-identifier" When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document" - Then I expect exactly 6 events to be published on stream "ContentStream:cs-identifier" + Then I expect exactly 8 events to be published on stream "ContentStream:cs-identifier" Scenario: Adjusting the schema removing a tethered node leads to a DisallowedTetheredNode integrity violation (which can be fixed) Given I change the node types in content repository "default" to: """yaml + 'Neos.ContentRepository:Root': [] 'Neos.ContentRepository.Testing:Document': [] 'Neos.ContentRepository.Testing:Tethered': properties: @@ -168,13 +194,19 @@ Feature: Tethered Nodes integrity violations 'Neos.ContentRepository.Testing:TetheredLeaf': [] """ Then I expect the following structure adjustments for type "Neos.ContentRepository.Testing:Document": - | Type | nodeAggregateId | - | DISALLOWED_TETHERED_NODE | nodewyn-tetherton | + | Type | nodeAggregateId | + | DISALLOWED_TETHERED_NODE | nodewyn-tetherton | + Then I expect the following structure adjustments for type "Neos.ContentRepository:Root": + | Type | nodeAggregateId | + | DISALLOWED_TETHERED_NODE | originode-tetherton | When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document" Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document" + When I adjust the node structure for node type "Neos.ContentRepository:Root" + Then I expect no needed structure adjustments for type "Neos.ContentRepository:Root" When I am in content stream "cs-identifier" and dimension space point {"market":"CH", "language":"gsw"} Then I expect node aggregate identifier "nodewyn-tetherton" to lead to no node Then I expect node aggregate identifier "nodimer-tetherton" to lead to no node + And I expect path "tethered-node" to lead to no node Scenario: Adjusting the schema changing the type of a tethered node leads to a InvalidTetheredNodeType integrity violation Given I change the node types in content repository "default" to: @@ -194,6 +226,6 @@ Feature: Tethered Nodes integrity violations 'Neos.ContentRepository.Testing:TetheredLeaf': [] """ Then I expect the following structure adjustments for type "Neos.ContentRepository.Testing:Document": - | Type | nodeAggregateId | - | TETHERED_NODE_TYPE_WRONG | nodewyn-tetherton | + | Type | nodeAggregateId | + | TETHERED_NODE_TYPE_WRONG | nodewyn-tetherton | diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php index f52aac87f55..ba8ff204f27 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php @@ -18,6 +18,7 @@ use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; +use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; @@ -26,7 +27,6 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\NodeType\NodeType; use Neos\ContentRepository\Core\NodeType\NodeTypeName; -use Neos\ContentRepository\Core\SharedModel\User\UserId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** @@ -54,15 +54,15 @@ abstract protected function createEventsForVariations( */ protected function createEventsForMissingTetheredNode( NodeAggregate $parentNodeAggregate, - Node $parentNode, + OriginDimensionSpacePoint $originDimensionSpacePoint, NodeName $tetheredNodeName, ?NodeAggregateId $tetheredNodeAggregateId, NodeType $expectedTetheredNodeType, ContentRepository $contentRepository ): Events { $childNodeAggregates = $contentRepository->getContentGraph()->findChildNodeAggregatesByName( - $parentNode->subgraphIdentity->contentStreamId, - $parentNode->nodeAggregateId, + $parentNodeAggregate->contentStreamId, + $parentNodeAggregate->nodeAggregateId, $tetheredNodeName ); @@ -75,19 +75,53 @@ protected function createEventsForMissingTetheredNode( if (count($childNodeAggregates) === 0) { // there is no tethered child node aggregate already; let's create it! - return Events::with( - new NodeAggregateWithNodeWasCreated( - $parentNode->subgraphIdentity->contentStreamId, - $tetheredNodeAggregateId ?: NodeAggregateId::create(), - $expectedTetheredNodeType->name, - $parentNode->originDimensionSpacePoint, - $parentNodeAggregate->getCoverageByOccupant($parentNode->originDimensionSpacePoint), - $parentNode->nodeAggregateId, - $tetheredNodeName, - SerializedPropertyValues::defaultFromNodeType($expectedTetheredNodeType), - NodeAggregateClassification::CLASSIFICATION_TETHERED, - ) - ); + $nodeType = $this->nodeTypeManager->getNodeType($parentNodeAggregate->nodeTypeName); + if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) { + $events = []; + $tetheredNodeAggregateId = $tetheredNodeAggregateId ?: NodeAggregateId::create(); + // we create in one origin DSP and vary in the others + $creationOriginDimensionSpacePoint = null; + foreach ($this->getInterDimensionalVariationGraph()->getRootGeneralizations() as $rootGeneralization) { + $rootGeneralizationOrigin = OriginDimensionSpacePoint::fromDimensionSpacePoint($rootGeneralization); + if ($creationOriginDimensionSpacePoint) { + $events[] = new NodePeerVariantWasCreated( + $parentNodeAggregate->contentStreamId, + $tetheredNodeAggregateId, + $creationOriginDimensionSpacePoint, + $rootGeneralizationOrigin, + $this->getInterDimensionalVariationGraph()->getSpecializationSet($rootGeneralization) + ); + } else { + $events[] = new NodeAggregateWithNodeWasCreated( + $parentNodeAggregate->contentStreamId, + $tetheredNodeAggregateId, + $expectedTetheredNodeType->name, + $rootGeneralizationOrigin, + $this->getInterDimensionalVariationGraph()->getSpecializationSet($rootGeneralization), + $parentNodeAggregate->nodeAggregateId, + $tetheredNodeName, + SerializedPropertyValues::defaultFromNodeType($expectedTetheredNodeType), + NodeAggregateClassification::CLASSIFICATION_TETHERED, + ); + $creationOriginDimensionSpacePoint = $rootGeneralizationOrigin; + } + } + return Events::fromArray($events); + } else { + return Events::with( + new NodeAggregateWithNodeWasCreated( + $parentNodeAggregate->contentStreamId, + $tetheredNodeAggregateId ?: NodeAggregateId::create(), + $expectedTetheredNodeType->name, + $originDimensionSpacePoint, + $parentNodeAggregate->getCoverageByOccupant($originDimensionSpacePoint), + $parentNodeAggregate->nodeAggregateId, + $tetheredNodeName, + SerializedPropertyValues::defaultFromNodeType($expectedTetheredNodeType), + NodeAggregateClassification::CLASSIFICATION_TETHERED, + ) + ); + } } elseif (count($childNodeAggregates) === 1) { /** @var NodeAggregate $childNodeAggregate */ $childNodeAggregate = current($childNodeAggregates); @@ -106,9 +140,9 @@ protected function createEventsForMissingTetheredNode( } /** @var Node $childNodeSource Node aggregates are never empty */ return $this->createEventsForVariations( - $parentNode->subgraphIdentity->contentStreamId, + $parentNodeAggregate->contentStreamId, $childNodeSource->originDimensionSpacePoint, - $parentNode->originDimensionSpacePoint, + $originDimensionSpacePoint, $parentNodeAggregate, $contentRepository ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php index 16306a537e8..0f68cba7042 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php @@ -16,6 +16,7 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; +use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; @@ -90,7 +91,7 @@ abstract protected function areNodeTypeConstraintsImposedByGrandparentValid( abstract protected function createEventsForMissingTetheredNode( NodeAggregate $parentNodeAggregate, - Node $parentNode, + OriginDimensionSpacePoint $originDimensionSpacePoint, NodeName $tetheredNodeName, NodeAggregateId $tetheredNodeAggregateId, NodeType $expectedTetheredNodeType, @@ -206,7 +207,7 @@ private function handleChangeNodeAggregateType( ?: NodeAggregateId::create(); array_push($events, ...iterator_to_array($this->createEventsForMissingTetheredNode( $nodeAggregate, - $node, + $node->originDimensionSpacePoint, $tetheredNodeName, $tetheredNodeAggregateId, $expectedTetheredNodeType, diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php index 08af46c972a..38d0c604d20 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php @@ -6,26 +6,27 @@ use Neos\ContentRepository\Core\DimensionSpace\InterDimensionalVariationGraph; use Neos\ContentRepository\Core\DimensionSpace\VariantType; +use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\NodeType\NodeTypeName; class DimensionAdjustment { - protected ProjectedNodeIterator $projectedNodeIterator; - protected InterDimensionalVariationGraph $interDimensionalVariationGraph; - public function __construct( - ProjectedNodeIterator $projectedNodeIterator, - InterDimensionalVariationGraph $interDimensionalVariationGraph + protected ProjectedNodeIterator $projectedNodeIterator, + protected InterDimensionalVariationGraph $interDimensionalVariationGraph, + protected NodeTypeManager $nodeTypeManager, ) { - $this->projectedNodeIterator = $projectedNodeIterator; - $this->interDimensionalVariationGraph = $interDimensionalVariationGraph; } /** - * @return \Generator<int,StructureAdjustment> + * @return iterable<int,StructureAdjustment> */ - public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generator + public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): iterable { + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); + if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) { + return []; + } foreach ($this->projectedNodeIterator->nodeAggregatesOfType($nodeTypeName) as $nodeAggregate) { foreach ($nodeAggregate->getNodes() as $node) { foreach ( diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php index d532e0232fc..b2ba0668007 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php @@ -4,8 +4,11 @@ namespace Neos\ContentRepository\StructureAdjustment\Adjustment; +use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; +use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\Error\Messages\Message; final class StructureAdjustment extends Message @@ -41,8 +44,10 @@ private function __construct( $this->type = $type; } - public static function createForNode( - Node $node, + public static function createForNodeIdentity( + ContentStreamId $contentStreamId, + OriginDimensionSpacePoint $originDimensionSpacePoint, + NodeAggregateId $nodeAggregateId, string $type, string $errorMessage, ?\Closure $remediation = null @@ -52,9 +57,9 @@ public static function createForNode( . ($remediation ? '' : '!!!NOT AUTO-FIXABLE YET!!! ') . $errorMessage, null, [ - 'contentStream' => $node->subgraphIdentity->contentStreamId->value, - 'dimensionSpacePoint' => $node->originDimensionSpacePoint->toJson(), - 'nodeAggregateId' => $node->nodeAggregateId->value, + 'contentStream' => $contentStreamId->value, + 'dimensionSpacePoint' => $originDimensionSpacePoint->toJson(), + 'nodeAggregateId' => $nodeAggregateId->value, 'isAutoFixable' => ($remediation !== null) ], $type, @@ -62,6 +67,22 @@ public static function createForNode( ); } + public static function createForNode( + Node $node, + string $type, + string $errorMessage, + ?\Closure $remediation = null + ): self { + return self::createForNodeIdentity( + $node->subgraphIdentity->contentStreamId, + $node->originDimensionSpacePoint, + $node->nodeAggregateId, + $type, + $errorMessage, + $remediation + ); + } + public static function createForNodeAggregate( NodeAggregate $nodeAggregate, string $type, diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php index 994672b390e..45ad49d7129 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php @@ -11,6 +11,7 @@ use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMappings; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; use Neos\ContentRepository\Core\Feature\Common\TetheredNodeInternals; @@ -51,46 +52,52 @@ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generat // In case we cannot find the expected tethered nodes, this fix cannot do anything. return; } - $expectedTetheredNodes = $this->nodeTypeManager->getTetheredNodesConfigurationForNodeType($this->nodeTypeManager->getNodeType($nodeTypeName)); + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); + $expectedTetheredNodes = $this->nodeTypeManager->getTetheredNodesConfigurationForNodeType($nodeType); foreach ($this->projectedNodeIterator->nodeAggregatesOfType($nodeTypeName) as $nodeAggregate) { // find missing tethered nodes $foundMissingOrDisallowedTetheredNodes = false; - foreach ($nodeAggregate->getNodes() as $node) { - assert($node instanceof Node); + $originDimensionSpacePoints = $nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME) + ? DimensionSpace\OriginDimensionSpacePointSet::fromDimensionSpacePointSet( + DimensionSpace\DimensionSpacePointSet::fromArray($this->getInterDimensionalVariationGraph()->getRootGeneralizations()) + ) + : $nodeAggregate->occupiedDimensionSpacePoints; + + foreach ($originDimensionSpacePoints as $originDimensionSpacePoint) { foreach ($expectedTetheredNodes as $tetheredNodeName => $expectedTetheredNodeType) { $tetheredNodeName = NodeName::fromString($tetheredNodeName); $subgraph = $this->contentRepository->getContentGraph()->getSubgraph( - $node->subgraphIdentity->contentStreamId, - $node->originDimensionSpacePoint->toDimensionSpacePoint(), + $nodeAggregate->contentStreamId, + $originDimensionSpacePoint->toDimensionSpacePoint(), VisibilityConstraints::withoutRestrictions() ); $tetheredNode = $subgraph->findChildNodeConnectedThroughEdgeName( - $node->nodeAggregateId, + $nodeAggregate->nodeAggregateId, $tetheredNodeName ); if ($tetheredNode === null) { $foundMissingOrDisallowedTetheredNodes = true; // $nestedNode not found // - so a tethered node is missing in the OriginDimensionSpacePoint of the $node - yield StructureAdjustment::createForNode( - $node, + yield StructureAdjustment::createForNodeIdentity( + $nodeAggregate->contentStreamId, + $originDimensionSpacePoint, + $nodeAggregate->nodeAggregateId, StructureAdjustment::TETHERED_NODE_MISSING, 'The tethered child node "' . $tetheredNodeName->value . '" is missing.', - function () use ($nodeAggregate, $node, $tetheredNodeName, $expectedTetheredNodeType) { + function () use ($nodeAggregate, $originDimensionSpacePoint, $tetheredNodeName, $expectedTetheredNodeType) { $events = $this->createEventsForMissingTetheredNode( $nodeAggregate, - $node, + $originDimensionSpacePoint, $tetheredNodeName, null, $expectedTetheredNodeType, $this->contentRepository ); - $streamName = ContentStreamEventStreamName::fromContentStreamId( - $node->subgraphIdentity->contentStreamId - ); + $streamName = ContentStreamEventStreamName::fromContentStreamId($nodeAggregate->contentStreamId); return new EventsToPublish( $streamName->getEventStreamName(), $events, @@ -128,14 +135,13 @@ function () use ($tetheredNodeAggregate) { // find wrongly ordered tethered nodes if ($foundMissingOrDisallowedTetheredNodes === false) { - foreach ($nodeAggregate->getNodes() as $node) { - assert($node instanceof Node); + foreach ($originDimensionSpacePoints as $originDimensionSpacePoint) { $subgraph = $this->contentRepository->getContentGraph()->getSubgraph( - $node->subgraphIdentity->contentStreamId, - $node->originDimensionSpacePoint->toDimensionSpacePoint(), + $nodeAggregate->contentStreamId, + $originDimensionSpacePoint->toDimensionSpacePoint(), VisibilityConstraints::withoutRestrictions() ); - $childNodes = $subgraph->findChildNodes($node->nodeAggregateId, FindChildNodesFilter::create()); + $childNodes = $subgraph->findChildNodes($nodeAggregate->nodeAggregateId, FindChildNodesFilter::create()); /** is indexed by node name, and the value is the tethered node itself */ $actualTetheredChildNodes = []; @@ -147,21 +153,22 @@ function () use ($tetheredNodeAggregate) { if (array_keys($actualTetheredChildNodes) !== array_keys($expectedTetheredNodes)) { // we need to re-order: We go from the last to the first - yield StructureAdjustment::createForNode( - $node, + yield StructureAdjustment::createForNodeIdentity( + $nodeAggregate->contentStreamId, + $originDimensionSpacePoint, + $nodeAggregate->nodeAggregateId, StructureAdjustment::TETHERED_NODE_WRONGLY_ORDERED, 'Tethered nodes wrongly ordered, expected: ' . implode(', ', array_keys($expectedTetheredNodes)) . ' - actual: ' . implode(', ', array_keys($actualTetheredChildNodes)), - function () use ($node, $actualTetheredChildNodes, $expectedTetheredNodes) { - return $this->reorderNodes( - $node->subgraphIdentity->contentStreamId, - $node, - $actualTetheredChildNodes, - array_keys($expectedTetheredNodes) - ); - } + fn () => $this->reorderNodes( + $nodeAggregate->contentStreamId, + $nodeAggregate->nodeAggregateId, + $originDimensionSpacePoint, + $actualTetheredChildNodes, + array_keys($expectedTetheredNodes) + ) ); } } @@ -210,7 +217,8 @@ protected function getInterDimensionalVariationGraph(): DimensionSpace\InterDime */ private function reorderNodes( ContentStreamId $contentStreamId, - Node $parentNode, + NodeAggregateId $parentNodeAggregateId, + DimensionSpace\OriginDimensionSpacePoint $originDimensionSpacePoint, array $actualTetheredChildNodes, array $expectedNodeOrdering ): EventsToPublish { @@ -240,8 +248,8 @@ private function reorderNodes( $succeedingNode->nodeAggregateId, $succeedingNode->originDimensionSpacePoint, // we only change the order, not the parent -> so we can simply use the parent here. - $parentNode->nodeAggregateId, - $parentNode->originDimensionSpacePoint + $parentNodeAggregateId, + $originDimensionSpacePoint ) ) ) diff --git a/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php b/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php index a6fe7ec2018..f816d330232 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php +++ b/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php @@ -60,7 +60,8 @@ public function __construct( ); $this->dimensionAdjustment = new DimensionAdjustment( $projectedNodeIterator, - $interDimensionalVariationGraph + $interDimensionalVariationGraph, + $nodeTypeManager ); } From a177872daaf82a4b38bb5980224efca6bff4ad62 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:33:50 +0100 Subject: [PATCH 082/113] TASK: Use new behat FlowBootstrapTrait see https://github.com/neos/behat/pull/35 --- .composer.json | 3 +- .../Features/Bootstrap/FeatureContext.php | 12 +++---- ...ectionIntegrityViolationDetectionTrait.php | 12 ++++++- .../Behavior/Bootstrap/FeatureContext.php | 23 ++++-------- .../Behavior/Bootstrap/FeatureContext.php | 17 ++++----- .../Behavior/CRRegistrySubjectProvider.php | 19 +++++----- .../Service/EditorContentStreamZookeeper.php | 5 ++- .../Features/Bootstrap/BrowserTrait.php | 23 ++++++------ .../Features/Bootstrap/FeatureContext.php | 24 ++++++------- .../Features/Bootstrap/RoutingTrait.php | 35 ++++++++++--------- .../Features/FrontendRouting/Basic.feature | 2 +- .../FrontendRouting/Dimensions.feature | 2 +- .../FrontendRouting/DisableNodes.feature | 2 +- .../Lowlevel_ProjectionTests.feature | 2 +- .../FrontendRouting/MultiSiteLinking.feature | 2 +- .../FrontendRouting/RouteCache.feature | 2 +- .../FrontendRouting/Shortcuts.feature | 2 +- .../TetheredSiteChildDocuments.feature | 2 +- composer.json | 3 +- 19 files changed, 94 insertions(+), 98 deletions(-) diff --git a/.composer.json b/.composer.json index fc12c2ff3a7..02ffb5fff2f 100644 --- a/.composer.json +++ b/.composer.json @@ -35,7 +35,8 @@ "../../bin/behat -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist", "../../bin/behat -f progress -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist", "../../flow doctrine:migrate --quiet; ../../flow cr:setup", - "../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml" + "../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml", + "../../bin/behat -f progress -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist" ], "test:behavioral:stop-on-failure": [ "../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist", diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php index 2f918be284f..d7d3239cd7b 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php @@ -11,12 +11,11 @@ * source code. */ -require_once(__DIR__ . '/../../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php'); require_once(__DIR__ . '/ProjectionIntegrityViolationDetectionTrait.php'); use Behat\Behat\Context\Context as BehatContext; use Behat\Behat\Hook\Scope\BeforeScenarioScope; -use Neos\Behat\Tests\Behat\FlowContextTrait; +use Neos\Behat\FlowBootstrapTrait; use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory; @@ -33,7 +32,7 @@ */ class FeatureContext implements BehatContext { - use FlowContextTrait; + use FlowBootstrapTrait; use ProjectionIntegrityViolationDetectionTrait; use CRTestSuiteTrait; use CRBehavioralTestsSubjectProvider; @@ -42,11 +41,8 @@ class FeatureContext implements BehatContext public function __construct() { - if (self::$bootstrap === null) { - self::$bootstrap = $this->initializeFlow(); - } - $this->objectManager = self::$bootstrap->getObjectManager(); - $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class); + self::bootstrapFlow(); + $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class); $this->setupCRTestSuiteTrait(); $this->setupDbalGraphAdapterIntegrityViolationTrait(); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php index 82a090cecb4..a318b4ea750 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php @@ -32,6 +32,8 @@ /** * Custom context trait for projection integrity violation detection specific to the Doctrine DBAL content graph adapter + * + * @todo move this class somewhere where its autoloaded */ trait ProjectionIntegrityViolationDetectionTrait { @@ -41,6 +43,14 @@ trait ProjectionIntegrityViolationDetectionTrait protected Result $lastIntegrityViolationDetectionResult; + /** + * @template T of object + * @param class-string<T> $className + * + * @return T + */ + abstract private function getObject(string $className): object; + protected function getTableNamePrefix(): string { return DoctrineDbalContentGraphProjectionFactory::graphProjectionTableNamePrefix( @@ -50,7 +60,7 @@ protected function getTableNamePrefix(): string public function setupDbalGraphAdapterIntegrityViolationTrait() { - $this->dbalClient = $this->getObjectManager()->get(DbalClient::class); + $this->dbalClient = $this->getObject(DbalClient::class); } /** diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php index 31d9bc21b50..f6e7e6d0786 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php @@ -11,13 +11,13 @@ * source code. */ -require_once(__DIR__ . '/../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php'); +// @todo remove this require statement require_once(__DIR__ . '/../../../../Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php'); use Behat\Behat\Context\Context as BehatContext; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use GuzzleHttp\Psr7\Uri; -use Neos\Behat\Tests\Behat\FlowContextTrait; +use Neos\Behat\FlowBootstrapTrait; use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait; use Neos\ContentRepository\BehavioralTests\ProjectionRaceConditionTester\Dto\TraceEntryType; use Neos\ContentRepository\BehavioralTests\ProjectionRaceConditionTester\RedisInterleavingLogger; @@ -38,14 +38,13 @@ use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\StructureAdjustmentsTrait; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Configuration\ConfigurationManager; -use Neos\Flow\ObjectManagement\ObjectManagerInterface; /** * Features context */ class FeatureContext implements BehatContext { - use FlowContextTrait; + use FlowBootstrapTrait; use CRTestSuiteTrait; use CRBehavioralTestsSubjectProvider; use ProjectionIntegrityViolationDetectionTrait; @@ -58,22 +57,19 @@ class FeatureContext implements BehatContext public function __construct() { - if (self::$bootstrap === null) { - self::$bootstrap = $this->initializeFlow(); - } - $this->objectManager = self::$bootstrap->getObjectManager(); + self::bootstrapFlow(); - $this->dbalClient = $this->getObjectManager()->get(DbalClientInterface::class); + $this->dbalClient = $this->getObject(DbalClientInterface::class); $this->setupCRTestSuiteTrait(); $this->setUpInterleavingLogger(); - $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class); + $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class); } private function setUpInterleavingLogger(): void { // prepare race tracking for debugging into the race log if (class_exists(RedisInterleavingLogger::class)) { // the class must exist (the package loaded) - $raceConditionTrackerConfig = $this->getObjectManager()->get(ConfigurationManager::class) + $raceConditionTrackerConfig = $this->getObject(ConfigurationManager::class) ->getConfiguration( ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.ContentRepository.BehavioralTests.raceConditionTracker' @@ -115,11 +111,6 @@ public function resetContentRepositoryComponents(BeforeScenarioScope $scope): vo GherkinPyStringNodeBasedNodeTypeManagerFactory::reset(); } - protected function getObjectManager(): ObjectManagerInterface - { - return $this->objectManager; - } - protected function getContentRepositoryService( ContentRepositoryServiceFactoryInterface $factory ): ContentRepositoryServiceInterface { diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php index 53b87836684..b27cd3ac110 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php @@ -1,15 +1,13 @@ <?php declare(strict_types=1); -require_once(__DIR__ . '/../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php'); - use Behat\Behat\Context\Context; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use League\Flysystem\FileAttributes; use League\Flysystem\Filesystem; use League\Flysystem\InMemory\InMemoryFilesystemAdapter; -use Neos\Behat\Tests\Behat\FlowContextTrait; +use Neos\Behat\FlowBootstrapTrait; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinTableNodeBasedContentDimensionSourceFactory; @@ -43,7 +41,7 @@ */ class FeatureContext implements Context { - use FlowContextTrait; + use FlowBootstrapTrait; use CRTestSuiteTrait; use CRBehavioralTestsSubjectProvider; @@ -70,11 +68,8 @@ class FeatureContext implements Context public function __construct() { - if (self::$bootstrap === null) { - self::$bootstrap = $this->initializeFlow(); - } - $this->objectManager = self::$bootstrap->getObjectManager(); - $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class); + self::bootstrapFlow(); + $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class); $this->mockFilesystemAdapter = new InMemoryFilesystemAdapter(); $this->mockFilesystem = new Filesystem($this->mockFilesystemAdapter); @@ -120,7 +115,7 @@ public function iHaveTheFollowingNodeDataRows(TableNode $nodeDataRows): void public function iRunTheEventMigration(string $contentStream = null): void { $nodeTypeManager = $this->currentContentRepository->getNodeTypeManager(); - $propertyMapper = $this->getObjectManager()->get(PropertyMapper::class); + $propertyMapper = $this->getObject(PropertyMapper::class); $contentGraph = $this->currentContentRepository->getContentGraph(); $nodeFactory = (new \ReflectionClass($contentGraph)) ->getProperty('nodeFactory') @@ -130,7 +125,7 @@ public function iRunTheEventMigration(string $contentStream = null): void ->getValue($nodeFactory); $interDimensionalVariationGraph = $this->currentContentRepository->getVariationGraph(); - $eventNormalizer = $this->getObjectManager()->get(EventNormalizer::class); + $eventNormalizer = $this->getObject(EventNormalizer::class); $migration = new NodeDataToEventsProcessor( $nodeTypeManager, $propertyMapper, diff --git a/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php b/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php index b65af14b832..fd1779fdc61 100644 --- a/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php +++ b/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php @@ -15,7 +15,6 @@ namespace Neos\ContentRepositoryRegistry\TestSuite\Behavior; use Doctrine\DBAL\Connection; -use Neos\Behat\Tests\Behat\FlowContextTrait; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\Factory\ContentRepositoryId; use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceFactoryInterface; @@ -24,15 +23,11 @@ use Neos\ContentRepositoryRegistry\Exception\ContentRepositoryNotFoundException; use Neos\EventStore\EventStoreInterface; -require_once(__DIR__ . '/../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php'); - /** * The node creation trait for behavioral tests */ trait CRRegistrySubjectProvider { - use FlowContextTrait; - protected ContentRepositoryRegistry $contentRepositoryRegistry; protected ?ContentRepository $currentContentRepository = null; @@ -42,13 +37,17 @@ trait CRRegistrySubjectProvider */ protected array $alreadySetUpContentRepositories = []; + /** + * @template T of object + * @param class-string<T> $className + * + * @return T + */ + abstract protected function getObject(string $className): object; + protected function setUpCRRegistry(): void { - if (self::$bootstrap === null) { - self::$bootstrap = $this->initializeFlow(); - } - $this->objectManager = self::$bootstrap->getObjectManager(); - $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class); + $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class); } /** diff --git a/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php b/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php index 0dfcea7ee4d..ae7e7af173a 100644 --- a/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php +++ b/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php @@ -90,7 +90,10 @@ final class EditorContentStreamZookeeper public function relayEditorAuthentication(Authentication\TokenInterface $token): void { $requestHandler = $this->bootstrap->getActiveRequestHandler(); - assert($requestHandler instanceof HttpRequestHandlerInterface); + if (!$requestHandler instanceof HttpRequestHandlerInterface) { + // we might be in testing context + return; + } $siteDetectionResult = SiteDetectionResult::fromRequest($requestHandler->getHttpRequest()); $contentRepository = $this->contentRepositoryRegistry->get($siteDetectionResult->contentRepositoryId); diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/BrowserTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/BrowserTrait.php index 1d28e3260b0..030bde9ea19 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/BrowserTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/BrowserTrait.php @@ -34,14 +34,17 @@ trait BrowserTrait use CRTestSuiteRuntimeVariables; /** - * @return \Neos\Flow\ObjectManagement\ObjectManagerInterface + * @var \Neos\Flow\Http\Client\Browser */ - abstract protected function getObjectManager(); + protected $browser; /** - * @var \Neos\Flow\Http\Client\Browser + * @template T of object + * @param class-string<T> $className + * + * @return T */ - protected $browser; + abstract private function getObject(string $className): object; /** * @BeforeScenario @@ -50,11 +53,11 @@ public function setupBrowserForEveryScenario() { // we reset the security context at the beginning of every scenario; such that we start with a clean session at // every scenario and SHARE the session throughout the scenario! - $this->getObjectManager()->get(\Neos\Flow\Security\Context::class)->clearContext(); + $this->getObject(\Neos\Flow\Security\Context::class)->clearContext(); $this->browser = new \Neos\Flow\Http\Client\Browser(); $this->browser->setRequestEngine(new \Neos\Neos\Testing\CustomizedInternalRequestEngine()); - $bootstrap = $this->getObjectManager()->get(\Neos\Flow\Core\Bootstrap::class); + $bootstrap = $this->getObject(\Neos\Flow\Core\Bootstrap::class); $requestHandler = new \Neos\Flow\Tests\FunctionalTestRequestHandler($bootstrap); $serverRequestFactory = new ServerRequestFactory(new UriFactory()); @@ -229,7 +232,7 @@ protected function replacePlaceholders($nodeAddressString) */ public function iSendTheFollowingChanges(TableNode $changeDefinition) { - $this->getObjectManager()->get(\Neos\Neos\Ui\Domain\Model\FeedbackCollection::class)->reset(); + $this->getObject(\Neos\Neos\Ui\Domain\Model\FeedbackCollection::class)->reset(); $changes = []; foreach ($changeDefinition->getHash() as $singleChange) { @@ -244,7 +247,7 @@ public function iSendTheFollowingChanges(TableNode $changeDefinition) } $server = [ - 'HTTP_X_FLOW_CSRFTOKEN' => $this->getObjectManager()->get(\Neos\Flow\Security\Context::class)->getCsrfProtectionToken(), + 'HTTP_X_FLOW_CSRFTOKEN' => $this->getObject(\Neos\Flow\Security\Context::class)->getCsrfProtectionToken(), ]; $this->currentResponse = $this->browser->request('http://localhost/neos/ui-services/change', 'POST', ['changes' => $changes], [], $server); $this->currentResponseContents = $this->currentResponse->getBody()->getContents(); @@ -257,7 +260,7 @@ public function iSendTheFollowingChanges(TableNode $changeDefinition) */ public function iPublishTheFollowingNodes(string $targetWorkspaceName, TableNode $nodesToPublish) { - $this->getObjectManager()->get(\Neos\Neos\Ui\Domain\Model\FeedbackCollection::class)->reset(); + $this->getObject(\Neos\Neos\Ui\Domain\Model\FeedbackCollection::class)->reset(); $nodeContextPaths = []; foreach ($nodesToPublish->getHash() as $singleChange) { @@ -265,7 +268,7 @@ public function iPublishTheFollowingNodes(string $targetWorkspaceName, TableNode } $server = [ - 'HTTP_X_FLOW_CSRFTOKEN' => $this->getObjectManager()->get(\Neos\Flow\Security\Context::class)->getCsrfProtectionToken(), + 'HTTP_X_FLOW_CSRFTOKEN' => $this->getObject(\Neos\Flow\Security\Context::class)->getCsrfProtectionToken(), ]; $payload = [ 'nodeContextPaths' => $nodeContextPaths, diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php index 733c0ee5373..9d7ff69b989 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FeatureContext.php @@ -12,7 +12,8 @@ use Behat\Behat\Context\Context as BehatContext; use Behat\Behat\Hook\Scope\BeforeScenarioScope; -use Neos\Behat\Tests\Behat\FlowContextTrait; +use Neos\Behat\FlowBootstrapTrait; +use Neos\Behat\FlowEntitiesTrait; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory; use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinTableNodeBasedContentDimensionSourceFactory; @@ -24,13 +25,11 @@ use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\MigrationsTrait; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Utility\Environment; -use Neos\Utility\Files; - -require_once(__DIR__ . '/../../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php'); class FeatureContext implements BehatContext { - use FlowContextTrait; + use FlowBootstrapTrait; + use FlowEntitiesTrait; use BrowserTrait; use CRTestSuiteTrait; @@ -44,12 +43,9 @@ class FeatureContext implements BehatContext public function __construct() { - if (self::$bootstrap === null) { - self::$bootstrap = $this->initializeFlow(); - } - $this->objectManager = self::$bootstrap->getObjectManager(); - $this->environment = $this->objectManager->get(Environment::class); - $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class); + self::bootstrapFlow(); + $this->environment = $this->getObject(Environment::class); + $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class); $this->setupCRTestSuiteTrait(true); } @@ -71,13 +67,13 @@ public function resetPersistenceManagerAndFeedbackCollection() // FIXME: we have some strange race condition between the scenarios; my theory is that // somehow projectors still run in the background when we start from scratch... sleep(2); - $this->getObjectManager()->get(\Neos\Flow\Persistence\PersistenceManagerInterface::class)->clearState(); + $this->getObject(\Neos\Flow\Persistence\PersistenceManagerInterface::class)->clearState(); // FIXME: FeedbackCollection is a really ugly, hacky SINGLETON; so it needs to be RESET! - $this->getObjectManager()->get(\Neos\Neos\Ui\Domain\Model\FeedbackCollection::class)->reset(); + $this->getObject(\Neos\Neos\Ui\Domain\Model\FeedbackCollection::class)->reset(); // The UserService has a runtime cache - which we need to reset as well as our users get new IDs. // Did I already mention I LOVE in memory caches? ;-) ;-) ;-) - $userService = $this->getObjectManager()->get(\Neos\Neos\Domain\Service\UserService::class); + $userService = $this->getObject(\Neos\Neos\Domain\Service\UserService::class); \Neos\Utility\ObjectAccess::setProperty($userService, 'runtimeUserCache', [], true); } diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php index ede2f285b75..ed45891c0b7 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/RoutingTrait.php @@ -57,7 +57,7 @@ use Symfony\Component\Yaml\Yaml; /** - * Routing related Behat steps. This trait is pure (no side effects). + * Routing related Behat steps. This trait is impure and resets the SiteRepository * * Requires the {@see \Neos\Flow\Core\Bootstrap::getActiveRequestHandler()} to be a {@see FunctionalTestRequestHandler}. * For this the {@see BrowserTrait} can be used. @@ -74,9 +74,12 @@ trait RoutingTrait private $requestUrl; /** - * @return ObjectManagerInterface + * @template T of object + * @param class-string<T> $className + * + * @return T */ - abstract protected function getObjectManager(); + abstract private function getObject(string $className): object; /** * @Given A site exists for node name :nodeName @@ -84,10 +87,8 @@ abstract protected function getObjectManager(); */ public function theSiteExists(string $nodeName, string $domain = null): void { - /** @var SiteRepository $siteRepository */ - $siteRepository = $this->getObjectManager()->get(SiteRepository::class); - /** @var PersistenceManagerInterface $persistenceManager */ - $persistenceManager = $this->getObjectManager()->get(PersistenceManagerInterface::class); + $siteRepository = $this->getObject(SiteRepository::class); + $persistenceManager = $this->getObject(PersistenceManagerInterface::class); $site = new Site($nodeName); $site->setSiteResourcesPackageKey('Neos.Neos'); @@ -102,7 +103,7 @@ public function theSiteExists(string $nodeName, string $domain = null): void $domainModel->setScheme($domainUri->getScheme()); $domainModel->setSite($site); /** @var DomainRepository $domainRepository */ - $domainRepository = $this->getObjectManager()->get(DomainRepository::class); + $domainRepository = $this->getObject(DomainRepository::class); $domainRepository->add($domainModel); } @@ -117,7 +118,7 @@ public function theSiteExists(string $nodeName, string $domain = null): void */ public function theSiteConfigurationIs(\Behat\Gherkin\Node\PyStringNode $configYaml): void { - $entityManager = $this->getObjectManager()->get(EntityManagerInterface::class); + $entityManager = $this->getObject(EntityManagerInterface::class); // clean up old PostLoad Hook if ($this->routingTraitSiteConfigurationPostLoadHook !== null) { $entityManager->getEventManager()->removeEventListener('postLoad', $this->routingTraitSiteConfigurationPostLoadHook); @@ -148,9 +149,9 @@ public function postLoad(LifecycleEventArgs $lifecycleEventArgs) public function anAssetExists(string $assetIdentifier, string $fileName, string $content): void { /** @var ResourceManager $resourceManager */ - $resourceManager = $this->getObjectManager()->get(ResourceManager::class); + $resourceManager = $this->getObject(ResourceManager::class); /** @var AssetRepository $assetRepository */ - $assetRepository = $this->getObjectManager()->get(AssetRepository::class); + $assetRepository = $this->getObject(AssetRepository::class); $resource = $resourceManager->importResourceFromContent($content, $fileName); $asset = new Asset($resource); @@ -158,7 +159,7 @@ public function anAssetExists(string $assetIdentifier, string $fileName, string $assetRepository->add($asset); /** @var PersistenceManagerInterface $persistenceManager */ - $persistenceManager = $this->getObjectManager()->get(PersistenceManagerInterface::class); + $persistenceManager = $this->getObject(PersistenceManagerInterface::class); $persistenceManager->persistAll(); $persistenceManager->clearState(); } @@ -236,8 +237,8 @@ public function theUrlShouldMatchTheNodeInContentStreamAndDimension(string $url, private function match(UriInterface $uri): ?NodeAddress { - $router = $this->getObjectManager()->get(RouterInterface::class); - $serverRequestFactory = $this->getObjectManager()->get(ServerRequestFactoryInterface::class); + $router = $this->getObject(RouterInterface::class); + $serverRequestFactory = $this->getObject(ServerRequestFactoryInterface::class); $httpRequest = $serverRequestFactory->createServerRequest('GET', $uri); $httpRequest = $this->addRoutingParameters($httpRequest); @@ -288,7 +289,7 @@ public function theNodeShouldNotResolve(string $nodeAggregateId, string $content public function tableContainsExactly(TableNode $expectedRows): void { /** @var Connection $dbal */ - $dbal = $this->getObjectManager()->get(EntityManagerInterface::class)->getConnection(); + $dbal = $this->getObject(EntityManagerInterface::class)->getConnection(); $columns = implode(', ', array_keys($expectedRows->getHash()[0])); $tablePrefix = DocumentUriPathProjectionFactory::projectionTableNamePrefix( $this->currentContentRepository->id @@ -315,7 +316,7 @@ private function resolveUrl(string $nodeAggregateId, string $contentStreamId, st : NodeAggregateId::fromString($nodeAggregateId), WorkspaceName::forLive() ); - $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', $this->requestUrl); + $httpRequest = $this->getObject(ServerRequestFactoryInterface::class)->createServerRequest('GET', $this->requestUrl); $httpRequest = $this->addRoutingParameters($httpRequest); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); return NodeUriBuilder::fromRequest($actionRequest)->uriFor($nodeAddress); @@ -339,7 +340,7 @@ public function iInvokeTheDimensionResolverWithOptions(PyStringNode $rawSiteConf $rawSiteConfiguration = Yaml::parse($rawSiteConfigurationYaml->getRaw()) ?? []; $siteConfiguration = SiteConfiguration::fromArray($rawSiteConfiguration); - $dimensionResolverFactory = $this->getObjectManager()->get($siteConfiguration->contentDimensionResolverFactoryClassName); + $dimensionResolverFactory = $this->getObject($siteConfiguration->contentDimensionResolverFactoryClassName); assert($dimensionResolverFactory instanceof DimensionResolverFactoryInterface); $dimensionResolver = $dimensionResolverFactory->create($siteConfiguration->contentRepositoryId, $siteConfiguration); diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Basic.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Basic.feature index 7a0099230e5..da5635f69db 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Basic.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Basic.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Basic routing functionality (match & resolve document nodes in one dimension) Background: diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature index 8983d4561d9..c6a9da1b7bf 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Routing functionality with multiple content dimensions Background: diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature index bd6b2db93ed..8912929e8f3 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Routing behavior of removed, disabled and re-enabled nodes Background: diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Lowlevel_ProjectionTests.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Lowlevel_ProjectionTests.feature index c1d7464cf09..2cdc69e6bcb 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Lowlevel_ProjectionTests.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Lowlevel_ProjectionTests.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Low level tests covering the inner behavior of the routing projection Background: diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/MultiSiteLinking.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/MultiSiteLinking.feature index d15849c36a1..33b0b36b404 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/MultiSiteLinking.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/MultiSiteLinking.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Linking between multiple websites Background: diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature index 0831200f2fd..4a5df7fc03d 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Route cache invalidation Background: diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Shortcuts.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Shortcuts.feature index 4f4b7491880..3bba3d61557 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Shortcuts.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Shortcuts.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Routing behavior of shortcut nodes Background: diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/TetheredSiteChildDocuments.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/TetheredSiteChildDocuments.feature index 1ddfba54ec5..5b644025b96 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/TetheredSiteChildDocuments.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/TetheredSiteChildDocuments.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Tests for site node child documents. These are special in that they have the first non-dimension uri path segment. Background: diff --git a/composer.json b/composer.json index 7348c34a7bb..3c21e77ea29 100644 --- a/composer.json +++ b/composer.json @@ -111,7 +111,8 @@ "../../bin/behat -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist", "../../bin/behat -f progress -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist", "../../flow doctrine:migrate --quiet; ../../flow cr:setup", - "../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml" + "../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml", + "../../bin/behat -f progress -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist" ], "test:behavioral:stop-on-failure": [ "../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist", From 0f46fb00de9027f6f8866f6f88255430dedcda7f Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Tue, 31 Oct 2023 18:00:02 +0100 Subject: [PATCH 083/113] 4663 - Catch missing node type in dimensions adjustment --- .../src/Adjustment/DimensionAdjustment.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php index 38d0c604d20..2219f0b5210 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php @@ -8,6 +8,7 @@ use Neos\ContentRepository\Core\DimensionSpace\VariantType; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\NodeType\NodeTypeName; +use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFoundException; class DimensionAdjustment { @@ -23,7 +24,11 @@ public function __construct( */ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): iterable { - $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); + try { + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); + } catch (NodeTypeNotFoundException) { + return []; + } if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) { return []; } From 1e26367f157da90f31c5b3ed9c76aa0e64d42ac2 Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Tue, 31 Oct 2023 17:34:47 +0000 Subject: [PATCH 084/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index db800a743dd..6cdc4a8006d 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-30 +The following reference was automatically generated from code on 2023-10-31 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index ef9a41d5ec3..e51fb110524 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index b00941e25fb..7f5ed6f9a4b 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 427e9499787..255c6d56d7d 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 5cc7411beb5..9d72e37c545 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index b86f113cb4f..2bff5dd6769 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index d67b163e8d5..84f16afe1e9 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index be27b8852ad..088a158282f 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index daa32be4523..1bf3dda1b50 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 019af82d8bb..24d7154e1a5 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 63b58bea995..bf3133ca179 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index aaa1ecd7da7..549616fb937 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 97f22e73474..7ce0a458e3e 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index ac0f131011f..8a151aeb8f2 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 2088e00139b..41ef5999832 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index ca89fd6aa87..4d92f614eb4 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 75758d9a5d4..0fad77472a3 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 6aad805975c94cb87d445c2a006ab9eff081d578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= <christian@flownative.com> Date: Tue, 31 Oct 2023 18:54:02 +0100 Subject: [PATCH 085/113] BUGFIX: Html prototype is now a ContentComponent The HTML NodeType fusion renderer is now pure fusion, the behavior including attributes is kept. --- .../Resources/Private/Fusion/Html.fusion | 23 ++++++++++++++++--- .../Private/Templates/NodeTypes/Html.html | 3 --- 2 files changed, 20 insertions(+), 6 deletions(-) delete mode 100644 Neos.NodeTypes.Html/Resources/Private/Templates/NodeTypes/Html.html diff --git a/Neos.NodeTypes.Html/Resources/Private/Fusion/Html.fusion b/Neos.NodeTypes.Html/Resources/Private/Fusion/Html.fusion index 97f769333b2..a3f12bbe256 100644 --- a/Neos.NodeTypes.Html/Resources/Private/Fusion/Html.fusion +++ b/Neos.NodeTypes.Html/Resources/Private/Fusion/Html.fusion @@ -1,4 +1,21 @@ -prototype(Neos.NodeTypes.Html:Html) < prototype(Neos.Neos:Content) { - templatePath = "resource://Neos.NodeTypes.Html/Private/Templates/NodeTypes/Html.html" - source = ${q(node).property('source')} +prototype(Neos.NodeTypes.Html:Html) < prototype(Neos.Neos:ContentComponent) { + source = ${q(node).property('source')} + + attributes = Neos.Fusion:DataStructure + attributes.class = '' + + # The following is used to automatically append a class attribute that reflects the underlying node type of a Fusion object, + # for example "neos-nodetypes-form", "neos-nodetypes-headline", "neos-nodetypes-html", "neos-nodetypes-image", "neos-nodetypes-menu" and "neos-nodetypes-text" + # You can disable the following line with: + # prototype(Neos.Neos:Content) { + # attributes.class.@process.nodeType > + # } + # in your site's Fusion if you don't need that behavior. + attributes.class.@process.nodeType = ${Array.push(value, String.toLowerCase(String.pregReplace(node.nodeTypeName.value, '/[[:^alnum:]]/', '-')))} + + renderer = afx` + <div {...props.attributes}> + {props.source} + </div> + ` } diff --git a/Neos.NodeTypes.Html/Resources/Private/Templates/NodeTypes/Html.html b/Neos.NodeTypes.Html/Resources/Private/Templates/NodeTypes/Html.html deleted file mode 100644 index 66457545e79..00000000000 --- a/Neos.NodeTypes.Html/Resources/Private/Templates/NodeTypes/Html.html +++ /dev/null @@ -1,3 +0,0 @@ -<div{attributes -> f:format.raw()}> - {source -> f:format.raw()} -</div> From 9f7ee86d74d2126f8a3b7bace7334d9bcdba1cf2 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 31 Oct 2023 19:10:26 +0100 Subject: [PATCH 086/113] TASK: Fixup for pr #4641 --- .../Features/Fusion/ContentCollection.feature | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature index ed84afac431..edadc686621 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature @@ -27,33 +27,33 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype And the Fusion context node is "a" And the Fusion context request URI is "http://localhost" -# Scenario: missing Neos.Neos.ContentCollection node -# When I execute the following Fusion code: -# """fusion -# include: resource://Neos.Fusion/Private/Fusion/Root.fusion -# include: resource://Neos.Neos/Private/Fusion/Root.fusion -# -# test = Neos.Neos:ContentCollection -# """ -# Then I expect the following Fusion rendering error: -# """ -# No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. -# """ -# -# Scenario: invalid nodePath -# When I execute the following Fusion code: -# """fusion -# include: resource://Neos.Fusion/Private/Fusion/Root.fusion -# include: resource://Neos.Neos/Private/Fusion/Root.fusion -# -# test = Neos.Neos:ContentCollection { -# nodePath = 'invalid' -# } -# """ -# Then I expect the following Fusion rendering error: -# """ -# No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. -# """ + Scenario: missing Neos.Neos.ContentCollection node + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection + """ + Then I expect the following Fusion rendering error: + """ + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. + """ + + Scenario: invalid nodePath + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:ContentCollection { + nodePath = 'invalid' + } + """ + Then I expect the following Fusion rendering error: + """ + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. + """ Scenario: empty ContentCollection When I execute the following Fusion code: From ef540d8443def79a21681bbe4005c4b777f9e803 Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Tue, 31 Oct 2023 18:12:16 +0000 Subject: [PATCH 087/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 26610f8ca47..9d6d214ff65 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-30 +The following reference was automatically generated from code on 2023-10-31 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 76349c2ab6d..ee20f863532 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index b00941e25fb..7f5ed6f9a4b 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 427e9499787..255c6d56d7d 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 7cdacff934b..84d6aefe223 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index b86f113cb4f..2bff5dd6769 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 9abe6765be8..c1db8296650 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index c5aae5fbdc2..72e74a32150 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index daa32be4523..1bf3dda1b50 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 019af82d8bb..24d7154e1a5 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 63b58bea995..bf3133ca179 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index aaa1ecd7da7..549616fb937 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 97f22e73474..7ce0a458e3e 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index ac0f131011f..8a151aeb8f2 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 2088e00139b..41ef5999832 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index ca89fd6aa87..4d92f614eb4 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 75758d9a5d4..0fad77472a3 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-30 +This reference was automatically generated from code on 2023-10-31 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From d7c5aca196d2193f7a7138139db349d1f625cee3 Mon Sep 17 00:00:00 2001 From: Martin Ficzel <ficzel@sitegeist.de> Date: Tue, 31 Oct 2023 16:26:29 +0100 Subject: [PATCH 088/113] TASK: Adjust `Neos.Neos:BreadcrumbMenuItems` The prototype `Neos.Neos:BreadcrumbMenuItems` is now a standalone Component that does not inherit from `Neos.Neos:Menu` anymore. The Menu is used internally to calculate the MenuItems for the parent and the root. The following properties are supported by `Neos.Neos:BreadcrumbMenuItems`: - `maximumLevels` (integer) Restrict the maximum depth of items in the menu, defaults to `0` - `renderHiddenInIndex` (boolean) Whether nodes with ``hiddenInIndex`` should be rendered (the current documentNode is always included), defaults to `false`. - `calculateItemStates` (boolean) activate the *expensive* calculation of item states defaults to `false` The following changes compared to the previous implementation are detected: - The root document has the state `active` when `calculateItemStates` is set - The current document will have an url in the MenuItem. You can abstain from rendering the state by checking wether `state == current` - Other properties of `Neos.Neos:Menu` are not supported anymore as we do not inherit from Menu anymore --- .../Fusion/MenuItemsImplementation.php | 36 ++++++++++---- .../References/NeosFusionReference.rst | 6 ++- .../Fusion/Prototypes/BreadcrumbMenu.fusion | 8 ++- .../Prototypes/BreadcrumbMenuItems.fusion | 34 +++++++------ .../Behavior/Features/Fusion/Menu.feature | 49 ++++++++++--------- 5 files changed, 81 insertions(+), 52 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php index f88a11120b7..f8de8a9ca01 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php @@ -165,14 +165,18 @@ protected function buildItems(): array if (!is_null($this->getItemCollection())) { $items = []; foreach ($this->getItemCollection() as $node) { - $childSubtree = $subgraph->findSubtree( - $node->nodeAggregateId, - FindSubtreeFilter::create(nodeTypeConstraints: $this->getNodeTypeConstraints(), maximumLevels: $this->getMaximumLevels()) - ); - if ($childSubtree === null) { - continue; + if ($this->getMaximumLevels() > 0) { + $childSubtree = $subgraph->findSubtree( + $node->nodeAggregateId, + FindSubtreeFilter::create(nodeTypeConstraints: $this->getNodeTypeConstraints(), maximumLevels: $this->getMaximumLevels()) + ); + if ($childSubtree === null) { + continue; + } + $items[] = $this->buildMenuItemFromSubtree($childSubtree); + } else { + $items[] = $this->buildMenuItemFromNode($node); } - $items[] = $this->traverseChildren($childSubtree); } return $items; } @@ -189,17 +193,29 @@ protected function buildItems(): array if ($childSubtree === null) { return []; } - return $this->traverseChildren($childSubtree)->getChildren(); + return $this->buildMenuItemFromSubtree($childSubtree)->getChildren(); + } + + protected function buildMenuItemFromNode(Node $node): MenuItem + { + return new MenuItem( + $node, + $this->isCalculateItemStatesEnabled() ? $this->calculateItemState($node) : null, + $node->getLabel(), + 0, + [], + $this->buildUri($node) + ); } - protected function traverseChildren(Subtree $subtree): MenuItem + protected function buildMenuItemFromSubtree(Subtree $subtree): MenuItem { $children = []; foreach ($subtree->children as $childSubtree) { $node = $childSubtree->node; if (!$this->isNodeHidden($node)) { - $childNode = $this->traverseChildren($childSubtree); + $childNode = $this->buildMenuItemFromSubtree($childSubtree); $children[] = $childNode; } } diff --git a/Neos.Neos/Documentation/References/NeosFusionReference.rst b/Neos.Neos/Documentation/References/NeosFusionReference.rst index 742e8445eef..2f4aad1520e 100644 --- a/Neos.Neos/Documentation/References/NeosFusionReference.rst +++ b/Neos.Neos/Documentation/References/NeosFusionReference.rst @@ -1103,7 +1103,11 @@ Menu with absolute uris: Neos.Neos:BreadcrumbMenuItems ----------------------------- -Create a list of of menu-items for a breadcrumb (ancestor documents), based on :ref:`Neos_Neos__MenuItems`. +Create a list of of menu-items for the breadcrumb (ancestor documents). + +:maximumLevels: (integer) Restrict the maximum depth of items in the menu, defaults to ``0`` +:renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered (the current documentNode is always included), defaults to ``false``. +:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` Example:: diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion index 0a9b9fcc365..a93e64eccae 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion @@ -2,11 +2,15 @@ # prototype(Neos.Neos:BreadcrumbMenu) < prototype(Neos.Fusion:Component) { attributes = Neos.Fusion:DataStructure + maximumLevels = 0 + renderHiddenInIndex = false + calculateItemStates = false @private { items = Neos.Neos:BreadcrumbMenuItems { - @ignoreProperties = ${['attributes']} - @apply.props = ${props} + maximumLevels = ${props.maximumLevels} + renderHiddenInIndex = ${props.renderHiddenInIndex} + calculateItemStates = ${props.calculateItemStates} } } diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion index 3e66c9b455e..3a38f547737 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion @@ -1,19 +1,23 @@ -prototype(Neos.Neos:BreadcrumbMenuItems) < prototype(Neos.Neos:MenuItems) { - itemCollection = ${q(documentNode).parents('[instanceof Neos.Neos:Document]').get()} - maximumLevels = 0 +prototype(Neos.Neos:BreadcrumbMenuItems) < prototype(Neos.Fusion:Component) { + maximumLevels = 0 + renderHiddenInIndex = true + calculateItemStates = false - @process { - // Show always the current node, event when it is hidden in index - addCurrent = Neos.Fusion:Value { - currentItem = Neos.Neos:MenuItems { - calculateItemStates = ${props.calculateItemStates} - renderHiddenInIndex = true - maximumLevels = 0 - itemCollection = ${[documentNode]} - } - value = ${Array.concat(this.currentItem, value)} - } + renderer = Neos.Fusion:Value { + parentItems = Neos.Neos:MenuItems { + calculateItemStates = ${props.calculateItemStates} + renderHiddenInIndex = ${props.renderHiddenInIndex} + maximumLevels = ${props.maximumLevels} + itemCollection = ${Array.reverse(q(documentNode).parents('[instanceof Neos.Neos:Document]').get())} + } - reverseOrder = ${Array.reverse(value)} + currentItem = Neos.Neos:MenuItems { + calculateItemStates = ${props.calculateItemStates} + renderHiddenInIndex = true + maximumLevels = ${props.maximumLevels} + itemCollection = ${[documentNode]} } + + value = ${Array.concat(this.parentItems, this.currentItem)} + } } diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index ad7915da3b5..8b120f6e36f 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -507,27 +507,28 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes </ul> """ -# NOTE: This scenario currently breaks because the "breadcrumb" class attribute is missing and the item states are different than expected "active" vs "normal" for homepage -# Scenario: BreadcrumbMenu -# When I execute the following Fusion code: -# """fusion -# include: resource://Neos.Fusion/Private/Fusion/Root.fusion -# include: resource://Neos.Neos/Private/Fusion/Root.fusion -# -# test = Neos.Neos:BreadcrumbMenu { -# # calculate menu item state to get Neos < 9 behavior -# calculateItemStates = true -# } -# """ -# Then I expect the following Fusion rendering result as HTML: -# """html -# <ul class="breadcrumb"> -# <li class="normal"> -# <a href="/" title="Neos.Neos:Test.DocumentType1">Neos.Neos:Test.DocumentType1</a> -# </li> -# <li class="active"> -# <a href="/a1" title="Neos.Neos:Test.DocumentType1">Neos.Neos:Test.DocumentType1 (a1)</a> -# </li> -# <li class="current">Neos.Neos:Test.DocumentType2a</li> -# </ul> -# """ + Scenario: BreadcrumbMenu + When I execute the following Fusion code: + """fusion + include: resource://Neos.Fusion/Private/Fusion/Root.fusion + include: resource://Neos.Neos/Private/Fusion/Root.fusion + + test = Neos.Neos:BreadcrumbMenu { + # calculate menu item state to get Neos < 9 behavior + calculateItemStates = true + } + """ + Then I expect the following Fusion rendering result as HTML: + """html + <ul> + <li class="active"> + <a href="/" title="Neos.Neos:Site">Neos.Neos:Site</a> + </li> + <li class="active"> + <a href="/a1" title="Neos.Neos:Test.DocumentType1">Neos.Neos:Test.DocumentType1</a> + </li> + <li class="current"> + <a href="/a1/a1a" title="Neos.Neos:Test.DocumentType2a">Neos.Neos:Test.DocumentType2a</a> + </li> + </ul> + """ From 24a6d99e03e12338e689d874045824e1d68df05d Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:29:50 +0100 Subject: [PATCH 089/113] Revert "TASK: Legacy Asset extractor, handle if "unstructured" nodetype is not available" This reverts commit 9fce857f72e3ba60bf45732e3afd1637743c0434. --- .../Classes/NodeDataToAssetsProcessor.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php index e47b522337c..0d60b591cee 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php @@ -45,15 +45,15 @@ public function run(): ProcessorResult $numberOfErrors = 0; foreach ($this->nodeDataRows as $nodeDataRow) { $nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']); - if ($this->nodeTypeManager->hasNodeType($nodeTypeName)) { + try { $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); - foreach ($nodeType->getProperties() as $nodeTypePropertyName => $nodeTypePropertyValue) { - $propertyTypes[$nodeTypePropertyName] = $nodeTypePropertyValue['type'] ?? null; - } - } else { - $this->dispatch(Severity::WARNING, 'The node type "%s" of node "%s" is not available. Falling back to "string" typed properties.', $nodeTypeName->value, $nodeDataRow['identifier']); - $propertyTypes = []; + } catch (NodeTypeNotFoundException $exception) { + $numberOfErrors ++; + $this->dispatch(Severity::ERROR, '%s. Node: "%s"', $exception->getMessage(), $nodeDataRow['identifier']); + continue; } + // HACK the following line is required in order to fully initialize the node type + $nodeType->getFullConfiguration(); try { $properties = json_decode($nodeDataRow['properties'], true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -62,7 +62,7 @@ public function run(): ProcessorResult continue; } foreach ($properties as $propertyName => $propertyValue) { - $propertyType = $propertyTypes[$propertyName] ?? 'string'; // string is the fallback, in case the property is not defined or the node type does not exist. + $propertyType = $nodeType->getPropertyType($propertyName); foreach ($this->extractAssetIdentifiers($propertyType, $propertyValue) as $assetId) { if (array_key_exists($assetId, $this->processedAssetIds)) { continue; From 5cc5f89da182bc55f72ce6152b8bb9ef3368337a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anke=20H=C3=A4slich?= <anke@neos.io> Date: Wed, 1 Nov 2023 10:11:32 +0100 Subject: [PATCH 090/113] TASK: Fix style ci --- Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php b/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php index 77797c1a514..69d4c12e379 100644 --- a/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php +++ b/Neos.Media/Classes/Domain/Service/AssetVariantGenerator.php @@ -127,7 +127,6 @@ public function createVariant(AssetInterface $asset, string $presetIdentifier, s $createdVariant = null; $preset = $this->getVariantPresets()[$presetIdentifier] ?? null; if ($preset instanceof VariantPreset && $preset->matchesMediaType($asset->getMediaType())) { - $existingVariant = $asset->getVariant($presetIdentifier, $variantIdentifier); if ($existingVariant !== null) { return $existingVariant; From 7af08e48d3ee66231b139fd1cc93555d2e2ce65f Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:15:39 +0100 Subject: [PATCH 091/113] TASK: Fix unstructured node handling in legacy migration --- .../Classes/NodeDataToAssetsProcessor.php | 14 +++++++------- .../Classes/NodeDataToEventsProcessor.php | 14 +++++++++++--- .../Behavior/Bootstrap/FeatureContext.php | 2 +- .../Tests/Behavior/Features/Errors.feature | 4 ++-- .../Tests/Behavior/Features/Variants.feature | 19 ++++++++++--------- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php index 0d60b591cee..f96db3b58cc 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php @@ -44,16 +44,16 @@ public function run(): ProcessorResult { $numberOfErrors = 0; foreach ($this->nodeDataRows as $nodeDataRow) { + if ($nodeDataRow['path'] === '/sites') { + // the sites node has no properties and is unstructured + continue; + } $nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']); - try { - $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); - } catch (NodeTypeNotFoundException $exception) { - $numberOfErrors ++; - $this->dispatch(Severity::ERROR, '%s. Node: "%s"', $exception->getMessage(), $nodeDataRow['identifier']); + if (!$this->nodeTypeManager->hasNodeType($nodeTypeName)) { + $this->dispatch(Severity::ERROR, 'The node type "%s" is not available. Node: "%s"', $nodeTypeName->value, $nodeDataRow['identifier']); continue; } - // HACK the following line is required in order to fully initialize the node type - $nodeType->getFullConfiguration(); + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); try { $properties = json_decode($nodeDataRow['properties'], true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php index 4f8bb63a3e9..cc3ad13609b 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php @@ -256,16 +256,24 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $ $nodeName = end($pathParts); assert($nodeName !== false); $nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']); - $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); - $serializedPropertyValuesAndReferences = $this->extractPropertyValuesAndReferences($nodeDataRow, $nodeType); + + $nodeType = $this->nodeTypeManager->hasNodeType($nodeTypeName) ? $this->nodeTypeManager->getNodeType($nodeTypeName) : null; $isSiteNode = $nodeDataRow['parentpath'] === '/sites'; - if ($isSiteNode && !$nodeType->isOfType(NodeTypeNameFactory::NAME_SITE)) { + if ($isSiteNode && !$nodeType?->isOfType(NodeTypeNameFactory::NAME_SITE)) { throw new MigrationException(sprintf( 'The site node "%s" (type: "%s") must be of type "%s"', $nodeDataRow['identifier'], $nodeTypeName->value, NodeTypeNameFactory::NAME_SITE ), 1695801620); } + if (!$nodeType) { + $this->dispatch(Severity::ERROR, 'The node type "%s" is not available. Node: "%s"', $nodeTypeName->value, $nodeDataRow['identifier']); + return; + } + + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); + $serializedPropertyValuesAndReferences = $this->extractPropertyValuesAndReferences($nodeDataRow, $nodeType); + if ($this->isAutoCreatedChildNode($parentNodeAggregate->nodeTypeName, $nodeName) && !$this->visitedNodes->containsNodeAggregate($nodeAggregateId)) { // Create tethered node if the node was not found before. // If the node was already visited, we want to create a node variant (and keep the tethering status) diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php index 53b87836684..32b714bbbb3 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php @@ -193,7 +193,7 @@ public function iExpectTheFollowingEventsToBeExported(TableNode $table): void */ public function iExpectTheFollwingErrorsToBeLogged(TableNode $table): void { - Assert::assertSame($this->loggedErrors, $table->getColumn(0), 'Expected logged errors do not match'); + Assert::assertSame($table->getColumn(0), $this->loggedErrors, 'Expected logged errors do not match'); $this->loggedErrors = []; } diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature index 33af167cd03..5058e8674d6 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature @@ -100,11 +100,11 @@ Feature: Exceptional cases during migrations When I have the following node data rows: | Identifier | Path | Properties | Node Type | | sites | /sites | | | - | a | /sites/a | not json | Some.Package:SomeNodeType | + | a | /sites/a | not json | Some.Package:Homepage | And I run the event migration Then I expect a MigrationError with the message """ - Failed to decode properties "not json" of node "a" (type: "Some.Package:SomeNodeType"): Could not convert database value "not json" to Doctrine Type flow_json_array + Failed to decode properties "not json" of node "a" (type: "Some.Package:Homepage"): Could not convert database value "not json" to Doctrine Type flow_json_array """ Scenario: Node variants with the same dimension diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature index a0e35e8fc92..40ff8fca40a 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature @@ -11,6 +11,7 @@ Feature: Migrating nodes with content dimensions 'Some.Package:Homepage': superTypes: 'Neos.Neos:Site': true + 'Some.Package:Thing': {} """ And using identifier "default", I define a content repository And I am in content repository "default" @@ -66,10 +67,10 @@ Feature: Migrating nodes with content dimensions | Identifier | Path | Node Type | Dimension Values | | sites | /sites | unstructured | | | site | /sites/site | Some.Package:Homepage | {"language": ["de"]} | - | a | /sites/site/a | unstructured | {"language": ["de"]} | - | a1 | /sites/site/a/a1 | unstructured | {"language": ["de"]} | - | b | /sites/site/b | unstructured | {"language": ["de"]} | - | a1 | /sites/site/b/a1 | unstructured | {"language": ["ch"]} | + | a | /sites/site/a | Some.Package:Thing | {"language": ["de"]} | + | a1 | /sites/site/a/a1 | Some.Package:Thing | {"language": ["de"]} | + | b | /sites/site/b | Some.Package:Thing | {"language": ["de"]} | + | a1 | /sites/site/b/a1 | Some.Package:Thing | {"language": ["ch"]} | And I run the event migration Then I expect the following events to be exported | Type | Payload | @@ -87,11 +88,11 @@ Feature: Migrating nodes with content dimensions | Identifier | Path | Node Type | Dimension Values | | sites | /sites | unstructured | | | site | /sites/site | Some.Package:Homepage | {"language": ["de"]} | - | a | /sites/site/a | unstructured | {"language": ["de"]} | - | a1 | /sites/site/a/a1 | unstructured | {"language": ["de"]} | - | b | /sites/site/b | unstructured | {"language": ["de"]} | - | a | /sites/site/b/a | unstructured | {"language": ["ch"]} | - | a1 | /sites/site/b/a/a1 | unstructured | {"language": ["ch"]} | + | a | /sites/site/a | Some.Package:Thing | {"language": ["de"]} | + | a1 | /sites/site/a/a1 | Some.Package:Thing | {"language": ["de"]} | + | b | /sites/site/b | Some.Package:Thing | {"language": ["de"]} | + | a | /sites/site/b/a | Some.Package:Thing | {"language": ["ch"]} | + | a1 | /sites/site/b/a/a1 | Some.Package:Thing | {"language": ["ch"]} | And I run the event migration Then I expect the following events to be exported | Type | Payload | From 5eff61f16a3a8a45d13d16f8c2f5056753db95b4 Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Wed, 1 Nov 2023 10:23:25 +0000 Subject: [PATCH 092/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 6cdc4a8006d..32c58f5c43f 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-31 +The following reference was automatically generated from code on 2023-11-01 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index e51fb110524..95b18b8f19f 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 7f5ed6f9a4b..313561e3f2d 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 255c6d56d7d..62af6be6d29 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 9d72e37c545..42be9bab0bb 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 2bff5dd6769..c85d2749301 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 84f16afe1e9..121f6f90427 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 088a158282f..f27c7162447 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 1bf3dda1b50..4ab02a7bfcf 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 24d7154e1a5..4a838dacc18 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index bf3133ca179..096af561261 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 549616fb937..8fd558f5957 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 7ce0a458e3e..31197ac31f0 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 8a151aeb8f2..9879c19d84d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 41ef5999832..895e7e0a245 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index 4d92f614eb4..a82cac259fe 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 0fad77472a3..adfa88e2413 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From c335717fcfeeeb796ca03453ceea899c13107c55 Mon Sep 17 00:00:00 2001 From: Martin Ficzel <ficzel@sitegeist.de> Date: Tue, 31 Oct 2023 19:48:22 +0100 Subject: [PATCH 093/113] TASK: Adjust `Neos.Neos:MenuItems` The starting point is now calculated from the cached list of ancestors and the lastLevel is respected again. The calculation of the ancestors will now includes all documents without further filtering. --- .../Fusion/MenuItemsImplementation.php | 168 +++++++----------- .../Behavior/Features/Fusion/Menu.feature | 165 +++++++++-------- 2 files changed, 153 insertions(+), 180 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php index f8de8a9ca01..c8f67bace29 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php @@ -15,6 +15,8 @@ namespace Neos\Neos\Fusion; use Neos\ContentRepository\Core\NodeType\NodeTypeName; +use Neos\ContentRepository\Core\NodeType\NodeTypeNames; +use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindSubtreeFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; @@ -39,24 +41,18 @@ class MenuItemsImplementation extends AbstractMenuItemsImplementation /** * Internal cache for the startingPoint tsValue. - * - * @var Node */ - protected $startingPoint; + protected ?Node $startingPoint = null; /** * Internal cache for the lastLevel value. - * - * @var integer */ - protected $lastLevel; + protected ?int $lastLevel = null; /** * Internal cache for the maximumLevels tsValue. - * - * @var integer */ - protected $maximumLevels; + protected ?int $maximumLevels = null; /** * Internal cache for the ancestors aggregate ids of the currentNode. @@ -78,20 +74,16 @@ class MenuItemsImplementation extends AbstractMenuItemsImplementation * -1 = one level above the current page * -2 = two levels above the current page * ... - * - * @return integer */ - public function getEntryLevel() + public function getEntryLevel(): int { return $this->fusionValue('entryLevel'); } /** * NodeType filter for nodes displayed in menu - * - * @return string */ - public function getFilter() + public function getFilter(): string { $filter = $this->fusionValue('filter'); if ($filter === null) { @@ -103,10 +95,8 @@ public function getFilter() /** * Maximum number of levels which should be rendered in this menu. - * - * @return integer */ - public function getMaximumLevels() + public function getMaximumLevels(): int { if ($this->maximumLevels === null) { $this->maximumLevels = $this->fusionValue('maximumLevels'); @@ -120,10 +110,8 @@ public function getMaximumLevels() /** * Return evaluated lastLevel value. - * - * @return integer */ - public function getLastLevel(): int + public function getLastLevel(): ?int { if ($this->lastLevel === null) { $this->lastLevel = $this->fusionValue('lastLevel'); @@ -168,12 +156,12 @@ protected function buildItems(): array if ($this->getMaximumLevels() > 0) { $childSubtree = $subgraph->findSubtree( $node->nodeAggregateId, - FindSubtreeFilter::create(nodeTypeConstraints: $this->getNodeTypeConstraints(), maximumLevels: $this->getMaximumLevels()) + FindSubtreeFilter::create(nodeTypeConstraints: $this->getNodeTypeConstraints(), maximumLevels: $this->getMaximumLevels() - 1) ); if ($childSubtree === null) { continue; } - $items[] = $this->buildMenuItemFromSubtree($childSubtree); + $items[] = $this->buildMenuItemFromSubtree($childSubtree, 1); } else { $items[] = $this->buildMenuItemFromNode($node); } @@ -181,14 +169,42 @@ protected function buildItems(): array return $items; } - $entryParentNode = $this->findMenuStartingPoint(); - if (!$entryParentNode) { + $entryParentNodeAggregateId = $this->findMenuStartingPointAggregateId(); + if (!$entryParentNodeAggregateId) { return []; } + $maximumLevels = $this->getMaximumLevels(); + $lastLevels = $this->getLastLevel(); + if ($lastLevels !== 0) { + $depthOfEntryParentNodeAggregateId = $subgraph->countAncestorNodes( + $entryParentNodeAggregateId, + CountAncestorNodesFilter::create( + NodeTypeConstraints::createWithAllowedNodeTypeNames( + NodeTypeNames::with( + NodeTypeNameFactory::forDocument() + ) + ) + ) + ); + + if ($lastLevels > 0) { + $maxLevelsBasedOnLastLevel = max($lastLevels - $depthOfEntryParentNodeAggregateId, 0); + $maximumLevels = min($maximumLevels, $maxLevelsBasedOnLastLevel); + } elseif ($lastLevels < 0) { + $currentNodeAncestorAggregateIds = $this->getCurrentNodeAncestorAggregateIds(); + $depthOfCurrentDocument = count(iterator_to_array($currentNodeAncestorAggregateIds)); + $maxLevelsBasedOnLastLevel = max($depthOfCurrentDocument + $lastLevels - $depthOfEntryParentNodeAggregateId + 1, 0); + $maximumLevels = min($maximumLevels, $maxLevelsBasedOnLastLevel); + } + } + $childSubtree = $subgraph->findSubtree( - $entryParentNode->nodeAggregateId, - FindSubtreeFilter::create(nodeTypeConstraints: $this->getNodeTypeConstraints(), maximumLevels: $this->getMaximumLevels()) + $entryParentNodeAggregateId, + FindSubtreeFilter::create( + nodeTypeConstraints: $this->getNodeTypeConstraints(), + maximumLevels: $maximumLevels + ) ); if ($childSubtree === null) { return []; @@ -208,14 +224,14 @@ protected function buildMenuItemFromNode(Node $node): MenuItem ); } - protected function buildMenuItemFromSubtree(Subtree $subtree): MenuItem + protected function buildMenuItemFromSubtree(Subtree $subtree, int $startLevel = 0): MenuItem { $children = []; foreach ($subtree->children as $childSubtree) { $node = $childSubtree->node; if (!$this->isNodeHidden($node)) { - $childNode = $this->buildMenuItemFromSubtree($childSubtree); + $childNode = $this->buildMenuItemFromSubtree($childSubtree, $startLevel); $children[] = $childNode; } } @@ -226,7 +242,7 @@ protected function buildMenuItemFromSubtree(Subtree $subtree): MenuItem $node, $this->isCalculateItemStatesEnabled() ? $this->calculateItemState($node) : null, $node->getLabel(), - $subtree->level, + $subtree->level + $startLevel, $children, $this->buildUri($node) ); @@ -239,17 +255,14 @@ protected function buildMenuItemFromSubtree(Subtree $subtree): MenuItem * * If entryLevel is configured this will be taken into account as well. * - * @return Node|null + * @return NodeAggregateId|null * @throws FusionException */ - protected function findMenuStartingPoint(): ?Node + protected function findMenuStartingPointAggregateId(): ?NodeAggregateId { $fusionContext = $this->runtime->getCurrentContext(); $traversalStartingPoint = $this->getStartingPoint() ?: $fusionContext['node'] ?? null; - $contentRepositoryId = $this->currentNode->subgraphIdentity->contentRepositoryId; - $contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId); - if (!$traversalStartingPoint instanceof Node) { throw new FusionException( 'You must either set a "startingPoint" for the menu or "node" must be set in the Fusion context.', @@ -258,59 +271,22 @@ protected function findMenuStartingPoint(): ?Node } if ($this->getEntryLevel() === 0) { - $entryParentNode = $traversalStartingPoint; + return $traversalStartingPoint->nodeAggregateId; } elseif ($this->getEntryLevel() < 0) { - $nodeTypeConstraintsWithSubNodeTypes = NodeTypeConstraintsWithSubNodeTypes::create( - $this->getNodeTypeConstraints(), - $contentRepository->getNodeTypeManager() - ); - $remainingIterations = abs($this->getEntryLevel()); - $entryParentNode = null; - $this->traverseUpUntilCondition( - $traversalStartingPoint, - function (Node $node) use ( - &$remainingIterations, - &$entryParentNode, - $nodeTypeConstraintsWithSubNodeTypes - ) { - if (!$nodeTypeConstraintsWithSubNodeTypes->matches($node->nodeTypeName)) { - return false; - } - - if ($remainingIterations > 0) { - $remainingIterations--; - - return true; - } else { - $entryParentNode = $node; - - return false; - } - } - ); + $ancestorNodeAggregateIds = $this->getCurrentNodeAncestorAggregateIds(); + if ($ancestorNodeAggregateIds === null) { + return null; + } + $ancestorNodeAggregateIdArray = array_values(iterator_to_array($ancestorNodeAggregateIds)); + return $ancestorNodeAggregateIdArray[$this->getEntryLevel() * -1 - 1] ?? null; } else { - $traversedHierarchy = []; - $nodeTypeConstraintsWithSubNodeTypes = NodeTypeConstraintsWithSubNodeTypes::create( - $this->getNodeTypeConstraints()->withAdditionalDisallowedNodeType( - NodeTypeNameFactory::forSites() - ), - $contentRepository->getNodeTypeManager() - ); - $this->traverseUpUntilCondition( - $traversalStartingPoint, - function (Node $traversedNode) use (&$traversedHierarchy, $nodeTypeConstraintsWithSubNodeTypes) { - if (!$nodeTypeConstraintsWithSubNodeTypes->matches($traversedNode->nodeTypeName)) { - return false; - } - $traversedHierarchy[] = $traversedNode; - return true; - } - ); - $traversedHierarchy = array_reverse($traversedHierarchy); - - $entryParentNode = $traversedHierarchy[$this->getEntryLevel() - 1] ?? null; + $ancestorNodeAggregateIds = $this->getCurrentNodeAncestorAggregateIds(); + if ($ancestorNodeAggregateIds === null) { + return null; + } + $ancestorNodeAggregateIdArray = array_reverse(array_values(iterator_to_array($ancestorNodeAggregateIds))); + return $ancestorNodeAggregateIdArray[$this->getEntryLevel() - 1] ?? null; } - return $entryParentNode; } protected function getNodeTypeConstraints(): NodeTypeConstraints @@ -318,24 +294,9 @@ protected function getNodeTypeConstraints(): NodeTypeConstraints if (!$this->nodeTypeConstraints) { $this->nodeTypeConstraints = NodeTypeConstraints::fromFilterString($this->getFilter()); } - return $this->nodeTypeConstraints; } - /** - * the callback always gets the current Node passed as first parameter, - * and then its parent, and its parent etc etc. - * Until it has reached the root, or the return value of the closure is FALSE. - */ - protected function traverseUpUntilCondition(Node $node, \Closure $callback): void - { - $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); - do { - $shouldContinueTraversal = $callback($node); - $node = $subgraph->findParentNode($node->nodeAggregateId); - } while ($shouldContinueTraversal !== false && $node !== null); - } - public function getCurrentNodeAncestorAggregateIds(): NodeAggregateIds { if ($this->currentNodeAncestorAggregateIds instanceof NodeAggregateIds) { @@ -345,9 +306,14 @@ public function getCurrentNodeAncestorAggregateIds(): NodeAggregateIds $currentNodeAncestors = $subgraph->findAncestorNodes( $this->currentNode->nodeAggregateId, FindAncestorNodesFilter::create( - $this->getNodeTypeConstraints() + NodeTypeConstraints::createWithAllowedNodeTypeNames( + NodeTypeNames::with( + NodeTypeNameFactory::forDocument() + ) + ) ) ); + $this->currentNodeAncestorAggregateIds = NodeAggregateIds::fromNodes($currentNodeAncestors); return $this->currentNodeAncestorAggregateIds; } diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index 8b120f6e36f..c1e5f225070 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -130,6 +130,22 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes """ + Scenario: MenuItems (default on home page) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems + } + """ + And the Fusion context node is "a" + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1a* (2) + a1b (2) + + """ + Scenario: MenuItems (maximumLevels = 3) When I execute the following Fusion code: """fusion @@ -150,23 +166,19 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes """ -# NOTE: This scenario currently breaks because the actual output is empty -# Scenario: MenuItems (entryLevel = -5) -# When I execute the following Fusion code: -# """fusion -# test = Neos.Neos:Test.Menu { -# items = Neos.Neos:MenuItems { -# entryLevel = -5 -# } -# } -# """ -# Then I expect the following Fusion rendering result: -# """ -# a1. (1) -# a1a* (2) -# a1b (2) -# -# """ + Scenario: MenuItems (entryLevel = -5) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + entryLevel = -5 + } + } + """ + Then I expect the following Fusion rendering result: + """ + + """ Scenario: MenuItems (entryLevel = -1) @@ -235,21 +247,19 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes """ -# NOTE: This scenario currently breaks because the actual output is "a1., a1a*, a1b" -# Scenario: MenuItems (lastLevel = -5) -# When I execute the following Fusion code: -# """fusion -# test = Neos.Neos:Test.Menu { -# items = Neos.Neos:MenuItems { -# lastLevel = -5 -# } -# } -# """ -# Then I expect the following Fusion rendering result: -# """ -# a1. (1) -# -# """ + Scenario: MenuItems (lastLevel = -5) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = -5 + } + } + """ + Then I expect the following Fusion rendering result: + """ + + """ Scenario: MenuItems (lastLevel = -1) When I execute the following Fusion code: @@ -285,21 +295,20 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes """ -# NOTE: This scenario currently breaks because the actual output is "a1., a1a*, a1b" -# Scenario: MenuItems (lastLevel = 1) -# When I execute the following Fusion code: -# """fusion -# test = Neos.Neos:Test.Menu { -# items = Neos.Neos:MenuItems { -# lastLevel = 1 -# } -# } -# """ -# Then I expect the following Fusion rendering result: -# """ -# a1. (1) -# -# """ + Scenario: MenuItems (lastLevel = 1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + lastLevel = 1 + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + + """ Scenario: MenuItems (filter non existing node type) When I execute the following Fusion code: @@ -314,22 +323,21 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes """ """ -# NOTE: This scenario currently breaks because the actual output is empty -# Scenario: MenuItems (filter = DocumentType1) -# When I execute the following Fusion code: -# """fusion -# test = Neos.Neos:Test.Menu { -# items = Neos.Neos:MenuItems { -# filter = 'Neos.Neos:Test.DocumentType1' -# } -# } -# """ -# Then I expect the following Fusion rendering result: -# """ -# a1. (1) -# a1b (2) -# -# """ + Scenario: MenuItems (filter = DocumentType1) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + filter = 'Neos.Neos:Test.DocumentType1' + } + } + """ + Then I expect the following Fusion rendering result: + """ + a1. (1) + a1b (2) + + """ Scenario: MenuItems (filter = DocumentType2) When I execute the following Fusion code: @@ -376,22 +384,21 @@ Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes """ """ -# NOTE: This scenario currently breaks because the actual output is "a., a1., a1a*, a1b" -# Scenario: MenuItems (itemCollection document nodes) -# When I execute the following Fusion code: -# """fusion -# test = Neos.Neos:Test.Menu { -# items = Neos.Neos:MenuItems { -# itemCollection = ${q(site).filter('[instanceof Neos.Neos:Document]').get()} -# } -# } -# """ -# Then I expect the following Fusion rendering result: -# """ -# a (1) -# a1. (2) -# -# """ + Scenario: MenuItems (itemCollection document nodes) + When I execute the following Fusion code: + """fusion + test = Neos.Neos:Test.Menu { + items = Neos.Neos:MenuItems { + itemCollection = ${q(site).filter('[instanceof Neos.Neos:Document]').get()} + } + } + """ + Then I expect the following Fusion rendering result: + """ + a. (1) + a1. (2) + + """ Scenario: MenuItems (startingPoint a1b1) When I execute the following Fusion code: From 74fba4d7f35cd0b90a5ed84d68d809bd446526ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= <christian@flownative.com> Date: Wed, 1 Nov 2023 14:46:34 +0100 Subject: [PATCH 094/113] TASK: NodeController::show drop support for showInvisible This was a hidden feature in previous versions of Neos but was broken in various ways since years. First of all I think we prevented live workspace with show invisible in other parts of the code in the first place. There is also no route for this so you would have to know to use this as a GET argument. Could work apart from two further issues: The check for backend policy access won't work in any installation with the Flowpack.FrontendLogin package as that prevents backend roles on the frontend (show) route, this is the case eg. for the demo site. Even IF that is not the case and the conditions are successfully met, the showInvisible will work but the Fusion cache doesn't know about it, as cache identifiers currently do not contain visibility constraints, therefore this feature is dangerous as a visit from an authenticated user might store a cache entry with information that should not be visible to to the public. --- .../Classes/Controller/Frontend/NodeController.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Neos.Neos/Classes/Controller/Frontend/NodeController.php b/Neos.Neos/Classes/Controller/Frontend/NodeController.php index 8f8c450cef2..3dbbbd28b9b 100644 --- a/Neos.Neos/Classes/Controller/Frontend/NodeController.php +++ b/Neos.Neos/Classes/Controller/Frontend/NodeController.php @@ -198,7 +198,7 @@ public function previewAction(string $node): void * with unsafe requests from widgets or plugins that are rendered on the node * - For those the CSRF token is validated on the sub-request, so it is safe to be skipped here */ - public function showAction(string $node, bool $showInvisible = false): void + public function showAction(string $node): void { $siteDetectionResult = SiteDetectionResult::fromRequest($this->request->getHttpRequest()); $contentRepository = $this->contentRepositoryRegistry->get($siteDetectionResult->contentRepositoryId); @@ -208,15 +208,10 @@ public function showAction(string $node, bool $showInvisible = false): void throw new NodeNotFoundException('The requested node isn\'t accessible to the current user', 1430218623); } - $visibilityConstraints = VisibilityConstraints::frontend(); - if ($showInvisible && $this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess')) { - $visibilityConstraints = VisibilityConstraints::withoutRestrictions(); - } - $subgraph = $contentRepository->getContentGraph()->getSubgraph( $nodeAddress->contentStreamId, $nodeAddress->dimensionSpacePoint, - $visibilityConstraints + VisibilityConstraints::frontend() ); $site = $this->nodeSiteResolvingService->findSiteNodeForNodeAddress( @@ -231,7 +226,7 @@ public function showAction(string $node, bool $showInvisible = false): void $nodeInstance = $subgraph->findNodeById($nodeAddress->nodeAggregateId); - if (is_null($nodeInstance)) { + if ($nodeInstance === null) { throw new NodeNotFoundException('The requested node does not exist', 1596191460); } From 7e2a09c286b8dc70d13b43fc1c3cb9421c85cbe5 Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Wed, 1 Nov 2023 15:11:51 +0100 Subject: [PATCH 095/113] Sort siblings before reassigning positions --- .../DoctrineDbalContentGraphProjection.php | 12 +- .../Domain/Projection/Feature/NodeMove.php | 1 - .../MoveNodeAggregate.feature | 0 ...eringDisableStateWithoutDimensions.feature | 0 ...MoveNodeAggregateWithoutDimensions.feature | 0 ...NodeAggregate_NewParent_Dimensions.feature | 0 ...deAggregate_NoNewParent_Dimensions.feature | 282 +++++++++++------- 7 files changed, 188 insertions(+), 107 deletions(-) rename Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/{NodeMove => 08-NodeMove}/MoveNodeAggregate.feature (100%) rename Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/{NodeMove => 08-NodeMove}/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature (100%) rename Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/{NodeMove => 08-NodeMove}/MoveNodeAggregateWithoutDimensions.feature (100%) rename Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/{NodeMove => 08-NodeMove}/MoveNodeAggregate_NewParent_Dimensions.feature (100%) rename Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/{NodeMove => 08-NodeMove}/MoveNodeAggregate_NoNewParent_Dimensions.feature (64%) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index 807679337c5..e44fd08d16e 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -517,12 +517,6 @@ private function connectHierarchy( } /** - * @param NodeRelationAnchorPoint|null $parentAnchorPoint - * @param NodeRelationAnchorPoint|null $childAnchorPoint - * @param NodeRelationAnchorPoint|null $succeedingSiblingAnchorPoint - * @param ContentStreamId $contentStreamId - * @param DimensionSpacePoint $dimensionSpacePoint - * @return int * @throws \Doctrine\DBAL\DBALException */ private function getRelationPosition( @@ -590,6 +584,12 @@ private function getRelationPositionAfterRecalculation( $dimensionSpacePoint ); + usort( + $hierarchyRelations, + fn (HierarchyRelation $relationA, HierarchyRelation $relationB): int + => $relationA->position <=> $relationB->position + ); + foreach ($hierarchyRelations as $relation) { $offset += self::RELATION_DEFAULT_OFFSET; if ( diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php index f2e032259f7..e32b01fb641 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php @@ -44,7 +44,6 @@ private function whenNodeAggregateWasMoved(NodeAggregateWasMoved $event): void $this->transactional(function () use ($event) { foreach ($event->nodeMoveMappings as $moveNodeMapping) { // for each materialized node in the DB which we want to adjust, we have one MoveNodeMapping. - /* @var \Neos\ContentRepository\Core\Feature\NodeMove\Dto\OriginNodeMoveMapping $moveNodeMapping */ $nodeToBeMoved = $this->getProjectionContentGraph()->findNodeByIds( $event->contentStreamId, $event->nodeAggregateId, diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate.feature similarity index 100% rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate.feature rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate.feature diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature similarity index 100% rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateWithoutDimensions.feature similarity index 100% rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateWithoutDimensions.feature rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateWithoutDimensions.feature diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature similarity index 100% rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature similarity index 64% rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature index c90dc25ff35..95e2549cd30 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature @@ -19,85 +19,85 @@ Feature: Move a node with content dimensions And using identifier "default", I define a content repository And I am in content repository "default" And the command CreateRootWorkspace is executed with payload: - | Key | Value | - | workspaceName | "live" | - | workspaceTitle | "Live" | - | workspaceDescription | "The live workspace" | - | newContentStreamId | "cs-identifier" | + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | And the graph projection is fully up to date And the command CreateRootNodeAggregateWithNode is executed with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "lady-eleonode-rootford" | - | nodeTypeName | "Neos.ContentRepository:Root" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "sir-david-nodenborough" | - | nodeTypeName | "Neos.ContentRepository.Testing:Document" | - | originDimensionSpacePoint | {"language": "mul"} | - | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | - | parentNodeAggregateId | "lady-eleonode-rootford" | - | nodeName | "document" | - | nodeAggregateClassification | "regular" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "sir-david-nodenborough" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {"language": "mul"} | + | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | + | parentNodeAggregateId | "lady-eleonode-rootford" | + | nodeName | "document" | + | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "anthony-destinode" | - | nodeTypeName | "Neos.ContentRepository.Testing:Document" | - | originDimensionSpacePoint | {"language": "mul"} | - | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | - | parentNodeAggregateId | "sir-david-nodenborough" | - | nodeName | "child-document-a" | - | nodeAggregateClassification | "regular" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "anthony-destinode" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {"language": "mul"} | + | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | + | parentNodeAggregateId | "sir-david-nodenborough" | + | nodeName | "child-document-a" | + | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "berta-destinode" | - | nodeTypeName | "Neos.ContentRepository.Testing:Document" | - | originDimensionSpacePoint | {"language": "mul"} | - | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | - | parentNodeAggregateId | "sir-david-nodenborough" | - | nodeName | "child-document-b" | - | nodeAggregateClassification | "regular" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "berta-destinode" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {"language": "mul"} | + | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | + | parentNodeAggregateId | "sir-david-nodenborough" | + | nodeName | "child-document-b" | + | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "nody-mc-nodeface" | - | nodeTypeName | "Neos.ContentRepository.Testing:Document" | - | originDimensionSpacePoint | {"language": "mul"} | - | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | - | parentNodeAggregateId | "sir-david-nodenborough" | - | nodeName | "child-document-n" | - | nodeAggregateClassification | "regular" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nody-mc-nodeface" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {"language": "mul"} | + | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | + | parentNodeAggregateId | "sir-david-nodenborough" | + | nodeName | "child-document-n" | + | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "carl-destinode" | - | nodeTypeName | "Neos.ContentRepository.Testing:Document" | - | originDimensionSpacePoint | {"language": "mul"} | - | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | - | parentNodeAggregateId | "sir-david-nodenborough" | - | nodeName | "child-document-c" | - | nodeAggregateClassification | "regular" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "carl-destinode" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {"language": "mul"} | + | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | + | parentNodeAggregateId | "sir-david-nodenborough" | + | nodeName | "child-document-c" | + | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: - | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "sir-nodeward-nodington-iii" | - | nodeTypeName | "Neos.ContentRepository.Testing:Document" | - | originDimensionSpacePoint | {"language": "mul"} | - | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | - | parentNodeAggregateId | "lady-eleonode-rootford" | - | nodeName | "esquire" | - | nodeAggregateClassification | "regular" | + | Key | Value | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "sir-nodeward-nodington-iii" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {"language": "mul"} | + | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] | + | parentNodeAggregateId | "lady-eleonode-rootford" | + | nodeName | "esquire" | + | nodeAggregateClassification | "regular" | And the graph projection is fully up to date Scenario: Move a complete node aggregate before the first of its siblings When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newParentNodeAggregateId | null | | newSucceedingSiblingNodeAggregateId | "anthony-destinode" | And the graph projection is fully up to date @@ -115,20 +115,20 @@ Feature: Move a node with content dimensions Scenario: Move a complete node aggregate before the first of its siblings - which does not exist in all variants Given the event NodeAggregateWasRemoved was published with payload: | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "anthony-destinode" | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "anthony-destinode" | | affectedOccupiedDimensionSpacePoints | [] | | affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newParentNodeAggregateId | null | | newSucceedingSiblingNodeAggregateId | "anthony-destinode" | - | relationDistributionStrategy | "gatherAll" | + | relationDistributionStrategy | "gatherAll" | And the graph projection is fully up to date When I am in content stream "cs-identifier" and dimension space point {"language": "mul"} @@ -152,10 +152,10 @@ Feature: Move a node with content dimensions Scenario: Move a complete node aggregate before another of its siblings When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newParentNodeAggregateId | null | | newSucceedingSiblingNodeAggregateId | "berta-destinode" | And the graph projection is fully up to date @@ -174,17 +174,17 @@ Feature: Move a node with content dimensions Scenario: Move a complete node aggregate before another of its siblings - which does not exist in all variants Given the event NodeAggregateWasRemoved was published with payload: | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "berta-destinode" | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "berta-destinode" | | affectedOccupiedDimensionSpacePoints | [] | | affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newParentNodeAggregateId | null | | newSucceedingSiblingNodeAggregateId | "berta-destinode" | And the graph projection is fully up to date @@ -213,17 +213,17 @@ Feature: Move a node with content dimensions Scenario: Move a complete node aggregate after another of its siblings - which does not exist in all variants Given the event NodeAggregateWasRemoved was published with payload: | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "carl-destinode" | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "carl-destinode" | | affectedOccupiedDimensionSpacePoints | [] | | affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newParentNodeAggregateId | null | | newPrecedingSiblingNodeAggregateId | "berta-destinode" | And the graph projection is fully up to date @@ -251,17 +251,17 @@ Feature: Move a node with content dimensions Scenario: Move a complete node aggregate after the last of its siblings - with a predecessor which does not exist in all variants Given the event NodeAggregateWasRemoved was published with payload: | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "carl-destinode" | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "carl-destinode" | | affectedOccupiedDimensionSpacePoints | [] | | affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newParentNodeAggregateId | null | | newSucceedingSiblingNodeAggregateId | null | And the graph projection is fully up to date @@ -287,12 +287,12 @@ Feature: Move a node with content dimensions Scenario: Move a single node before the first of its siblings When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newSucceedingSiblingNodeAggregateId | "anthony-destinode" | - | relationDistributionStrategy | "scatter" | + | relationDistributionStrategy | "scatter" | And the graph projection is fully up to date When I am in content stream "cs-identifier" and dimension space point {"language": "mul"} @@ -318,12 +318,12 @@ Feature: Move a node with content dimensions Scenario: Move a single node between two of its siblings When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "mul"} | + | dimensionSpacePoint | {"language": "mul"} | | newSucceedingSiblingNodeAggregateId | "berta-destinode" | - | relationDistributionStrategy | "scatter" | + | relationDistributionStrategy | "scatter" | And the graph projection is fully up to date When I am in content stream "cs-identifier" and dimension space point {"language": "mul"} @@ -351,8 +351,8 @@ Feature: Move a node with content dimensions Scenario: Move a single node to the end of its siblings When the command MoveNodeAggregate is executed with payload: | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "nody-mc-nodeface" | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nody-mc-nodeface" | | dimensionSpacePoint | {"language": "mul"} | | relationDistributionStrategy | "scatter" | And the graph projection is fully up to date @@ -380,12 +380,12 @@ Feature: Move a node with content dimensions Scenario: Move a node and its specializations before the first of its siblings When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "de"} | + | dimensionSpacePoint | {"language": "de"} | | newSucceedingSiblingNodeAggregateId | "anthony-destinode" | - | relationDistributionStrategy | "gatherSpecializations" | + | relationDistributionStrategy | "gatherSpecializations" | And the graph projection is fully up to date When I am in content stream "cs-identifier" and dimension space point {"language": "mul"} @@ -421,12 +421,12 @@ Feature: Move a node with content dimensions Scenario: Move a node and its specializations between two of its siblings When the command MoveNodeAggregate is executed with payload: - | Key | Value | + | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | - | dimensionSpacePoint | {"language": "de"} | + | dimensionSpacePoint | {"language": "de"} | | newSucceedingSiblingNodeAggregateId | "berta-destinode" | - | relationDistributionStrategy | "gatherSpecializations" | + | relationDistributionStrategy | "gatherSpecializations" | And the graph projection is fully up to date When I am in content stream "cs-identifier" and dimension space point {"language": "mul"} @@ -465,8 +465,8 @@ Feature: Move a node with content dimensions Scenario: Move a node and its specializations to the end of its siblings When the command MoveNodeAggregate is executed with payload: | Key | Value | - | contentStreamId | "cs-identifier" | - | nodeAggregateId | "nody-mc-nodeface" | + | contentStreamId | "cs-identifier" | + | nodeAggregateId | "nody-mc-nodeface" | | dimensionSpacePoint | {"language": "de"} | | relationDistributionStrategy | "gatherSpecializations" | And the graph projection is fully up to date @@ -501,3 +501,85 @@ Feature: Move a node with content dimensions | cs-identifier;berta-destinode;{"language": "mul"} | | cs-identifier;anthony-destinode;{"language": "mul"} | And I expect this node to have no succeeding siblings + + Scenario: Trigger position update in DBAL graph + Given I am in content stream "cs-identifier" and dimension space point {"language": "mul"} + # distance i to x: 128 + Given the following CreateNodeAggregateWithNode commands are executed: + | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | + | lady-nodette-nodington-i | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-i | + | lady-nodette-nodington-x | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-x | + | lady-nodette-nodington-ix | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-ix | + | lady-nodette-nodington-viii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-viii | + | lady-nodette-nodington-vii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-vii | + | lady-nodette-nodington-vi | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-vi | + | lady-nodette-nodington-v | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-v | + | lady-nodette-nodington-iv | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-iv | + | lady-nodette-nodington-iii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-iii | + | lady-nodette-nodington-ii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-ii | + # distance ii to x: 64 + When the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-ii" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + # distance iii to x: 32 + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-iii" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + # distance iv to x: 16 + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-iv" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + # distance v to x: 8 + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-v" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + # distance vi to x: 4 + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-vi" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + # distance vii to x: 2 + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-vii" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + # distance viii to x: 1 -> reorder -> 128 + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-viii" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + # distance ix to x: 64 after reorder + And the command MoveNodeAggregate is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-nodette-nodington-ix" | + | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" | + And the graph projection is fully up to date + + Then I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{} + And I expect this node to have the following child nodes: + | Name | NodeDiscriminator | + | document | cs-identifier;sir-david-nodenborough;{"language": "mul"} | + | esquire | cs-identifier;sir-nodeward-nodington-iii;{"language": "mul"} | + | nodington-i | cs-identifier;lady-nodette-nodington-i;{"language": "mul"} | + | nodington-ii | cs-identifier;lady-nodette-nodington-ii;{"language": "mul"} | + | nodington-iii | cs-identifier;lady-nodette-nodington-iii;{"language": "mul"} | + | nodington-iv | cs-identifier;lady-nodette-nodington-iv;{"language": "mul"} | + | nodington-v | cs-identifier;lady-nodette-nodington-v;{"language": "mul"} | + | nodington-vi | cs-identifier;lady-nodette-nodington-vi;{"language": "mul"} | + | nodington-vii | cs-identifier;lady-nodette-nodington-vii;{"language": "mul"} | + | nodington-viii | cs-identifier;lady-nodette-nodington-viii;{"language": "mul"} | + | nodington-ix | cs-identifier;lady-nodette-nodington-ix;{"language": "mul"} | + | nodington-x | cs-identifier;lady-nodette-nodington-x;{"language": "mul"} | + + From 6512d5d342e40596e1412899ef0fa634e7bacad7 Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns <karsten@dambekalns.de> Date: Wed, 1 Nov 2023 15:36:05 +0100 Subject: [PATCH 096/113] TASK: Update Media documenttation conf.py [skip ci] --- Neos.Media/Documentation/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.Media/Documentation/conf.py b/Neos.Media/Documentation/conf.py index 6fdf4edc962..9809cc0e42e 100644 --- a/Neos.Media/Documentation/conf.py +++ b/Neos.Media/Documentation/conf.py @@ -27,9 +27,9 @@ author = 'Neos Team and Contributors' # The short X.Y version. -version = 'dev-master' +version = '8.3' # The full version, including alpha/beta/rc tags. -release = 'dev-master' +release = '8.3.x' # -- General configuration --------------------------------------------------- From 0e4e210e14b6e83ec03a03d5ca8ce10b75f86c10 Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns <karsten@dambekalns.de> Date: Wed, 1 Nov 2023 15:36:45 +0100 Subject: [PATCH 097/113] TASK: Update Media documenttation conf.py [skip ci] --- Neos.Media/Documentation/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.Media/Documentation/conf.py b/Neos.Media/Documentation/conf.py index 6fdf4edc962..6cff3a86200 100644 --- a/Neos.Media/Documentation/conf.py +++ b/Neos.Media/Documentation/conf.py @@ -27,9 +27,9 @@ author = 'Neos Team and Contributors' # The short X.Y version. -version = 'dev-master' +version = '9.0' # The full version, including alpha/beta/rc tags. -release = 'dev-master' +release = '9.0.x' # -- General configuration --------------------------------------------------- From 58f5ec12241b7a8e7ebef3099ad566550a73938d Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns <karsten@dambekalns.de> Date: Wed, 1 Nov 2023 15:37:20 +0100 Subject: [PATCH 098/113] TASK: Update Media documentation conf.py [skip ci] --- Neos.Media/Documentation/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.Media/Documentation/conf.py b/Neos.Media/Documentation/conf.py index 6fdf4edc962..d7a2aa4ecbd 100644 --- a/Neos.Media/Documentation/conf.py +++ b/Neos.Media/Documentation/conf.py @@ -27,9 +27,9 @@ author = 'Neos Team and Contributors' # The short X.Y version. -version = 'dev-master' +version = '8.2' # The full version, including alpha/beta/rc tags. -release = 'dev-master' +release = '8.2.x' # -- General configuration --------------------------------------------------- From 7f1fb5ed56fc2c6d99a074181eeb5a7b30c6a4da Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns <karsten@dambekalns.de> Date: Wed, 1 Nov 2023 15:37:42 +0100 Subject: [PATCH 099/113] TASK: Update Media documentation conf.py [skip ci] --- Neos.Media/Documentation/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.Media/Documentation/conf.py b/Neos.Media/Documentation/conf.py index 6fdf4edc962..b614a81b376 100644 --- a/Neos.Media/Documentation/conf.py +++ b/Neos.Media/Documentation/conf.py @@ -27,9 +27,9 @@ author = 'Neos Team and Contributors' # The short X.Y version. -version = 'dev-master' +version = '8.1' # The full version, including alpha/beta/rc tags. -release = 'dev-master' +release = '8.1.x' # -- General configuration --------------------------------------------------- From 1a0d8d561f22f3f4ef7b02664fdffdf4d699afab Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Wed, 1 Nov 2023 14:38:04 +0000 Subject: [PATCH 100/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 9d6d214ff65..5e486ba7350 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-31 +The following reference was automatically generated from code on 2023-11-01 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index ee20f863532..e285d1c8ccc 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 7f5ed6f9a4b..313561e3f2d 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 255c6d56d7d..62af6be6d29 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 84d6aefe223..b0c21600b1c 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 2bff5dd6769..c85d2749301 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index c1db8296650..2ebf0272945 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 72e74a32150..9a355dbd25f 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 1bf3dda1b50..4ab02a7bfcf 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 24d7154e1a5..4a838dacc18 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index bf3133ca179..096af561261 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 549616fb937..8fd558f5957 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 7ce0a458e3e..31197ac31f0 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 8a151aeb8f2..9879c19d84d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 41ef5999832..895e7e0a245 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index 4d92f614eb4..a82cac259fe 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 0fad77472a3..adfa88e2413 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-31 +This reference was automatically generated from code on 2023-11-01 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From c5f5a5f1bc9b34566f7fd85c2104b83a29babb7d Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns <karsten@dambekalns.de> Date: Wed, 1 Nov 2023 15:38:12 +0100 Subject: [PATCH 101/113] TASK: Update Media documentation conf.py [skip ci] --- Neos.Media/Documentation/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.Media/Documentation/conf.py b/Neos.Media/Documentation/conf.py index 6fdf4edc962..a6181951420 100644 --- a/Neos.Media/Documentation/conf.py +++ b/Neos.Media/Documentation/conf.py @@ -27,9 +27,9 @@ author = 'Neos Team and Contributors' # The short X.Y version. -version = 'dev-master' +version = '8.0' # The full version, including alpha/beta/rc tags. -release = 'dev-master' +release = '8.0.x' # -- General configuration --------------------------------------------------- From 70465f7d430c3c259c335c02c2b0443969da262d Mon Sep 17 00:00:00 2001 From: Martin Ficzel <ficzel@sitegeist.de> Date: Wed, 1 Nov 2023 12:19:07 +0100 Subject: [PATCH 102/113] TASK: De-entangle the menuitems implementations and pass props explicitly from *Menu prototype to *MenuItems prototypes. --- .../Fusion/MenuItemsImplementation.php | 2 +- .../References/NeosFusionReference.rst | 49 ++++++++++++++----- .../Fusion/Prototypes/BreadcrumbMenu.fusion | 9 +++- .../Prototypes/BreadcrumbMenuItems.fusion | 5 ++ .../Fusion/Prototypes/DimensionsMenu.fusion | 24 ++++++++- .../Prototypes/DimensionsMenuItems.fusion | 21 +++++--- .../Private/Fusion/Prototypes/Menu.fusion | 40 ++++++++++++++- .../Fusion/Prototypes/MenuItems.fusion | 21 +++++++- 8 files changed, 145 insertions(+), 26 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php index c8f67bace29..79d5b34feb1 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php @@ -176,7 +176,7 @@ protected function buildItems(): array $maximumLevels = $this->getMaximumLevels(); $lastLevels = $this->getLastLevel(); - if ($lastLevels !== 0) { + if ($lastLevels !== null) { $depthOfEntryParentNodeAggregateId = $subgraph->countAncestorNodes( $entryParentNodeAggregateId, CountAncestorNodesFilter::create( diff --git a/Neos.Neos/Documentation/References/NeosFusionReference.rst b/Neos.Neos/Documentation/References/NeosFusionReference.rst index 2f4aad1520e..5be4c9270f1 100644 --- a/Neos.Neos/Documentation/References/NeosFusionReference.rst +++ b/Neos.Neos/Documentation/References/NeosFusionReference.rst @@ -969,7 +969,18 @@ Neos.Neos:Menu Render a menu with items for nodes. :attributes: (:ref:`Neos_Fusion__DataStructure`) attributes for the whole menu -:[key]: (mixed) all other fusion properties are passed over to :ref:`Neos_Neos__MenuItems` internally to calculate the `items` + +The following properties are passed over to :ref:`Neos_Neos__MenuItems` internally: + +:node: (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``node`` from the fusion context +:entryLevel: (integer) Define the startingPoint of the menu relatively. Non negative values specify this as n levels below root. Negative values are n steps up from ``node`` or ``startingPoint`` if defined. Defaults to ``1`` if no ``startingPoint`` is set otherwise ``0`` +:lastLevel: (optional, integer) Restrict the depth of the menu relatively. Positive values specify this as n levels below root. Negative values specify this as n steps up from ``node``. Defaults to ``null`` +:maximumLevels: (integer) Restrict the maximum depth of items in the menu (relative to ``entryLevel``) +:startingPoint: (optional, Node) The node where the menu hierarchy starts. If not specified explicitly the startingPoint is calculated from (``node`` and ``entryLevel``), defaults to ``null`` +:filter: (string) Filter items by node type (e.g. ``'!My.Site:News,Neos.Neos:Document'``), defaults to ``'Neos.Neos:Document'``. The filter is only used for fetching subItems and is ignored for determining the ``startingPoint`` +:renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered, defaults to ``false`` +:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false``. +:itemCollection: (optional, array of Nodes) Explicitly set the Node items for the menu (taking precedence over ``startingPoints`` and ``entryLevel`` and ``lastLevel``). The children for each ``Node`` will be fetched taking the ``maximumLevels`` property into account. Example:: @@ -991,8 +1002,13 @@ Neos.Neos:BreadcrumbMenu Render a breadcrumb (ancestor documents). -:attributes: (:ref:`Neos_Fusion__DataStructure`) attributes for the whole menu -:[key]: (mixed) all other fusion properties are passed over to :ref:`Neos_Neos__BreadcrumbMenuItems` internally +:attributes: (:ref:`Neos_Fusion__DataStructure`) html attributes for the rendered list + +The following properties are passed over to :ref:`Neos_Neos__BreadcrumbMenuItems` internally: + +:maximumLevels: (integer) Restrict the maximum depth of items in the menu, defaults to ``0`` +:renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered (the current documentNode is always included), defaults to ``false``. +:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` Example:: @@ -1013,7 +1029,14 @@ Neos.Neos:DimensionsMenu Create links to other node variants (e.g. variants of the current node in other dimensions). :attributes: (:ref:`Neos_Fusion__DataStructure`) attributes for the whole menu -:[key]: (mixed) all other fusion properties are passed over to :ref:`Neos_Neos__DimensionsMenuItems` internally + +The following fusion properties are passed over to :ref:`Neos_Neos__DimensionsMenuItems` internally: + +:dimension: (optional, string): name of the dimension which this menu should be based on. Example: "language". +:presets: (optional, array): If set, the presets rendered will be taken from this list of preset identifiers +:includeAllPresets: (boolean, default **false**) If TRUE, include all presets, not only allowed combinations +:renderHiddenInIndex: (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" +:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` .. note:: The ``items`` of the ``DimensionsMenu`` are internally calculated with the prototype :ref:`Neos_Neos__DimensionsMenuMenuItems` which you can use directly aswell. @@ -1037,15 +1060,17 @@ Neos.Neos:MenuItems Create a list of menu-items items for nodes. -:entryLevel: (integer) Start the menu at the given depth +:node: (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``node`` from the fusion context +:entryLevel: (integer) Define the startingPoint of the menu relatively. Non negative values specify this as n levels below root. Negative values are n steps up from ``node`` or ``startingPoint`` if defined. Defaults to ``1`` if no ``startingPoint`` is set otherwise ``0`` +:lastLevel: (optional, integer) Restrict the depth of the menu relatively. Positive values specify this as n levels below root. Negative values specify this as n steps up from ``node``. Defaults to ``null`` :maximumLevels: (integer) Restrict the maximum depth of items in the menu (relative to ``entryLevel``) -:startingPoint: (Node) The parent node of the first menu level (defaults to ``node`` context variable) -:lastLevel: (integer) Restrict the menu depth by node depth (relative to site node) -:filter: (string) Filter items by node type (e.g. ``'!My.Site:News,Neos.Neos:Document'``), defaults to ``'Neos.Neos:Document'`` +:startingPoint: (optional, Node) The node where the menu hierarchy starts. If not specified explicitly the startingPoint is calculated from (``node`` and ``entryLevel``), defaults to ``null`` +:filter: (string) Filter items by node type (e.g. ``'!My.Site:News,Neos.Neos:Document'``), defaults to ``'Neos.Neos:Document'``. The filter is only used for fetching subItems and is ignored for determining the ``startingPoint`` :renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered, defaults to ``false`` -:itemCollection: (array) Explicitly set the Node items for the menu (alternative to ``startingPoints`` and levels) -:itemUriRenderer: (:ref:`Neos_Neos__NodeUri`) prototype to use for rendering the URI of each item -:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` +:calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false``. +:itemCollection: (optional, array of Nodes) Explicitly set the Node items for the menu (taking precedence over ``startingPoints`` and ``entryLevel`` and ``lastLevel``). The children for each ``Node`` will be fetched taking the ``maximumLevels`` property into account. + +Note:: MenuItems item properties: ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1056,6 +1081,7 @@ MenuItems item properties: :label: (string) Full label of the node :menuLevel: (integer) Menu level the item is rendered on :uri: (string) Frontend URI of the node +:children: (array) array of ``MenuItem`` instances Examples: ^^^^^^^^^ @@ -1130,7 +1156,6 @@ If no node variant exists for the preset combination, a ``NULL`` node will be in :presets: (optional, array): If set, the presets rendered will be taken from this list of preset identifiers :includeAllPresets: (boolean, default **false**) If TRUE, include all presets, not only allowed combinations :renderHiddenInIndex: (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" -:itemUriRenderer: (:ref:`Neos_Neos__NodeUri`) prototype to use for rendering the URI of each item :calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` Each ``item`` has the following properties: diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion index a93e64eccae..849b72eb293 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion @@ -1,9 +1,16 @@ # Neos.Neos:BreadcrumbMenu provides a breadcrumb navigation based on menu items. # prototype(Neos.Neos:BreadcrumbMenu) < prototype(Neos.Fusion:Component) { + # html attributes for the rendered list attributes = Neos.Fusion:DataStructure + + # (integer) Restrict the maximum depth of items in the menu, defaults to ``0`` maximumLevels = 0 - renderHiddenInIndex = false + + # (boolean) Whether nodes with ``hiddenInIndex`` should be rendered (the current documentNode is always included), defaults to ``false``. + renderHiddenInIndex = true + + # (boolean) activate the *expensive* calculation of item states defaults to ``false`` calculateItemStates = false @private { diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion index 3a38f547737..eb9325251c2 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion @@ -1,6 +1,11 @@ prototype(Neos.Neos:BreadcrumbMenuItems) < prototype(Neos.Fusion:Component) { + # (integer) Restrict the maximum depth of items in the menu, defaults to ``0`` maximumLevels = 0 + + # (boolean) Whether nodes with ``hiddenInIndex`` should be rendered (the current documentNode is always included), defaults to ``false``. renderHiddenInIndex = true + + # (boolean) activate the *expensive* calculation of item states defaults to ``false`` calculateItemStates = false renderer = Neos.Fusion:Value { diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion index fccffdb3e06..2f9e13ee42c 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion @@ -1,11 +1,31 @@ # Neos.Neos:DimensionsMenu provides dimension (e.g. language) menu rendering prototype(Neos.Neos:DimensionsMenu) < prototype(Neos.Fusion:Component) { + # html attributes for the rendered list attributes = Neos.Fusion:DataStructure + # (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" + renderHiddenInIndex = true + + # (optional, string): name of the dimension which this menu should be based on. Example: "language". + dimension = null + + # (optional, array): If set, the presets rendered will be taken from this list of preset identifiers + presets = null + + # (boolean, default **false**) If TRUE, include all presets, not only allowed combinations + includeAllPresets = false + + # (boolean) activate the *expensive* calculation of item states defaults to ``false`` + calculateItemStates = false + + @private { items = Neos.Neos:DimensionsMenuItems { - @ignoreProperties = ${['attributes']} - @apply.props = ${props} + renderHiddenInIndex = ${props.renderHiddenInIndex} + dimension = ${props.dimension} + presets = ${props.presets} + includeAllPresets = ${props.includeAllPresets} + calculateItemStates = ${props.calculateItemStates} } } diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion index 21578fad44d..783a193e9b3 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion @@ -1,15 +1,24 @@ -prototype(Neos.Neos:DimensionsMenuItems) < prototype(Neos.Neos:MenuItems) { - @class = 'Neos\\Neos\\Fusion\\DimensionsMenuItemsImplementation' +prototype(Neos.Neos:DimensionsMenuItems) { + @class = 'Neos\\Neos\\Fusion\\DimensionsMenuItemsImplementation' - # if documents which are hidden in index should be rendered or not + # (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" renderHiddenInIndex = true - # name of the dimension to use (optional) + # (optional, string): name of the dimension which this menu should be based on. Example: "language". dimension = null - # list of presets, if the default order should be overridden, only used with "dimension" set + # (optional, array): If set, the presets rendered will be taken from this list of preset identifiers presets = null - # if true, items for all presets will be included, ignoring dimension constraints + # (boolean, default **false**) If TRUE, include all presets, not only allowed combinations includeAllPresets = false + + # (boolean) activate the *expensive* calculation of item states defaults to ``false`` + calculateItemStates = false + + // This property is used internally by `MenuItemsImplementation` to render each items uri. + // It can be modified to change behaviour for all rendered uris. + itemUriRenderer = Neos.Neos:NodeUri { + node = ${itemNode} + } } diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion index aca16e43107..a2e4eef00ab 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion @@ -1,12 +1,48 @@ # Neos.Neos:Menu provides basic menu rendering # prototype(Neos.Neos:Menu) < prototype(Neos.Fusion:Component) { + # html attributes for the rendered list attributes = Neos.Fusion:DataStructure + # (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``node`` from the fusion context + node = ${node} + + # (integer) Define the startingPoint of the menu relatively. Non negative values specify this as n levels below root. Negative values are n steps up from ``node`` or ``startingPoint`` if defined. Defaults to ``1`` if no ``startingPoint`` is set otherwise ``0`` + entryLevel = ${this.startingPoint ? 0 : 1} + + # (optional, integer) Restrict the depth of the menu relatively. Positive values specify this as n levels below root. Negative values specify this as n steps up from ``node``. Defaults to ``null`` + lastLevel = null + + # (integer) Restrict the maximum depth of items in the menu (relative to ``entryLevel``) + maximumLevels = 2 + + # (optional, Node) The node where the menu hierarchy starts. If not specified explicitly the startingPoint is calculated from (``node`` and ``entryLevel``), defaults to ``null`` + startingPoint = null + + # (string) Filter items by node type (e.g. ``'!My.Site:News,Neos.Neos:Document'``), defaults to ``'Neos.Neos:Document'``. The filter is only used for fetching subItems and is ignored for determining the ``startingPoint`` + filter = 'Neos.Neos:Document' + + # (boolean) Whether nodes with ``hiddenInIndex`` should be rendered, defaults to ``false`` + renderHiddenInIndex = false + + # (boolean) activate the *expensive* calculation of item states defaults to ``false``. + calculateItemStates = false + + # (optional, array of Nodes) Explicitly set the Node items for the menu (taking precedence over ``startingPoints`` and ``entryLevel`` and ``lastLevel``). The children for each ``Node`` will be fetched taking the ``maximumLevels`` property into account. + itemCollection = null + + @private { items = Neos.Neos:MenuItems { - @ignoreProperties = ${['attributes']} - @apply.props = ${props} + node = ${props.node} + entryLevel = ${props.entryLevel} + lastLevel = ${props.lastLevel} + maximumLevels = ${props.maximumLevels} + startingPoint = ${props.startingPoint} + filter = ${props.filter} + renderHiddenInIndex = ${props.renderHiddenInIndex} + calculateItemStates = ${props.calculateItemStates} + itemCollection = ${props.itemCollection} } } diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion index d2ef5d4b7f1..2ee88194383 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion @@ -1,16 +1,33 @@ prototype(Neos.Neos:MenuItems) { @class = 'Neos\\Neos\\Fusion\\MenuItemsImplementation' + # (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``node`` from the fusion context node = ${node} + + # (integer) Define the startingPoint of the menu relatively. Non negative values specify this as n levels below root. Negative values are n steps up from ``node`` or ``startingPoint`` if defined. Defaults to ``1`` if no ``startingPoint`` is set otherwise ``0`` entryLevel = ${this.startingPoint ? 0 : 1} + + # (optional, integer) Restrict the depth of the menu relatively. Positive values specify this as n levels below root. Negative values specify this as n steps up from ``node``. Defaults to ``null`` + lastLevel = null + + # (integer) Restrict the maximum depth of items in the menu (relative to ``entryLevel``) maximumLevels = 2 + + # (optional, Node) The node where the menu hierarchy starts. If not specified explicitly the startingPoint is calculated from (``node`` and ``entryLevel``), defaults to ``null`` startingPoint = null - lastLevel = null + + # (string) Filter items by node type (e.g. ``'!My.Site:News,Neos.Neos:Document'``), defaults to ``'Neos.Neos:Document'``. The filter is only used for fetching subItems and is ignored for determining the ``startingPoint`` filter = 'Neos.Neos:Document' + + # (boolean) Whether nodes with ``hiddenInIndex`` should be rendered, defaults to ``false`` renderHiddenInIndex = false - itemCollection = null + + # (boolean) activate the *expensive* calculation of item states defaults to ``false``. calculateItemStates = false + # (optional, array of Nodes) Explicitly set the Node items for the menu (taking precedence over ``startingPoints`` and ``entryLevel`` and ``lastLevel``). The children for each ``Node`` will be fetched taking the ``maximumLevels`` property into account. + itemCollection = null + // This property is used internally by `MenuItemsImplementation` to render each items uri. // It can be modified to change behaviour for all rendered uris. itemUriRenderer = Neos.Neos:NodeUri { From 267d02592850e584a027f1ef4e2e7fa55b3e88e1 Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Wed, 1 Nov 2023 14:39:50 +0000 Subject: [PATCH 103/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index ee73a6130ea..ccf8f9ca262 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-21 +The following reference was automatically generated from code on 2023-11-01 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index ccb1506f3cc..0b90327e473 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 582e91c9267..313561e3f2d 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 66dd6924281..62af6be6d29 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 359257c7ed2..b0c21600b1c 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 350cb44df2c..c85d2749301 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 937847a87a7..2ebf0272945 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index e4c5c45cf0f..f27c7162447 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 9e9407aff36..4ab02a7bfcf 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 7f7479f57ad..4a838dacc18 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index b073d7b8500..096af561261 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 6f6aaf4574e..8fd558f5957 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 032e57f64b7..31197ac31f0 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index d578688b50b..9879c19d84d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index d25b770036d..895e7e0a245 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index c5191e870e1..a82cac259fe 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 6a3a594c574..adfa88e2413 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 40c9d052dd9b4ad494583642585e5c5a8acd50b3 Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Wed, 1 Nov 2023 14:39:58 +0000 Subject: [PATCH 104/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index ee73a6130ea..ccf8f9ca262 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-21 +The following reference was automatically generated from code on 2023-11-01 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 79acd948b5e..d6b96c91df0 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 582e91c9267..313561e3f2d 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 66dd6924281..62af6be6d29 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 359257c7ed2..b0c21600b1c 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 350cb44df2c..c85d2749301 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 937847a87a7..2ebf0272945 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index e4c5c45cf0f..f27c7162447 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 9e9407aff36..4ab02a7bfcf 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 7f7479f57ad..4a838dacc18 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index b073d7b8500..096af561261 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 6f6aaf4574e..8fd558f5957 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 032e57f64b7..31197ac31f0 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index d578688b50b..9879c19d84d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index d25b770036d..895e7e0a245 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index c5191e870e1..a82cac259fe 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 6a3a594c574..adfa88e2413 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From b2a09a73185cadcaf32e0154bbb50c3be59b14bb Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Wed, 1 Nov 2023 14:42:16 +0000 Subject: [PATCH 105/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index ee73a6130ea..ccf8f9ca262 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-10-21 +The following reference was automatically generated from code on 2023-11-01 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index 79acd948b5e..d6b96c91df0 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 582e91c9267..313561e3f2d 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 66dd6924281..62af6be6d29 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index 359257c7ed2..b0c21600b1c 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index 350cb44df2c..c85d2749301 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 937847a87a7..2ebf0272945 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index e4c5c45cf0f..f27c7162447 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 9e9407aff36..4ab02a7bfcf 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 7f7479f57ad..4a838dacc18 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index b073d7b8500..096af561261 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 6f6aaf4574e..8fd558f5957 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 032e57f64b7..31197ac31f0 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index d578688b50b..9879c19d84d 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index d25b770036d..895e7e0a245 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index c5191e870e1..a82cac259fe 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index 6a3a594c574..adfa88e2413 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-10-21 +This reference was automatically generated from code on 2023-11-01 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 951cf3c2de531cde001cb5ed1fc7f2df90eb8710 Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt <schmitt@sitegeist.de> Date: Wed, 1 Nov 2023 16:52:34 +0100 Subject: [PATCH 106/113] 4327 - Expose a subgraph's identity --- .../DoctrineDbalContentGraphProjection.php | 4 ++- ...trineDbalContentGraphProjectionFactory.php | 1 + .../src/Domain/Repository/ContentGraph.php | 3 ++ .../src/Domain/Repository/ContentSubgraph.php | 13 +++++++++ .../Projection/HypergraphProjection.php | 3 ++ .../Domain/Repository/ContentHypergraph.php | 3 ++ .../Repository/ContentSubhypergraph.php | 29 ++++++++++++++----- .../src/HypergraphProjectionFactory.php | 1 + .../ContentSubgraphWithRuntimeCaches.php | 6 ++++ .../ContentGraph/ContentSubgraphInterface.php | 9 ++++++ 10 files changed, 63 insertions(+), 9 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index e44fd08d16e..88477f51f32 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Factory\ContentRepositoryId; use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked; use Neos\ContentRepository\Core\Feature\ContentStreamRemoval\Event\ContentStreamWasRemoved; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionShineThroughWasAdded; @@ -46,7 +47,6 @@ use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\NodeType\NodeTypeName; -use Neos\ContentRepository\Core\Projection\CatchUpHookFactoryInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\Timestamps; use Neos\ContentRepository\Core\Projection\ProjectionInterface; use Neos\ContentRepository\Core\Projection\WithMarkStaleInterface; @@ -86,6 +86,7 @@ final class DoctrineDbalContentGraphProjection implements ProjectionInterface, W public function __construct( private readonly DbalClientInterface $dbalClient, private readonly NodeFactory $nodeFactory, + private readonly ContentRepositoryId $contentRepositoryId, private readonly NodeTypeManager $nodeTypeManager, private readonly ProjectionContentGraph $projectionContentGraph, private readonly string $tableNamePrefix, @@ -212,6 +213,7 @@ public function getState(): ContentGraph $this->contentGraph = new ContentGraph( $this->dbalClient, $this->nodeFactory, + $this->contentRepositoryId, $this->nodeTypeManager, $this->tableNamePrefix ); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php index a264b39f8d7..d3022e2c290 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php @@ -48,6 +48,7 @@ public function build( $projectionFactoryDependencies->nodeTypeManager, $projectionFactoryDependencies->propertyConverter ), + $projectionFactoryDependencies->contentRepositoryId, $projectionFactoryDependencies->nodeTypeManager, new ProjectionContentGraph( $this->dbalClient, diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index 126200f98a3..3e39613f33b 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -19,6 +19,7 @@ use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\NodeRelationAnchorPoint; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; +use Neos\ContentRepository\Core\Factory\ContentRepositoryId; use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphWithRuntimeCaches\ContentSubgraphWithRuntimeCaches; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindRootNodeAggregatesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregates; @@ -56,6 +57,7 @@ final class ContentGraph implements ContentGraphInterface public function __construct( private readonly DbalClientInterface $client, private readonly NodeFactory $nodeFactory, + private readonly ContentRepositoryId $contentRepositoryId, private readonly NodeTypeManager $nodeTypeManager, private readonly string $tableNamePrefix ) { @@ -70,6 +72,7 @@ final public function getSubgraph( if (!isset($this->subgraphs[$index])) { $this->subgraphs[$index] = new ContentSubgraphWithRuntimeCaches( new ContentSubgraph( + $this->contentRepositoryId, $contentStreamId, $dimensionSpacePoint, $visibilityConstraints, diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index 798b59ef07c..200d65faee6 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -21,10 +21,12 @@ use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Query\QueryBuilder; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; +use Neos\ContentRepository\Core\Factory\ContentRepositoryId; use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath; +use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity; use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountBackReferencesFilter; @@ -102,6 +104,7 @@ final class ContentSubgraph implements ContentSubgraphInterface private int $dynamicParameterCount = 0; public function __construct( + private readonly ContentRepositoryId $contentRepositoryId, private readonly ContentStreamId $contentStreamId, private readonly DimensionSpacePoint $dimensionSpacePoint, private readonly VisibilityConstraints $visibilityConstraints, @@ -112,6 +115,16 @@ public function __construct( ) { } + public function getIdentity(): ContentSubgraphIdentity + { + return ContentSubgraphIdentity::create( + $this->contentRepositoryId, + $this->contentStreamId, + $this->dimensionSpacePoint, + $this->visibilityConstraints + ); + } + public function findChildNodes(NodeAggregateId $parentNodeAggregateId, FindChildNodesFilter $filter): Nodes { $queryBuilder = $this->buildChildNodesQuery($parentNodeAggregateId, $filter); diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php index f9037c9453a..bf8d017432b 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php @@ -31,6 +31,7 @@ use Neos\ContentGraph\PostgreSQLAdapter\Domain\Repository\NodeFactory; use Neos\ContentGraph\PostgreSQLAdapter\Infrastructure\PostgresDbalClientInterface; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Factory\ContentRepositoryId; use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; @@ -81,6 +82,7 @@ final class HypergraphProjection implements ProjectionInterface public function __construct( private readonly PostgresDbalClientInterface $databaseClient, private readonly NodeFactory $nodeFactory, + private readonly ContentRepositoryId $contentRepositoryId, private readonly NodeTypeManager $nodeTypeManager, private readonly string $tableNamePrefix, ) { @@ -221,6 +223,7 @@ public function getState(): ContentHypergraph $this->contentHypergraph = new ContentHypergraph( $this->databaseClient, $this->nodeFactory, + $this->contentRepositoryId, $this->nodeTypeManager, $this->tableNamePrefix ); diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php index 58244d9823b..f45b29b8e34 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php @@ -23,6 +23,7 @@ use Neos\ContentGraph\PostgreSQLAdapter\Infrastructure\PostgresDbalClientInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; +use Neos\ContentRepository\Core\Factory\ContentRepositoryId; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindRootNodeAggregatesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregates; @@ -59,6 +60,7 @@ final class ContentHypergraph implements ContentGraphInterface public function __construct( PostgresDbalClientInterface $databaseClient, NodeFactory $nodeFactory, + private readonly ContentRepositoryId $contentRepositoryId, private readonly NodeTypeManager $nodeTypeManager, private readonly string $tableNamePrefix ) { @@ -74,6 +76,7 @@ public function getSubgraph( $index = $contentStreamId->value . '-' . $dimensionSpacePoint->hash . '-' . $visibilityConstraints->getHash(); if (!isset($this->subhypergraphs[$index])) { $this->subhypergraphs[$index] = new ContentSubhypergraph( + $this->contentRepositoryId, $contentStreamId, $dimensionSpacePoint, $visibilityConstraints, diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php index 6f1bf311ec7..01c50b85b1c 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php @@ -24,9 +24,11 @@ use Neos\ContentGraph\PostgreSQLAdapter\Domain\Repository\Query\QueryUtility; use Neos\ContentGraph\PostgreSQLAdapter\Infrastructure\PostgresDbalClientInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; +use Neos\ContentRepository\Core\Factory\ContentRepositoryId; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath; +use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity; use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindBackReferencesFilter; @@ -69,19 +71,30 @@ * * @internal but the public {@see ContentSubgraphInterface} is API */ -final class ContentSubhypergraph implements ContentSubgraphInterface +final readonly class ContentSubhypergraph implements ContentSubgraphInterface { public function __construct( - private readonly ContentStreamId $contentStreamId, - private readonly DimensionSpacePoint $dimensionSpacePoint, - private readonly VisibilityConstraints $visibilityConstraints, - private readonly PostgresDbalClientInterface $databaseClient, - private readonly NodeFactory $nodeFactory, - private readonly NodeTypeManager $nodeTypeManager, - private readonly string $tableNamePrefix + private ContentRepositoryId $contentRepositoryId, + private ContentStreamId $contentStreamId, + private DimensionSpacePoint $dimensionSpacePoint, + private VisibilityConstraints $visibilityConstraints, + private PostgresDbalClientInterface $databaseClient, + private NodeFactory $nodeFactory, + private NodeTypeManager $nodeTypeManager, + private string $tableNamePrefix ) { } + public function getIdentity(): ContentSubgraphIdentity + { + return ContentSubgraphIdentity::create( + $this->contentRepositoryId, + $this->contentStreamId, + $this->dimensionSpacePoint, + $this->visibilityConstraints + ); + } + public function findNodeById(NodeAggregateId $nodeAggregateId): ?Node { $query = HypergraphQuery::create($this->contentStreamId, $this->tableNamePrefix); diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php b/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php index ca4a76375ee..4c3def6eea8 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php @@ -43,6 +43,7 @@ public function build( $projectionFactoryDependencies->nodeTypeManager, $projectionFactoryDependencies->propertyConverter ), + $projectionFactoryDependencies->contentRepositoryId, $projectionFactoryDependencies->nodeTypeManager, $tableNamePrefix ); diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php index 85c2c94b614..c8b08e98ca2 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php @@ -16,6 +16,7 @@ use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath; +use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity; use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountBackReferencesFilter; @@ -52,6 +53,11 @@ public function __construct( $this->inMemoryCache = new InMemoryCache(); } + public function getIdentity(): ContentSubgraphIdentity + { + return $this->wrappedContentSubgraph->getIdentity(); + } + public function findChildNodes(NodeAggregateId $parentNodeAggregateId, FindChildNodesFilter $filter): Nodes { if (!self::isFilterEmpty($filter)) { diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php index 55a5572edf8..5f65fb6a0f1 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php @@ -48,6 +48,15 @@ */ interface ContentSubgraphInterface extends \JsonSerializable { + /** + * Returns the subgraph's identity, i.e. the current perspective we look at content from, composed of + * * the content repository the subgraph belongs to + * * the ID of the content stream we are currently working in + * * the dimension space point we are currently looking at + * * the applied visibility constraints + */ + public function getIdentity(): ContentSubgraphIdentity; + /** * Find a single node by its aggregate id * From 714a321da118b8bb29def7fcd47d81365d828913 Mon Sep 17 00:00:00 2001 From: Martin Ficzel <ficzel@sitegeist.de> Date: Wed, 1 Nov 2023 16:21:49 +0100 Subject: [PATCH 107/113] TASK: Initialize `node` as `${documentNode}` and include currentNode in CurrentRootlineNodeAggregateIds --- .../AbstractMenuItemsImplementation.php | 57 +++++-------------- .../DimensionsMenuItemsImplementation.php | 16 +++--- .../Fusion/MenuItemsImplementation.php | 53 ++++++++--------- .../References/NeosFusionReference.rst | 5 +- .../Fusion/Prototypes/BreadcrumbMenu.fusion | 5 ++ .../Prototypes/BreadcrumbMenuItems.fusion | 6 ++ .../Fusion/Prototypes/DimensionsMenu.fusion | 5 +- .../Prototypes/DimensionsMenuItems.fusion | 3 + .../Private/Fusion/Prototypes/Menu.fusion | 4 +- .../Fusion/Prototypes/MenuItems.fusion | 4 +- 10 files changed, 72 insertions(+), 86 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php index d37385261f4..6e92d883fd5 100644 --- a/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/AbstractMenuItemsImplementation.php @@ -46,13 +46,6 @@ abstract class AbstractMenuItemsImplementation extends AbstractFusionObject */ protected $currentNode; - /** - * Internal cache for the currentLevel tsValue. - * - * @var integer - */ - protected $currentLevel; - /** * Internal cache for the renderHiddenInIndex property. * @@ -67,13 +60,6 @@ abstract class AbstractMenuItemsImplementation extends AbstractFusionObject */ protected $calculateItemStates; - /** - * Rootline of all nodes from the current node to the site root node, keys are depth of nodes. - * - * @var array<Node> - */ - protected $currentNodeRootline; - #[Flow\Inject] protected ContentRepositoryRegistry $contentRepositoryRegistry; @@ -104,6 +90,19 @@ public function getRenderHiddenInIndex() return $this->renderHiddenInIndex; } + /** + * The node the menu is built from, all relative specifications will + * use this as a base + */ + public function getCurrentNode(): Node + { + if ($this->currentNode === null) { + $this->currentNode = $this->fusionValue('node'); + } + + return $this->currentNode; + } + /** * Main API method which sends the to-be-rendered data to Fluid * @@ -112,9 +111,6 @@ public function getRenderHiddenInIndex() public function getItems(): array { if ($this->items === null) { - $fusionContext = $this->runtime->getCurrentContext(); - $this->currentNode = $fusionContext['activeNode'] ?? $fusionContext['documentNode']; - $this->currentLevel = 1; $this->items = $this->buildItems(); } @@ -163,33 +159,6 @@ protected function isNodeHidden(Node $node) return $node->getProperty('_hiddenInIndex'); } - /** - * Get the rootline from the current node up to the site node. - * - * @return array<int,Node> nodes, indexed by depth - */ - protected function getCurrentNodeRootline(): array - { - if ($this->currentNodeRootline === null) { - $rootline = []; - $ancestors = $this->contentRepositoryRegistry->subgraphForNode($this->currentNode) - ->findAncestorNodes( - $this->currentNode->nodeAggregateId, - FindAncestorNodesFilter::create() - ); - foreach ($ancestors->reverse() as $i => $ancestor) { - if (!$ancestor->classification->isRoot()) { - $rootline[$i] = $ancestor; - } - } - $rootline[] = $this->currentNode; - - $this->currentNodeRootline = $rootline; - } - - return $this->currentNodeRootline; - } - protected function buildUri(Node $node): string { $this->runtime->pushContextArray([ diff --git a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php index 6877fe98c6d..97fff10f134 100644 --- a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php @@ -44,7 +44,9 @@ public function getDimension(): array protected function buildItems(): array { $menuItems = []; - $contentRepositoryId = $this->currentNode->subgraphIdentity->contentRepositoryId; + $currentNode = $this->getCurrentNode(); + + $contentRepositoryId = $currentNode->subgraphIdentity->contentRepositoryId; $contentRepository = $this->contentRepositoryRegistry->get( $contentRepositoryId, ); @@ -56,28 +58,28 @@ protected function buildItems(): array assert($dimensionMenuItemsImplementationInternals instanceof DimensionsMenuItemsImplementationInternals); $interDimensionalVariationGraph = $dimensionMenuItemsImplementationInternals->interDimensionalVariationGraph; - $currentDimensionSpacePoint = $this->currentNode->subgraphIdentity->dimensionSpacePoint; + $currentDimensionSpacePoint = $currentNode->subgraphIdentity->dimensionSpacePoint; $contentDimensionIdentifierToLimitTo = $this->getContentDimensionIdentifierToLimitTo(); foreach ($interDimensionalVariationGraph->getDimensionSpacePoints() as $dimensionSpacePoint) { $variant = null; if ($this->isDimensionSpacePointRelevant($dimensionSpacePoint)) { if ($dimensionSpacePoint->equals($currentDimensionSpacePoint)) { - $variant = $this->currentNode; + $variant = $currentNode; } else { $variant = $contentRepository->getContentGraph() ->getSubgraph( - $this->currentNode->subgraphIdentity->contentStreamId, + $currentNode->subgraphIdentity->contentStreamId, $dimensionSpacePoint, - $this->currentNode->subgraphIdentity->visibilityConstraints, + $currentNode->subgraphIdentity->visibilityConstraints, ) - ->findNodeById($this->currentNode->nodeAggregateId); + ->findNodeById($currentNode->nodeAggregateId); } if (!$variant && $this->includeGeneralizations() && $contentDimensionIdentifierToLimitTo) { $variant = $this->findClosestGeneralizationMatchingDimensionValue( $dimensionSpacePoint, $contentDimensionIdentifierToLimitTo, - $this->currentNode->nodeAggregateId, + $currentNode->nodeAggregateId, $dimensionMenuItemsImplementationInternals, $contentRepository ); diff --git a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php index 79d5b34feb1..3560453e807 100644 --- a/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/MenuItemsImplementation.php @@ -57,7 +57,7 @@ class MenuItemsImplementation extends AbstractMenuItemsImplementation /** * Internal cache for the ancestors aggregate ids of the currentNode. */ - protected ?NodeAggregateIds $currentNodeAncestorAggregateIds = null; + protected ?NodeAggregateIds $currentNodeRootlineAggregateIds = null; /** * Runtime cache for the node type constraints to be applied @@ -75,7 +75,7 @@ class MenuItemsImplementation extends AbstractMenuItemsImplementation * -2 = two levels above the current page * ... */ - public function getEntryLevel(): int + protected function getEntryLevel(): int { return $this->fusionValue('entryLevel'); } @@ -83,7 +83,7 @@ public function getEntryLevel(): int /** * NodeType filter for nodes displayed in menu */ - public function getFilter(): string + protected function getFilter(): string { $filter = $this->fusionValue('filter'); if ($filter === null) { @@ -96,7 +96,7 @@ public function getFilter(): string /** * Maximum number of levels which should be rendered in this menu. */ - public function getMaximumLevels(): int + protected function getMaximumLevels(): int { if ($this->maximumLevels === null) { $this->maximumLevels = $this->fusionValue('maximumLevels'); @@ -111,7 +111,7 @@ public function getMaximumLevels(): int /** * Return evaluated lastLevel value. */ - public function getLastLevel(): ?int + protected function getLastLevel(): ?int { if ($this->lastLevel === null) { $this->lastLevel = $this->fusionValue('lastLevel'); @@ -123,7 +123,7 @@ public function getLastLevel(): ?int return $this->lastLevel; } - public function getStartingPoint(): ?Node + protected function getStartingPoint(): ?Node { if ($this->startingPoint === null) { $this->startingPoint = $this->fusionValue('startingPoint'); @@ -135,7 +135,7 @@ public function getStartingPoint(): ?Node /** * @return array<int,Node>|Nodes|null */ - public function getItemCollection(): array|Nodes|null + protected function getItemCollection(): array|Nodes|null { return $this->fusionValue('itemCollection'); } @@ -149,7 +149,7 @@ public function getItemCollection(): array|Nodes|null */ protected function buildItems(): array { - $subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->currentNode); + $subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->getCurrentNode()); if (!is_null($this->getItemCollection())) { $items = []; foreach ($this->getItemCollection() as $node) { @@ -192,8 +192,8 @@ protected function buildItems(): array $maxLevelsBasedOnLastLevel = max($lastLevels - $depthOfEntryParentNodeAggregateId, 0); $maximumLevels = min($maximumLevels, $maxLevelsBasedOnLastLevel); } elseif ($lastLevels < 0) { - $currentNodeAncestorAggregateIds = $this->getCurrentNodeAncestorAggregateIds(); - $depthOfCurrentDocument = count(iterator_to_array($currentNodeAncestorAggregateIds)); + $currentNodeAncestorAggregateIds = $this->getCurrentNodeRootlineAggregateIds(); + $depthOfCurrentDocument = count(iterator_to_array($currentNodeAncestorAggregateIds)) - 1; $maxLevelsBasedOnLastLevel = max($depthOfCurrentDocument + $lastLevels - $depthOfEntryParentNodeAggregateId + 1, 0); $maximumLevels = min($maximumLevels, $maxLevelsBasedOnLastLevel); } @@ -260,8 +260,7 @@ protected function buildMenuItemFromSubtree(Subtree $subtree, int $startLevel = */ protected function findMenuStartingPointAggregateId(): ?NodeAggregateId { - $fusionContext = $this->runtime->getCurrentContext(); - $traversalStartingPoint = $this->getStartingPoint() ?: $fusionContext['node'] ?? null; + $traversalStartingPoint = $this->getStartingPoint() ?: $this->getCurrentNode(); if (!$traversalStartingPoint instanceof Node) { throw new FusionException( @@ -273,17 +272,11 @@ protected function findMenuStartingPointAggregateId(): ?NodeAggregateId if ($this->getEntryLevel() === 0) { return $traversalStartingPoint->nodeAggregateId; } elseif ($this->getEntryLevel() < 0) { - $ancestorNodeAggregateIds = $this->getCurrentNodeAncestorAggregateIds(); - if ($ancestorNodeAggregateIds === null) { - return null; - } + $ancestorNodeAggregateIds = $this->getCurrentNodeRootlineAggregateIds(); $ancestorNodeAggregateIdArray = array_values(iterator_to_array($ancestorNodeAggregateIds)); - return $ancestorNodeAggregateIdArray[$this->getEntryLevel() * -1 - 1] ?? null; + return $ancestorNodeAggregateIdArray[$this->getEntryLevel() * -1] ?? null; } else { - $ancestorNodeAggregateIds = $this->getCurrentNodeAncestorAggregateIds(); - if ($ancestorNodeAggregateIds === null) { - return null; - } + $ancestorNodeAggregateIds = $this->getCurrentNodeRootlineAggregateIds(); $ancestorNodeAggregateIdArray = array_reverse(array_values(iterator_to_array($ancestorNodeAggregateIds))); return $ancestorNodeAggregateIdArray[$this->getEntryLevel() - 1] ?? null; } @@ -297,12 +290,12 @@ protected function getNodeTypeConstraints(): NodeTypeConstraints return $this->nodeTypeConstraints; } - public function getCurrentNodeAncestorAggregateIds(): NodeAggregateIds + protected function getCurrentNodeRootlineAggregateIds(): NodeAggregateIds { - if ($this->currentNodeAncestorAggregateIds instanceof NodeAggregateIds) { - return $this->currentNodeAncestorAggregateIds; + if ($this->currentNodeRootlineAggregateIds instanceof NodeAggregateIds) { + return $this->currentNodeRootlineAggregateIds; } - $subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->currentNode); + $subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->getCurrentNode()); $currentNodeAncestors = $subgraph->findAncestorNodes( $this->currentNode->nodeAggregateId, FindAncestorNodesFilter::create( @@ -314,16 +307,18 @@ public function getCurrentNodeAncestorAggregateIds(): NodeAggregateIds ) ); - $this->currentNodeAncestorAggregateIds = NodeAggregateIds::fromNodes($currentNodeAncestors); - return $this->currentNodeAncestorAggregateIds; + $this->currentNodeRootlineAggregateIds = NodeAggregateIds::create($this->currentNode->nodeAggregateId) + ->merge(NodeAggregateIds::fromNodes($currentNodeAncestors)); + + return $this->currentNodeRootlineAggregateIds; } protected function calculateItemState(Node $node): MenuItemState { - if ($node->nodeAggregateId->equals($this->currentNode->nodeAggregateId)) { + if ($node->nodeAggregateId->equals($this->getCurrentNode()->nodeAggregateId)) { return MenuItemState::CURRENT; } - if ($this->getCurrentNodeAncestorAggregateIds()->contain($node->nodeAggregateId)) { + if ($this->getCurrentNodeRootlineAggregateIds()->contain($node->nodeAggregateId)) { return MenuItemState::ACTIVE; } return MenuItemState::NORMAL; diff --git a/Neos.Neos/Documentation/References/NeosFusionReference.rst b/Neos.Neos/Documentation/References/NeosFusionReference.rst index 5be4c9270f1..596997ab1f2 100644 --- a/Neos.Neos/Documentation/References/NeosFusionReference.rst +++ b/Neos.Neos/Documentation/References/NeosFusionReference.rst @@ -1006,6 +1006,7 @@ Render a breadcrumb (ancestor documents). The following properties are passed over to :ref:`Neos_Neos__BreadcrumbMenuItems` internally: +:node: (Node) The current node to render the menu for. Defaults to ``documentNode`` from the fusion context :maximumLevels: (integer) Restrict the maximum depth of items in the menu, defaults to ``0`` :renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered (the current documentNode is always included), defaults to ``false``. :calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` @@ -1032,6 +1033,7 @@ Create links to other node variants (e.g. variants of the current node in other The following fusion properties are passed over to :ref:`Neos_Neos__DimensionsMenuItems` internally: +:node: (Node) The current node used to calculate the Menu. Defaults to ``documentNode`` from the fusion context :dimension: (optional, string): name of the dimension which this menu should be based on. Example: "language". :presets: (optional, array): If set, the presets rendered will be taken from this list of preset identifiers :includeAllPresets: (boolean, default **false**) If TRUE, include all presets, not only allowed combinations @@ -1131,6 +1133,7 @@ Neos.Neos:BreadcrumbMenuItems Create a list of of menu-items for the breadcrumb (ancestor documents). +:node: (Node) The current node to render the menu for. Defaults to ``documentNode`` from the fusion context :maximumLevels: (integer) Restrict the maximum depth of items in the menu, defaults to ``0`` :renderHiddenInIndex: (boolean) Whether nodes with ``hiddenInIndex`` should be rendered (the current documentNode is always included), defaults to ``false``. :calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` @@ -1160,7 +1163,7 @@ If no node variant exists for the preset combination, a ``NULL`` node will be in Each ``item`` has the following properties: -:node: (Node) A node instance (with resolved shortcuts) that should be used to link to the item +:node: (Node) The current node used to calculate the Menu. Defaults to ``documentNode`` from the fusion context :state: (string) Menu state of the item: ``normal``, ``current`` (the current node), ``absent`` :label: (string) Label of the item (the dimension preset label) :menuLevel: (integer) Menu level the item is rendered on diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion index 849b72eb293..0da25707ac1 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenu.fusion @@ -1,6 +1,10 @@ # Neos.Neos:BreadcrumbMenu provides a breadcrumb navigation based on menu items. # prototype(Neos.Neos:BreadcrumbMenu) < prototype(Neos.Fusion:Component) { + + # (Node) The current node to render the menu for. Defaults to ``documentNode`` from the fusion context + node = ${documentNode} + # html attributes for the rendered list attributes = Neos.Fusion:DataStructure @@ -15,6 +19,7 @@ prototype(Neos.Neos:BreadcrumbMenu) < prototype(Neos.Fusion:Component) { @private { items = Neos.Neos:BreadcrumbMenuItems { + node = ${props.node} maximumLevels = ${props.maximumLevels} renderHiddenInIndex = ${props.renderHiddenInIndex} calculateItemStates = ${props.calculateItemStates} diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion index eb9325251c2..8b128ba4eb8 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/BreadcrumbMenuItems.fusion @@ -1,4 +1,8 @@ prototype(Neos.Neos:BreadcrumbMenuItems) < prototype(Neos.Fusion:Component) { + + # (Node) The current node to render the menu for. Defaults to ``documentNode`` from the fusion context + node = ${documentNode} + # (integer) Restrict the maximum depth of items in the menu, defaults to ``0`` maximumLevels = 0 @@ -10,6 +14,7 @@ prototype(Neos.Neos:BreadcrumbMenuItems) < prototype(Neos.Fusion:Component) { renderer = Neos.Fusion:Value { parentItems = Neos.Neos:MenuItems { + node = ${props.node} calculateItemStates = ${props.calculateItemStates} renderHiddenInIndex = ${props.renderHiddenInIndex} maximumLevels = ${props.maximumLevels} @@ -17,6 +22,7 @@ prototype(Neos.Neos:BreadcrumbMenuItems) < prototype(Neos.Fusion:Component) { } currentItem = Neos.Neos:MenuItems { + node = ${props.node} calculateItemStates = ${props.calculateItemStates} renderHiddenInIndex = true maximumLevels = ${props.maximumLevels} diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion index 2f9e13ee42c..d5a75fb9ff6 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenu.fusion @@ -1,5 +1,8 @@ # Neos.Neos:DimensionsMenu provides dimension (e.g. language) menu rendering prototype(Neos.Neos:DimensionsMenu) < prototype(Neos.Fusion:Component) { + # (Node) The current node to render the menu for. Defaults to ``documentNode`` from the fusion context + node = ${documentNode} + # html attributes for the rendered list attributes = Neos.Fusion:DataStructure @@ -18,9 +21,9 @@ prototype(Neos.Neos:DimensionsMenu) < prototype(Neos.Fusion:Component) { # (boolean) activate the *expensive* calculation of item states defaults to ``false`` calculateItemStates = false - @private { items = Neos.Neos:DimensionsMenuItems { + node = ${props.node} renderHiddenInIndex = ${props.renderHiddenInIndex} dimension = ${props.dimension} presets = ${props.presets} diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion index 783a193e9b3..55629907ada 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/DimensionsMenuItems.fusion @@ -1,6 +1,9 @@ prototype(Neos.Neos:DimensionsMenuItems) { @class = 'Neos\\Neos\\Fusion\\DimensionsMenuItemsImplementation' + # (Node) The current node. Defaults to ``node`` from the fusion context + node = ${documentNode} + # (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" renderHiddenInIndex = true diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion index a2e4eef00ab..c435eb45e3c 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/Menu.fusion @@ -4,8 +4,8 @@ prototype(Neos.Neos:Menu) < prototype(Neos.Fusion:Component) { # html attributes for the rendered list attributes = Neos.Fusion:DataStructure - # (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``node`` from the fusion context - node = ${node} + # (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``documentNode`` from the fusion context + node = ${documentNode} # (integer) Define the startingPoint of the menu relatively. Non negative values specify this as n levels below root. Negative values are n steps up from ``node`` or ``startingPoint`` if defined. Defaults to ``1`` if no ``startingPoint`` is set otherwise ``0`` entryLevel = ${this.startingPoint ? 0 : 1} diff --git a/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion index 2ee88194383..edf6bc37c60 100644 --- a/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion +++ b/Neos.Neos/Resources/Private/Fusion/Prototypes/MenuItems.fusion @@ -1,8 +1,8 @@ prototype(Neos.Neos:MenuItems) { @class = 'Neos\\Neos\\Fusion\\MenuItemsImplementation' - # (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``node`` from the fusion context - node = ${node} + # (Node) The current node used to calculate the itemStates, and ``startingPoint`` (if not defined explicitly). Defaults to ``documentNode`` from the fusion context + node = ${documentNode} # (integer) Define the startingPoint of the menu relatively. Non negative values specify this as n levels below root. Negative values are n steps up from ``node`` or ``startingPoint`` if defined. Defaults to ``1`` if no ``startingPoint`` is set otherwise ``0`` entryLevel = ${this.startingPoint ? 0 : 1} From 7edbbdcfea4b46f733dce687dc9aff8946c563bd Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Wed, 1 Nov 2023 17:12:13 +0100 Subject: [PATCH 108/113] TASK: Cleanup usage of `NodeTypeConstraintsWithSubNodeTypes` --- .../Feature/Common/ConstraintChecks.php | 20 +++--- .../Classes/NodeType/ConstraintCheck.php | 16 +++-- .../Classes/NodeType/NodeType.php | 2 +- .../Classes/NodeType/NodeTypeManager.php | 2 +- .../NodeTypeConstraintsWithSubNodeTypes.php | 62 ------------------- 5 files changed, 23 insertions(+), 79 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php index 7397fbf44f4..0980ba6be62 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php @@ -18,6 +18,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\DimensionSpace\Exception\DimensionSpacePointNotFound; +use Neos\ContentRepository\Core\NodeType\ConstraintCheck; use Neos\ContentRepository\Core\SharedModel\Exception\RootNodeAggregateDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Exception\ContentStreamDoesNotExistYet; use Neos\ContentRepository\Core\SharedModel\Exception\DimensionSpacePointIsNotYetOccupied; @@ -216,18 +217,15 @@ protected function requireNodeTypeToAllowNodesOfTypeInReference( if (is_null($propertyDeclaration)) { throw ReferenceCannotBeSet::becauseTheNodeTypeDoesNotDeclareIt($referenceName, $nodeTypeName); } - if (isset($propertyDeclaration['constraints']['nodeTypes'])) { - $nodeTypeConstraints = NodeTypeConstraintsWithSubNodeTypes::createFromNodeTypeDeclaration( - $propertyDeclaration['constraints']['nodeTypes'], - $this->getNodeTypeManager() + + $constraints = $propertyDeclaration['constraints']['nodeTypes'] ?? []; + + if (!ConstraintCheck::create($constraints)->isNodeTypeAllowed($nodeType)) { + throw ReferenceCannotBeSet::becauseTheConstraintsAreNotMatched( + $referenceName, + $nodeTypeName, + $nodeTypeNameInQuestion ); - if (!$nodeTypeConstraints->matches($nodeTypeNameInQuestion)) { - throw ReferenceCannotBeSet::becauseTheConstraintsAreNotMatched( - $referenceName, - $nodeTypeName, - $nodeTypeNameInQuestion - ); - } } } diff --git a/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php b/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php index 91058e9b8b8..3771b1234d7 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php @@ -6,16 +6,24 @@ * Performs node type constraint checks against a given set of constraints * @internal */ -class ConstraintCheck +final readonly class ConstraintCheck { /** - * @param array<string,mixed> $constraints + * @param array<string,bool> $constraints */ - public function __construct( - private readonly array $constraints + private function __construct( + private array $constraints ) { } + /** + * @param array<string,bool> $constraints + */ + public static function create(array $constraints): self + { + return new self($constraints); + } + public function isNodeTypeAllowed(NodeType $nodeType): bool { $directConstraintsResult = $this->isNodeTypeAllowedByDirectConstraints($nodeType); diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php index 1eaae89553c..bdc910dfcb7 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php @@ -479,7 +479,7 @@ public function getNodeTypeNameOfTetheredNode(NodeName $nodeName): NodeTypeName public function allowsChildNodeType(NodeType $nodeType): bool { $constraints = $this->getConfiguration('constraints.nodeTypes') ?: []; - return (new ConstraintCheck($constraints))->isNodeTypeAllowed($nodeType); + return ConstraintCheck::create($constraints)->isNodeTypeAllowed($nodeType); } /** diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php index ba6ec1cfd8e..69352cb5da3 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php @@ -260,7 +260,7 @@ public function isNodeTypeAllowedAsChildToTetheredNode(NodeType $parentNodeType, $constraints = Arrays::arrayMergeRecursiveOverrule($constraints, $childNodeConstraintConfiguration); - return (new ConstraintCheck($constraints))->isNodeTypeAllowed($nodeType); + return ConstraintCheck::create($constraints)->isNodeTypeAllowed($nodeType); } /** diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php index ec6300d2f31..fbfc380532c 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php @@ -33,50 +33,6 @@ private function __construct( ) { } - /** - * @param array<string,bool> $nodeTypeDeclaration - */ - public static function createFromNodeTypeDeclaration( - array $nodeTypeDeclaration, - NodeTypeManager $nodeTypeManager - ): self { - $wildCardAllowed = false; - $explicitlyAllowedNodeTypeNames = []; - $explicitlyDisallowedNodeTypeNames = []; - foreach ($nodeTypeDeclaration as $constraintName => $allowed) { - if ($constraintName === '*') { - $wildCardAllowed = $allowed; - } else { - if ($allowed) { - $explicitlyAllowedNodeTypeNames[] = $constraintName; - } else { - $explicitlyDisallowedNodeTypeNames[] = $constraintName; - } - } - } - - return new self( - $wildCardAllowed, - self::expandByIncludingSubNodeTypes( - NodeTypeNames::fromStringArray($explicitlyAllowedNodeTypeNames), - $nodeTypeManager - ), - self::expandByIncludingSubNodeTypes( - NodeTypeNames::fromStringArray($explicitlyDisallowedNodeTypeNames), - $nodeTypeManager - ) - ); - } - - public static function allowAll(): self - { - return new self( - true, - NodeTypeNames::createEmpty(), - NodeTypeNames::createEmpty(), - ); - } - public static function create(NodeTypeConstraints $nodeTypeConstraints, NodeTypeManager $nodeTypeManager): self { // in case there are no filters, we fall back to allowing every node type. @@ -137,22 +93,4 @@ public function matches(NodeTypeName $nodeTypeName): bool // otherwise, we return $wildcardAllowed. return $this->isWildCardAllowed; } - - public function toFilterString(): string - { - $parts = []; - if ($this->isWildCardAllowed) { - $parts[] = '*'; - } - - foreach ($this->explicitlyDisallowedNodeTypeNames as $nodeTypeName) { - $parts[] = '!' . $nodeTypeName->value; - } - - foreach ($this->explicitlyAllowedNodeTypeNames as $nodeTypeName) { - $parts[] = $nodeTypeName->value; - } - - return implode(',', $parts); - } } From 4c12b4c6c58187afeda125fc772a22ea372b545d Mon Sep 17 00:00:00 2001 From: Manuel Meister <news.manuelsworld@gmail.com> Date: Thu, 2 Nov 2023 12:13:21 +0100 Subject: [PATCH 109/113] BUGFIX: broken references in NeosFusionReference.rst Neos.Fusion:Tag and Neos.Fusion:DataStructure references were broken, as well as some other minor typos. --- Neos.Neos/Documentation/References/NeosFusionReference.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Neos.Neos/Documentation/References/NeosFusionReference.rst b/Neos.Neos/Documentation/References/NeosFusionReference.rst index d9bcffe89b4..4a163e6d179 100644 --- a/Neos.Neos/Documentation/References/NeosFusionReference.rst +++ b/Neos.Neos/Documentation/References/NeosFusionReference.rst @@ -474,7 +474,7 @@ Example:: value = ${1+2} } -.. _Neos_Fusion__Tag: +.. _Neos_Fusion__DataStructure: Neos.Fusion:DataStructure @@ -694,7 +694,7 @@ Neos.Fusion:Link.Resource Renders a link pointing to a resource :content: (string) content of the link tag -:href: (string, default :ref:`Neos_Fusion__ResouceUri`) The href for the link tag +:href: (string, default :ref:`Neos_Fusion__ResourceUri`) The href for the link tag :[key]: (string) Other attributes for the link tag Example:: @@ -1038,7 +1038,7 @@ The following fusion properties are passed over to :ref:`Neos_Neos__DimensionsMe :renderHiddenInIndex: (boolean, default **true**) If TRUE, render nodes which are marked as "hidded-in-index" :calculateItemStates: (boolean) activate the *expensive* calculation of item states defaults to ``false`` -.. note:: The ``items`` of the ``DimensionsMenu`` are internally calculated with the prototype :ref:`Neos_Neos__DimensionsMenuMenuItems` which +.. note:: The ``items`` of the ``DimensionsMenu`` are internally calculated with the prototype :ref:`Neos_Neos__DimensionsMenuItems` which you can use directly aswell. .. note:: The ``rendering`` of the ``DimensionsMenu`` is performed with the prototype :ref:`Neos_Neos__MenuItemListRenderer`. From 9515cbd1965ddd0b3824478a5c01793d217443ba Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 2 Nov 2023 14:49:24 +0100 Subject: [PATCH 110/113] TASK: 2nd. Fixup for pr #4641 ContentCollection.feature --- .../Tests/Behavior/Features/Bootstrap/FusionTrait.php | 7 ++++++- .../Behavior/Features/Fusion/ContentCollection.feature | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php index ecd35ee994b..705edc8cab2 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -26,6 +26,7 @@ use Neos\Fusion\Core\FusionSourceCodeCollection; use Neos\Fusion\Core\Parser; use Neos\Fusion\Core\RuntimeFactory; +use Neos\Fusion\Exception\RuntimeException; use Neos\Neos\Domain\Service\ContentContext; use Neos\Neos\Routing\RequestUriHostMiddleware; use PHPUnit\Framework\Assert; @@ -131,7 +132,11 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string try { $this->renderingResult = $fusionRuntime->render($path); } catch (\Throwable $exception) { - $this->lastRenderingException = $exception; + if ($exception instanceof RuntimeException) { + $this->lastRenderingException = $exception->getPrevious(); + } else { + $this->lastRenderingException = $exception; + } } $fusionRuntime->popContext(); } diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature index edadc686621..1a714d47815 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature @@ -33,7 +33,9 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype include: resource://Neos.Fusion/Private/Fusion/Root.fusion include: resource://Neos.Neos/Private/Fusion/Root.fusion - test = Neos.Neos:ContentCollection + test = Neos.Neos:ContentCollection { + @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler' + } """ Then I expect the following Fusion rendering error: """ @@ -48,6 +50,7 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype test = Neos.Neos:ContentCollection { nodePath = 'invalid' + @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler' } """ Then I expect the following Fusion rendering error: From ed59a52418509f2e5fba456237d462c410c01c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= <christian@flownative.com> Date: Thu, 2 Nov 2023 15:44:36 +0100 Subject: [PATCH 111/113] TASK: Remove CliSetup from development collection This allows users to use the new neos/setup package in the future as otherwise a conflict with CliSetup would occur with composer. Relates: #4243 --- .../Command/SetupCommandController.php | 195 ----- .../Command/WelcomeCommandController.php | 68 -- Neos.CliSetup/Classes/Exception.php | 19 - .../Database/DatabaseConnectionService.php | 121 ---- .../ImageHandler/ImageHandlerService.php | 78 -- Neos.CliSetup/Configuration/Settings.yaml | 24 - Neos.CliSetup/LICENSE | 675 ------------------ Neos.CliSetup/Readme.rst | 20 - Neos.CliSetup/composer.json | 17 - composer.json | 4 - 10 files changed, 1221 deletions(-) delete mode 100644 Neos.CliSetup/Classes/Command/SetupCommandController.php delete mode 100644 Neos.CliSetup/Classes/Command/WelcomeCommandController.php delete mode 100644 Neos.CliSetup/Classes/Exception.php delete mode 100644 Neos.CliSetup/Classes/Infrastructure/Database/DatabaseConnectionService.php delete mode 100644 Neos.CliSetup/Classes/Infrastructure/ImageHandler/ImageHandlerService.php delete mode 100644 Neos.CliSetup/Configuration/Settings.yaml delete mode 100644 Neos.CliSetup/LICENSE delete mode 100644 Neos.CliSetup/Readme.rst delete mode 100644 Neos.CliSetup/composer.json diff --git a/Neos.CliSetup/Classes/Command/SetupCommandController.php b/Neos.CliSetup/Classes/Command/SetupCommandController.php deleted file mode 100644 index 2bf87c00d1e..00000000000 --- a/Neos.CliSetup/Classes/Command/SetupCommandController.php +++ /dev/null @@ -1,195 +0,0 @@ -<?php -declare(strict_types=1); - -namespace Neos\CliSetup\Command; - -/* - * This file is part of the Neos.CliSetup package. - * - * (c) Contributors of the Neos Project - www.neos.io - * - * This package is Open Source Software. For the full copyright and license - * information, please view the LICENSE file which was distributed with this - * source code. - */ - -use Neos\Flow\Annotations as Flow; -use Neos\Flow\Cli\CommandController; -use Neos\Utility\Arrays; -use Neos\CliSetup\Exception as SetupException; -use Neos\CliSetup\Infrastructure\Database\DatabaseConnectionService; -use Neos\CliSetup\Infrastructure\ImageHandler\ImageHandlerService; -use Symfony\Component\Yaml\Yaml; - -/** - * @Flow\Scope("singleton") - */ -class SetupCommandController extends CommandController -{ - - /** - * @var DatabaseConnectionService - * @Flow\Inject - */ - protected $databaseConnectionService; - - /** - * @var array - * @Flow\InjectConfiguration(package="Neos.Flow", path="persistence.backendOptions") - */ - protected $persistenceConfiguration; - - /** - * @var ImageHandlerService - * @Flow\Inject - */ - protected $imageHandlerService; - - /** - * @var string - * @Flow\InjectConfiguration(package="Neos.Imagine", path="driver") - */ - protected $imagineDriver; - - /** - * Configure the database connection for flow persistence - * - * @param string|null $driver Driver - * @param string|null $host Hostname or IP - * @param string|null $dbname Database name - * @param string|null $user Username - * @param string|null $password Password - */ - public function databaseCommand(?string $driver = null, ?string $host = null, ?string $dbname = null, ?string $user = null, ?string $password = null): void - { - $availableDrivers = $this->databaseConnectionService->getAvailableDrivers(); - if (count($availableDrivers) == 0) { - $this->outputLine('No supported database driver found'); - $this->quit(1); - } - - if (is_null($driver)) { - $driver = $this->output->select( - sprintf('DB Driver (<info>%s</info>): ', $this->persistenceConfiguration['driver'] ?? '---'), - $availableDrivers, - $this->persistenceConfiguration['driver'] - ); - } - - if (is_null($host)) { - $host = $this->output->ask( - sprintf('Host (<info>%s</info>): ', $this->persistenceConfiguration['host'] ?? '127.0.0.1'), - $this->persistenceConfiguration['host'] ?? '127.0.0.1' - ); - } - - if (is_null($dbname)) { - $dbname = $this->output->ask( - sprintf('Database (<info>%s</info>): ', $this->persistenceConfiguration['dbname'] ?? '---'), - $this->persistenceConfiguration['dbname'] - ); - } - - if (is_null($user)) { - $user = $this->output->ask( - sprintf('Username (<info>%s</info>): ', $this->persistenceConfiguration['user'] ?? '---'), - $this->persistenceConfiguration['user'] - ); - } - - if (is_null($password)) { - $password = $this->output->ask( - sprintf('Password (<info>%s</info>): ', $this->persistenceConfiguration['password'] ?? '---'), - $this->persistenceConfiguration['password'] - ); - } - - $persistenceConfiguration = [ - 'driver' => $driver, - 'host' => $host, - 'dbname' => $dbname, - 'user' => $user, - 'password' => $password - ]; - - // postgres does not know utf8mb4 - if ($driver == 'pdo_pgsql') { - $persistenceConfiguration['charset'] = 'utf8'; - $persistenceConfiguration['defaultTableOptions']['charset'] = 'utf8'; - } - - $this->outputLine(); - - try { - $this->databaseConnectionService->verifyDatabaseConnectionWorks($persistenceConfiguration); - $this->outputLine(sprintf('Database <info>%s</info> was connected sucessfully.', $persistenceConfiguration['dbname'])); - } catch (SetupException $exception) { - try { - $this->databaseConnectionService->createDatabaseAndVerifyDatabaseConnectionWorks($persistenceConfiguration); - $this->outputLine(sprintf('Database <info>%s</info> was sucessfully created.', $persistenceConfiguration['dbname'])); - } catch (SetupException $exception) { - $this->outputLine(sprintf( - 'Database <info>%s</info> could not be created. Please check the permissions for user <info>%s</info>. Exception: <info>%s</info>', - $persistenceConfiguration['dbname'], - $persistenceConfiguration['user'], - $exception->getMessage() - )); - $this->quit(1); - } - } - - $filename = 'Configuration/Settings.Database.yaml'; - - $this->outputLine(); - $this->output(sprintf('<info>%s</info>',$this->writeSettings($filename, 'Neos.Flow.persistence.backendOptions',$persistenceConfiguration))); - $this->outputLine(); - $this->outputLine(sprintf('The new database settings were written to <info>%s</info>', $filename)); - } - - /** - * @param string|null $driver - */ - public function imageHandlerCommand(string $driver = null): void - { - $availableImageHandlers = $this->imageHandlerService->getAvailableImageHandlers(); - - if (count($availableImageHandlers) == 0) { - $this->outputLine('No supported image handler found.'); - $this->quit(1); - } - - if (is_null($driver)) { - $driver = $this->output->select( - sprintf('Select Image Handler (<info>%s</info>): ', array_key_last($availableImageHandlers)), - $availableImageHandlers, - array_key_last($availableImageHandlers) - ); - } - - $filename = 'Configuration/Settings.Imagehandling.yaml'; - $this->outputLine(); - $this->output(sprintf('<info>%s</info>', $this->writeSettings($filename, 'Neos.Imagine.driver', $driver))); - $this->outputLine(); - $this->outputLine(sprintf('The new image handler setting were written to <info>%s</info>', $filename)); - } - - /** - * Write the settings to the given path, existing configuration files are created or modified - * - * @param string $filename The filename the settings are stored in - * @param string $path The configuration path - * @param mixed $settings The actual settings to write - * @return string The added yaml code - */ - protected function writeSettings(string $filename, string $path, $settings): string - { - if (file_exists($filename)) { - $previousSettings = Yaml::parseFile($filename); - } else { - $previousSettings = []; - } - $newSettings = Arrays::setValueByPath($previousSettings,$path, $settings); - file_put_contents($filename, YAML::dump($newSettings, 10, 2)); - return YAML::dump(Arrays::setValueByPath([],$path, $settings), 10, 2); - } -} diff --git a/Neos.CliSetup/Classes/Command/WelcomeCommandController.php b/Neos.CliSetup/Classes/Command/WelcomeCommandController.php deleted file mode 100644 index 292a8885ec3..00000000000 --- a/Neos.CliSetup/Classes/Command/WelcomeCommandController.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Neos\CliSetup\Command; - -/* - * This file is part of the Neos.CliSetup package. - * - * (c) Contributors of the Neos Project - www.neos.io - * - * This package is Open Source Software. For the full copyright and license - * information, please view the LICENSE file which was distributed with this - * source code. - */ - -use Neos\Flow\Annotations as Flow; -use Neos\Flow\Cli\CommandController; - -/** - * @Flow\Scope("singleton") - */ -class WelcomeCommandController extends CommandController -{ - - public function indexCommand(): void - { - $this->output( - <<<EOT - <info> - ....###### .###### - .....####### ...###### - .......####### ....###### - .........####### ....###### - ....#......#######...###### - ....##.......#######.###### - ....#####......############ - ....##### ......########## - ....##### ......######## - ....##### ......###### - .####### ........ - - Welcome to Neos. - </info> - - The following steps will help you to configure Neos: - - 1. Configure the database connection: - <info>./flow setup:database</info> - 2. Create the required database tables: - <info>./flow doctrine:migrate</info> - 3. Configure the image handler: - <info>./flow setup:imagehandler</info> - 4. Create an admin user: - <info>./flow user:create --roles Administrator username password firstname lastname </info> - 5. Create your own site package or require an existing one (choose one option): - - <info>./flow kickstart:site Vendor.Site</info> - - <info>composer require neos/demo && ./flow flow:package:rescan</info> - 6. Import a site or create an empty one (choose one option): - - <info>./flow site:import Neos.Demo</info> - - <info>./flow site:import Vendor.Site</info> - - <info>./flow site:create sitename Vendor.Site Vendor.Site:Document.HomePage</info> - - EOT - ); - } - -} diff --git a/Neos.CliSetup/Classes/Exception.php b/Neos.CliSetup/Classes/Exception.php deleted file mode 100644 index e792dc7c6cd..00000000000 --- a/Neos.CliSetup/Classes/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -namespace Neos\CliSetup; - -/* - * This file is part of the Neos.CliSetup package. - * - * (c) Contributors of the Neos Project - www.neos.io - * - * This package is Open Source Software. For the full copyright and license - * information, please view the LICENSE file which was distributed with this - * source code. - */ - -/** - * A generic Setup Exception - */ -class Exception extends \Neos\Flow\Exception -{ -} diff --git a/Neos.CliSetup/Classes/Infrastructure/Database/DatabaseConnectionService.php b/Neos.CliSetup/Classes/Infrastructure/Database/DatabaseConnectionService.php deleted file mode 100644 index c7a34869c73..00000000000 --- a/Neos.CliSetup/Classes/Infrastructure/Database/DatabaseConnectionService.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -declare(strict_types=1); - -namespace Neos\CliSetup\Infrastructure\Database; - -/* - * This file is part of the Neos.CliSetup package. - * - * (c) Contributors of the Neos Project - www.neos.io - * - * This package is Open Source Software. For the full copyright and license - * information, please view the LICENSE file which was distributed with this - * source code. - */ - -use Neos\Flow\Annotations as Flow; -use Doctrine\DBAL\DriverManager; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; -use Neos\CliSetup\Exception as SetupException; -use Doctrine\DBAL\Exception as DBALException; - -class DatabaseConnectionService -{ - - /** - * @Flow\InjectConfiguration(path="supportedDatabaseDrivers") - * @var array<string, string> - */ - protected $supportedDatabaseDrivers; - - /** - * Return an array with the available database drivers - * - * @return array<string,string> - */ - public function getAvailableDrivers(): array - { - $availableDrivers = []; - foreach ($this->supportedDatabaseDrivers as $driver => $description) { - if (extension_loaded($driver)) { - $availableDrivers[$driver] = $description; - } - } - return $availableDrivers; - } - - /** - * Verify the database connection settings - * - * @param array $connectionSettings - * @throws SetupException - */ - public function verifyDatabaseConnectionWorks(array $connectionSettings) - { - try { - $this->connectToDatabase($connectionSettings); - } catch (DBALException | \PDOException $exception) { - throw new SetupException(sprintf('Could not connect to database "%s". Please check the permissions for user "%s". DBAL Exception: "%s"', $connectionSettings['dbname'], $connectionSettings['user'], $exception->getMessage()), 1351000864); - } - } - - /** - * Create a database with the connection settings and verify the connection - * - * @param array $connectionSettings - * @throws SetupException - */ - public function createDatabaseAndVerifyDatabaseConnectionWorks(array $connectionSettings) - { - try { - $this->createDatabase($connectionSettings, $connectionSettings['dbname']); - } catch (DBALException | \PDOException $exception) { - throw new SetupException(sprintf('Database "%s" could not be created. Please check the permissions for user "%s". DBAL Exception: "%s"', $connectionSettings['dbname'], $connectionSettings['user'], $exception->getMessage()), 1351000841, $exception); - } - try { - $this->connectToDatabase($connectionSettings); - } catch (DBALException | \PDOException $exception) { - throw new SetupException(sprintf('Could not connect to database "%s". Please check the permissions for user "%s". DBAL Exception: "%s"', $connectionSettings['dbname'], $connectionSettings['user'], $exception->getMessage()), 1351000864); - } - } - - /** - * Tries to connect to the database using the specified $connectionSettings - * - * @param array $connectionSettings array in the format array('user' => 'dbuser', 'password' => 'dbpassword', 'host' => 'dbhost', 'dbname' => 'dbname') - * @return void - * @throws \Doctrine\DBAL\Exception | \PDOException if the connection fails - */ - protected function connectToDatabase(array $connectionSettings) - { - $connection = DriverManager::getConnection($connectionSettings); - $connection->connect(); - } - - /** - * Connects to the database using the specified $connectionSettings - * and tries to create a database named $databaseName. - * - * @param array $connectionSettings array in the format array('user' => 'dbuser', 'password' => 'dbpassword', 'host' => 'dbhost', 'dbname' => 'dbname') - * @param string $databaseName name of the database to create - * @throws \Neos\Setup\Exception - * @return void - */ - protected function createDatabase(array $connectionSettings, $databaseName) - { - unset($connectionSettings['dbname']); - $connection = DriverManager::getConnection($connectionSettings); - $databasePlatform = $connection->getSchemaManager()->getDatabasePlatform(); - $databaseName = $databasePlatform->quoteIdentifier($databaseName); - // we are not using $databasePlatform->getCreateDatabaseSQL() below since we want to specify charset and collation - if ($databasePlatform instanceof MySqlPlatform) { - $connection->executeUpdate(sprintf('CREATE DATABASE %s CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci', $databaseName)); - } elseif ($databasePlatform instanceof PostgreSqlPlatform) { - $connection->executeUpdate(sprintf('CREATE DATABASE %s WITH ENCODING = %s', $databaseName, "'UTF8'")); - } else { - throw new SetupException(sprintf('The given database platform "%s" is not supported.', $databasePlatform->getName()), 1386454885); - } - $connection->close(); - } -} diff --git a/Neos.CliSetup/Classes/Infrastructure/ImageHandler/ImageHandlerService.php b/Neos.CliSetup/Classes/Infrastructure/ImageHandler/ImageHandlerService.php deleted file mode 100644 index cc4cb6ec69f..00000000000 --- a/Neos.CliSetup/Classes/Infrastructure/ImageHandler/ImageHandlerService.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php -declare(strict_types=1); - -namespace Neos\CliSetup\Infrastructure\ImageHandler; - -/* - * This file is part of the Neos.CliSetup package. - * - * (c) Contributors of the Neos Project - www.neos.io - * - * This package is Open Source Software. For the full copyright and license - * information, please view the LICENSE file which was distributed with this - * source code. - */ - -use Neos\Flow\Annotations as Flow; -use Neos\Imagine\ImagineFactory; - -class ImageHandlerService -{ - - /** - * @Flow\InjectConfiguration(path="supportedImageHandlers") - * @var string[] - */ - protected $supportedImageHandlers; - - /** - * @Flow\InjectConfiguration(path="requiredImageFormats") - * @var string[] - */ - protected $requiredImageFormats; - - /** - * @Flow\Inject - * @var ImagineFactory - */ - protected $imagineFactory; - - /** - * Return all Imagine drivers that support the loading of the required images - * - * @return array<string,string> - */ - public function getAvailableImageHandlers(): array - { - $availableImageHandlers = []; - foreach ($this->supportedImageHandlers as $driverName => $description) { - if (\extension_loaded(strtolower($driverName))) { - $unsupportedFormats = $this->findUnsupportedImageFormats($driverName); - if (\count($unsupportedFormats) === 0) { - $availableImageHandlers[$driverName] = $description; - } - } - } - return $availableImageHandlers; - } - - /** - * @param string $driver - * @return array Not supported image formats - */ - protected function findUnsupportedImageFormats(string $driver): array - { - $this->imagineFactory->injectSettings(['driver' => ucfirst($driver)]); - $imagine = $this->imagineFactory->create(); - $unsupportedFormats = []; - - foreach ($this->requiredImageFormats as $imageFormat => $testFile) { - try { - $imagine->load(file_get_contents($testFile)); - } /** @noinspection BadExceptionsProcessingInspection */ catch (\Exception $exception) { - $unsupportedFormats[] = $imageFormat; - } - } - return $unsupportedFormats; - } -} diff --git a/Neos.CliSetup/Configuration/Settings.yaml b/Neos.CliSetup/Configuration/Settings.yaml deleted file mode 100644 index a98508ce232..00000000000 --- a/Neos.CliSetup/Configuration/Settings.yaml +++ /dev/null @@ -1,24 +0,0 @@ -Neos: - CliSetup: - # - # Imagine drivers that are supported - # - supportedImageHandlers: - 'Gd': 'GD Library - generally slow, not recommended in production' - 'Gmagick': 'Gmagick php module' - 'Imagick': 'ImageMagick php module' - 'Vips': 'Vips php module - fast and memory efficient, needs rokka/imagine-vips' - # - # Images to verify that the format can be handled - # - requiredImageFormats: - 'jpg': 'resource://Neos.Neos/Private/Installer/TestImages/Test.jpg' - 'gif': 'resource://Neos.Neos/Private/Installer/TestImages/Test.gif' - 'png': 'resource://Neos.Neos/Private/Installer/TestImages/Test.png' - # - # The database drivers that are supported by migrations - # - supportedDatabaseDrivers: - 'pdo_mysql': 'MySQL/MariaDB via PDO' - 'mysqli': 'MySQL/MariaDB via mysqli' - 'pdo_pgsql': 'PostgreSQL via PDO' diff --git a/Neos.CliSetup/LICENSE b/Neos.CliSetup/LICENSE deleted file mode 100644 index 10926e87f11..00000000000 --- a/Neos.CliSetup/LICENSE +++ /dev/null @@ -1,675 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. - diff --git a/Neos.CliSetup/Readme.rst b/Neos.CliSetup/Readme.rst deleted file mode 100644 index 3f58184c434..00000000000 --- a/Neos.CliSetup/Readme.rst +++ /dev/null @@ -1,20 +0,0 @@ ----------------- -The Neos package ----------------- - -.. note:: This repository is a **read-only subsplit** of a package that is part of the - Neos project (learn more on `www.neos.io <https://www.neos.io/>`_). - -Neos is an open source Content Application Platform based on Flow. A set of -core Content Management features is resting within a larger context that allows -you to build a perfectly customized experience for your users. - -If you want to use Neos, please have a look at the `Neos documentation -<http://neos.readthedocs.org/en/stable/>`_ - -Contribute ----------- - -If you want to contribute to Neos, please have a look at -https://github.com/neos/neos-development-collection - it is the repository -used for development and all pull requests should go into it. diff --git a/Neos.CliSetup/composer.json b/Neos.CliSetup/composer.json deleted file mode 100644 index 1312eccac4e..00000000000 --- a/Neos.CliSetup/composer.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "neos/cli-setup", - "type": "neos-package", - "license": [ - "GPL-3.0-or-later" - ], - "description": "ClI setup for Neos CMS", - "require": { - "php": "^8.0", - "neos/neos": "self.version" - }, - "autoload": { - "psr-4": { - "Neos\\CliSetup\\": "Classes" - } - } -} diff --git a/composer.json b/composer.json index a68d3b1a4ce..9f9477f5973 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,6 @@ "typo3/neos": "self.version", "typo3/neos-nodetypes": "self.version", "typo3/neos-kickstarter": "self.version", - "neos/cli-setup": "self.version", "neos/content-repository": "self.version", "neos/diff": "self.version", "neos/fusion-afx": "self.version", @@ -66,9 +65,6 @@ }, "autoload": { "psr-4": { - "Neos\\CliSetup\\": [ - "Neos.CliSetup/Classes" - ], "Neos\\ContentRepository\\": [ "Neos.ContentRepository/Classes" ], From 478064b905989ec2968433b4e487515146dae553 Mon Sep 17 00:00:00 2001 From: Jenkins <jenkins@neos.io> Date: Thu, 2 Nov 2023 14:52:52 +0000 Subject: [PATCH 112/113] TASK: Update references [skip ci] --- Neos.Neos/Documentation/References/CommandReference.rst | 2 +- Neos.Neos/Documentation/References/EelHelpersReference.rst | 2 +- .../Documentation/References/FlowQueryOperationReference.rst | 2 +- .../Documentation/References/Signals/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/Signals/Flow.rst | 2 +- Neos.Neos/Documentation/References/Signals/Media.rst | 2 +- Neos.Neos/Documentation/References/Signals/Neos.rst | 2 +- Neos.Neos/Documentation/References/Validators/Flow.rst | 2 +- Neos.Neos/Documentation/References/Validators/Media.rst | 2 +- Neos.Neos/Documentation/References/Validators/Party.rst | 2 +- .../Documentation/References/ViewHelpers/ContentRepository.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Form.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Media.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/Neos.rst | 2 +- Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Neos.Neos/Documentation/References/CommandReference.rst b/Neos.Neos/Documentation/References/CommandReference.rst index 5e486ba7350..add3788133f 100644 --- a/Neos.Neos/Documentation/References/CommandReference.rst +++ b/Neos.Neos/Documentation/References/CommandReference.rst @@ -19,7 +19,7 @@ commands that may be available, use:: ./flow help -The following reference was automatically generated from code on 2023-11-01 +The following reference was automatically generated from code on 2023-11-02 .. _`Neos Command Reference: NEOS.CONTENTREPOSITORY`: diff --git a/Neos.Neos/Documentation/References/EelHelpersReference.rst b/Neos.Neos/Documentation/References/EelHelpersReference.rst index e285d1c8ccc..8886e500d60 100644 --- a/Neos.Neos/Documentation/References/EelHelpersReference.rst +++ b/Neos.Neos/Documentation/References/EelHelpersReference.rst @@ -3,7 +3,7 @@ Eel Helpers Reference ===================== -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Eel Helpers Reference: Api`: diff --git a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst index 313561e3f2d..96b99085704 100644 --- a/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst +++ b/Neos.Neos/Documentation/References/FlowQueryOperationReference.rst @@ -3,7 +3,7 @@ FlowQuery Operation Reference ============================= -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`FlowQuery Operation Reference: add`: diff --git a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst index 62af6be6d29..1b7d15339ef 100644 --- a/Neos.Neos/Documentation/References/Signals/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/Signals/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository Signals Reference ==================================== -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Content Repository Signals Reference: Context (``Neos\ContentRepository\Domain\Service\Context``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Flow.rst b/Neos.Neos/Documentation/References/Signals/Flow.rst index b0c21600b1c..0b39d27fdab 100644 --- a/Neos.Neos/Documentation/References/Signals/Flow.rst +++ b/Neos.Neos/Documentation/References/Signals/Flow.rst @@ -3,7 +3,7 @@ Flow Signals Reference ====================== -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Flow Signals Reference: AbstractAdvice (``Neos\Flow\Aop\Advice\AbstractAdvice``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Media.rst b/Neos.Neos/Documentation/References/Signals/Media.rst index c85d2749301..e5f473b8be1 100644 --- a/Neos.Neos/Documentation/References/Signals/Media.rst +++ b/Neos.Neos/Documentation/References/Signals/Media.rst @@ -3,7 +3,7 @@ Media Signals Reference ======================= -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Media Signals Reference: AssetCollectionController (``Neos\Media\Browser\Controller\AssetCollectionController``)`: diff --git a/Neos.Neos/Documentation/References/Signals/Neos.rst b/Neos.Neos/Documentation/References/Signals/Neos.rst index 2ebf0272945..f952ab20379 100644 --- a/Neos.Neos/Documentation/References/Signals/Neos.rst +++ b/Neos.Neos/Documentation/References/Signals/Neos.rst @@ -3,7 +3,7 @@ Neos Signals Reference ====================== -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Neos Signals Reference: AbstractCreate (``Neos\Neos\Ui\Domain\Model\Changes\AbstractCreate``)`: diff --git a/Neos.Neos/Documentation/References/Validators/Flow.rst b/Neos.Neos/Documentation/References/Validators/Flow.rst index 9a355dbd25f..e73cf096111 100644 --- a/Neos.Neos/Documentation/References/Validators/Flow.rst +++ b/Neos.Neos/Documentation/References/Validators/Flow.rst @@ -3,7 +3,7 @@ Flow Validator Reference ======================== -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Flow Validator Reference: AggregateBoundaryValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Media.rst b/Neos.Neos/Documentation/References/Validators/Media.rst index 4ab02a7bfcf..f28c5731211 100644 --- a/Neos.Neos/Documentation/References/Validators/Media.rst +++ b/Neos.Neos/Documentation/References/Validators/Media.rst @@ -3,7 +3,7 @@ Media Validator Reference ========================= -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Media Validator Reference: ImageOrientationValidator`: diff --git a/Neos.Neos/Documentation/References/Validators/Party.rst b/Neos.Neos/Documentation/References/Validators/Party.rst index 4a838dacc18..e1bdeafa022 100644 --- a/Neos.Neos/Documentation/References/Validators/Party.rst +++ b/Neos.Neos/Documentation/References/Validators/Party.rst @@ -3,7 +3,7 @@ Party Validator Reference ========================= -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Party Validator Reference: AimAddressValidator`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst index 096af561261..e849736eab2 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/ContentRepository.rst @@ -3,7 +3,7 @@ Content Repository ViewHelper Reference ####################################### -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Content Repository ViewHelper Reference: PaginateViewHelper`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst index 8fd558f5957..e35eed82196 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/FluidAdaptor.rst @@ -3,7 +3,7 @@ FluidAdaptor ViewHelper Reference ################################# -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`FluidAdaptor ViewHelper Reference: f:debug`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst index 31197ac31f0..4355b49928a 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Form.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Form.rst @@ -3,7 +3,7 @@ Form ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Form ViewHelper Reference: neos.form:form`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst index 9879c19d84d..eb0a9632b9f 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Fusion.rst @@ -3,7 +3,7 @@ Fusion ViewHelper Reference ########################### -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Fusion ViewHelper Reference: fusion:render`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst index 895e7e0a245..affad58f6dc 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Media.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Media.rst @@ -3,7 +3,7 @@ Media ViewHelper Reference ########################## -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Media ViewHelper Reference: neos.media:fileTypeIcon`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst index a82cac259fe..cd54632b01b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/Neos.rst @@ -3,7 +3,7 @@ Neos ViewHelper Reference ######################### -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`: diff --git a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst index adfa88e2413..a9324ad945b 100644 --- a/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst +++ b/Neos.Neos/Documentation/References/ViewHelpers/TYPO3Fluid.rst @@ -3,7 +3,7 @@ TYPO3 Fluid ViewHelper Reference ################################ -This reference was automatically generated from code on 2023-11-01 +This reference was automatically generated from code on 2023-11-02 .. _`TYPO3 Fluid ViewHelper Reference: f:alias`: From 6e9e6a245f93db38f79e8f574e2f7f2bd35948e6 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:38:14 +0100 Subject: [PATCH 113/113] TASK: Fix Fusion e3e tests --- .../Behavior/Features/Bootstrap/FusionTrait.php | 14 ++++++++++---- .../Behavior/Features/Fusion/ContentCase.feature | 2 +- .../Features/Fusion/ContentCollection.feature | 11 ++++------- .../Behavior/Features/Fusion/ConvertUris.feature | 2 +- .../Tests/Behavior/Features/Fusion/Menu.feature | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php index 93357537b32..c883c4d76ca 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php @@ -35,7 +35,6 @@ */ trait FusionTrait { - use RoutingTrait; use ProjectedNodeTrait; use CRTestSuiteRuntimeVariables; @@ -49,6 +48,14 @@ trait FusionTrait private ?\Throwable $lastRenderingException = null; + /** + * @template T of object + * @param class-string<T> $className + * + * @return T + */ + abstract private function getObject(string $className): object; + /** * @BeforeScenario */ @@ -94,7 +101,7 @@ public function theFusionContextNodeIs(string $nodeAggregateId): void */ public function theFusionContextRequestIs(string $requestUri = null): void { - $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', $requestUri); + $httpRequest = $this->getObject(ServerRequestFactoryInterface::class)->createServerRequest('GET', $requestUri); $httpRequest = $this->addRoutingParameters($httpRequest); $this->fusionGlobalContext['request'] = ActionRequest::fromHttpRequest($httpRequest); @@ -108,7 +115,6 @@ public function iHaveTheFollowingFusionSetup(PyStringNode $fusionCode): void $this->fusionCode = $fusionCode->getRaw(); } - /** * @When I execute the following Fusion code: * @When I execute the following Fusion code on path :path: @@ -126,7 +132,7 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string $fusionGlobals = FusionGlobals::fromArray($this->fusionGlobalContext); $fusionRuntime = (new RuntimeFactory())->createFromConfiguration($fusionAst, $fusionGlobals); - $fusionRuntime->overrideExceptionHandler($this->getObjectManager()->get(ThrowingHandler::class)); + $fusionRuntime->overrideExceptionHandler($this->getObject(ThrowingHandler::class)); $fusionRuntime->pushContextArray($this->fusionContext); try { $this->renderingResult = $fusionRuntime->render($path); diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature index ca7472cda93..3c18ebada65 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCase.feature @@ -1,4 +1,4 @@ -@fixtures +@flowEntities Feature: Tests for the "Neos.Neos:ContentCase" Fusion prototype Background: diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature index aff1dd9b1ed..c834e9cb06e 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature @@ -1,4 +1,4 @@ -@fixtures +@flowEntities Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype Background: @@ -72,13 +72,11 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype include: resource://Neos.Fusion/Private/Fusion/Root.fusion include: resource://Neos.Neos/Private/Fusion/Root.fusion - test = Neos.Neos:ContentCollection { - @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler' - } + test = Neos.Neos:ContentCollection """ Then I expect the following Fusion rendering error: """ - No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/[root]) or at the path "to-be-set-by-user". You might want to adjust your node type configuration and create the missing child node through the "flow structureadjustments:fix --node-type Neos.Neos:Site" command. """ Scenario: invalid nodePath @@ -89,12 +87,11 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype test = Neos.Neos:ContentCollection { nodePath = 'invalid' - @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler' } """ Then I expect the following Fusion rendering error: """ - No content collection of type Neos.Neos:ContentCollection could be found in the current node (/sites/a) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "./flow node:repair --node-type Neos.Neos:Test.DocumentType" command. + No content collection of type Neos.Neos:ContentCollection could be found in the current node (/[root]) or at the path "invalid". You might want to adjust your node type configuration and create the missing child node through the "flow structureadjustments:fix --node-type Neos.Neos:Site" command. """ Scenario: empty ContentCollection diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature index a895188a3ae..f9b0575cabe 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ConvertUris.feature @@ -1,4 +1,4 @@ -@fixtures +@flowEntities Feature: Tests for the "Neos.Neos:ConvertUris" Fusion prototype Background: diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature index c1e5f225070..9d94f027ac5 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/Menu.feature @@ -1,4 +1,4 @@ -@fixtures @contentrepository +@flowEntities @contentrepository Feature: Tests for the "Neos.Neos:Menu" and related Fusion prototypes Background: