diff --git a/Classes/Fusion/FormElementWrappingImplementation.php b/Classes/Fusion/FormElementWrappingImplementation.php index 0cd648a..8eb9515 100644 --- a/Classes/Fusion/FormElementWrappingImplementation.php +++ b/Classes/Fusion/FormElementWrappingImplementation.php @@ -1,7 +1,11 @@ runtime->getCurrentContext(); + /** @var FormRuntime $formRuntime */ if (!isset($context['formRuntime'])) { throw new FusionException(sprintf('Missing "formRuntime" in context for Form Element Wrapping Fusion object "%s" at "%s"', $this->fusionObjectName, $this->path), 1522829151); } - /** @var FormRuntime $formRuntime */ $formRuntime = $context['formRuntime']; $formRuntime->registerRenderCallback(function (string $output, RootRenderableInterface $renderable) { $renderingOptions = $renderable->getRenderingOptions(); @@ -42,44 +43,47 @@ public function evaluate() // TODO error/log? return $output; } - /** @var NodeInterface $node */ + /** @var Node $node */ $node = $renderingOptions['_node']; + $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); + /** @var string $fusionPath */ $fusionPath = $renderingOptions['_fusionPath']; if ($renderable instanceof Page) { - $elementsNode = $node->getNode('elements'); + $elementsNode = $subgraph->findNodeByPath(NodeName::fromString('elements'), $node->aggregateId); if ($elementsNode !== null) { - $output = $this->wrapNode($elementsNode, $output, $fusionPath); + $output = $this->wrapNode($subgraph, $elementsNode, $output, $fusionPath); } // first page? add finisher collection and return the wrapped content - if ($node->getNodeType()->isOfType('Neos.Form.Builder:NodeBasedForm')) { - $finishersNode = $node->getNode('finishers'); + $nodeTypeManager = $this->contentRepositoryRegistry->get($node->contentRepositoryId)->getNodeTypeManager(); + if ($nodeTypeManager->getNodeType($node->nodeTypeName)->isOfType('Neos.Form.Builder:NodeBasedForm')) { + $finishersNode = $subgraph->findNodeByPath(NodeName::fromString('finishers'), $node->aggregateId); if ($finishersNode !== null) { - $output = $this->wrapNodeRecursively($finishersNode, '', $fusionPath . '/finishers') . $output; + $output = $this->wrapNodeRecursively($subgraph, $finishersNode, '', $fusionPath . '/finishers') . $output; } if (!$renderable->getRootForm()->hasPageWithIndex(1)) { - $furtherPagesNode = $node->getNode('furtherPages'); + $furtherPages = $subgraph->findNodeByPath(NodeName::fromString('furtherPages'), $node->aggregateId); if ($furtherPagesNode !== null) { - $output = $output . $this->wrapNode($furtherPagesNode, '', $fusionPath . '/furtherPages'); + $output = $output . $this->wrapNode($subgraph, $furtherPages, '', $fusionPath . '/furtherPages'); } } return $output; } // otherwise store wrapped page content until last page - $this->pendingOutput .= $this->wrapNode($node, $output, $fusionPath); + $this->pendingOutput .= $this->wrapNode($subgraph, $node, $output, $fusionPath); if (!$this->isLastPageNode($node)) { return ''; } - return $this->wrapNode($node, $this->pendingOutput, $this->parentFusionPath($fusionPath)); + return $this->wrapNode($subgraph, $node, $this->pendingOutput, $this->parentFusionPath($fusionPath)); } - return $this->wrapNodeRecursively($node, $output, $fusionPath); + return $this->wrapNodeRecursively($subgraph, $node, $output, $fusionPath); }); } - private function isLastPageNode(NodeInterface $node): bool + private function isLastPageNode(Node $node): bool { $flowQuery = new FlowQuery([$node]); /** @noinspection PhpUndefinedMethodInspection */ @@ -91,24 +95,24 @@ public function parentFusionPath(string $fusionPath): string return substr($fusionPath, 0, strrpos($fusionPath, '/')); } - private function wrapNodeRecursively(NodeInterface $node, string $output, string $fusionPath): string + private function wrapNodeRecursively(ContentSubgraphInterface $subgraph, Node $node, string $output, string $fusionPath): string { - /** @var NodeInterface $childNode */ - foreach ($node->getChildNodes() as $childNode) { - $output .= $this->wrapNodeRecursively($childNode, '', $fusionPath . '/' . $childNode->getIdentifier()); + /** @var Node $childNode */ + foreach ($subgraph->findChildNodes($node->aggregateId, FindChildNodesFilter::create()) as $childNode) { + $output .= $this->wrapNodeRecursively($subgraph, $childNode, '', $fusionPath . '/' . $childNode->aggregateId->value); } - return $this->wrapNode($node, $output, $fusionPath); + return $this->wrapNode($subgraph, $node, $output, $fusionPath); } - private function wrapNode(NodeInterface $node, string $output, string $fusionPath): string + private function wrapNode(ContentSubgraphInterface $subgraph, Node $node, string $output, string $fusionPath): string { $additionalAttributes = [ - 'data-_neos-form-builder-type' => $node->getNodeType()->getName() + 'data-_neos-form-builder-type' => $node->nodeTypeName ]; - if ($node->getNodeType()->isOfType('Neos.Neos:ContentCollection') && count($node->getChildNodes()) === 0) { + $nodeTypeManager = $this->contentRepositoryRegistry->get($node->contentRepositoryId)->getNodeTypeManager(); + if ($nodeTypeManager->getNodeType($node->nodeTypeName)->isOfType('Neos.Neos:ContentCollection') && $subgraph->findChildNodes($node->aggregateId, FindChildNodesFilter::create())->count() === 0) { $additionalAttributes['data-_neos-form-builder-empty-collection'] = true; } return $this->contentElementWrappingService->wrapContentObject($node, $output, $fusionPath, $additionalAttributes); } - -} +} \ No newline at end of file diff --git a/Classes/Fusion/Helper/NodeHelper.php b/Classes/Fusion/Helper/NodeHelper.php index ce92519..c2b80b9 100644 --- a/Classes/Fusion/Helper/NodeHelper.php +++ b/Classes/Fusion/Helper/NodeHelper.php @@ -1,7 +1,8 @@ getProperties(); - if ($nodeProperties instanceof \Traversable) { + $nodeProperties = $node->properties; + if ($nodeProperties instanceof PropertyCollection) { $nodeProperties = iterator_to_array($nodeProperties); } return array_merge($properties, $nodeProperties); diff --git a/Classes/Fusion/SelectOptionCollectionImplementation.php b/Classes/Fusion/SelectOptionCollectionImplementation.php index 099b64d..9c9d8fd 100644 --- a/Classes/Fusion/SelectOptionCollectionImplementation.php +++ b/Classes/Fusion/SelectOptionCollectionImplementation.php @@ -7,16 +7,21 @@ class SelectOptionCollectionImplementation extends AbstractArrayFusionObject { - protected $ignoreProperties = ['prependOptionLabel', 'prependOptionValue', 'labelPropertyPath', 'valuePropertyPath']; + protected $ignoreProperties = [ + 'prependOptionLabel', + 'prependOptionValue', + 'labelPropertyPath', + 'valuePropertyPath' + ]; public function evaluate() { - $collection = $this->getCollection(); + $items = $this->getItems(); $options = []; if (!empty($prependLabel = $this->getPrependOptionLabel())) { $options[$this->getPrependOptionValue()] = $prependLabel; } - if ($collection === null) { + if ($items === null) { foreach ($this->properties as $propertyName => $propertyValue) { if (in_array($propertyName, $this->ignoreProperties)) { continue; @@ -24,7 +29,7 @@ public function evaluate() $options[$propertyName] = $propertyValue; } } else { - foreach ($collection as $item) { + foreach ($items as $item) { $value = ObjectAccess::getPropertyPath($item, $this->getValuePropertyPath()); $label = ObjectAccess::getPropertyPath($item, $this->getLabelPropertyPath()); if (strlen($label) === 0) { @@ -39,9 +44,9 @@ public function evaluate() /** * @return array|\Traversable */ - private function getCollection() + private function getItems() { - return $this->fusionValue('collection'); + return $this->fusionValue('items'); } private function getValuePropertyPath(): string diff --git a/Classes/NodeType/FormNodeTypePostprocessor.php b/Classes/NodeType/FormNodeTypePostprocessor.php index 42d65f9..9630d26 100644 --- a/Classes/NodeType/FormNodeTypePostprocessor.php +++ b/Classes/NodeType/FormNodeTypePostprocessor.php @@ -1,8 +1,8 @@ getNodeType()->isOfType('Neos.Form.Builder:SelectOption')) { - return; - } - if (isset($data['value'])) { - $node->setProperty('value', $data['value']); - } - if (isset($data['label'])) { - $node->setProperty('label', $data['label']); - } - } -} + + public function build(ContentRepository $contentRepository): NodeCreationHandlerInterface + { + return new class ($contentRepository->getNodeTypeManager()) implements NodeCreationHandlerInterface { + public function __construct( + private readonly NodeTypeManager $nodeTypeManager + ) { + } + + public function handle(NodeCreationCommands $commands, NodeCreationElements $elements): NodeCreationCommands + { + $nodeType = $this->nodeTypeManager->getNodeType($commands->first->nodeTypeName); + + if (!$nodeType->isOfType('Neos.Form.Builder:SelectOption')) { + return $commands; + } + + $propertyValues = $commands->first->initialPropertyValues; + + foreach ($elements as $elementName => $elementValue) { + if ($elementName === 'value') { + $propertyValues = $propertyValues->withValue('value', $elementValue); + } + if ($elementName === 'label') { + $propertyValues = $propertyValues->withValue('label', $elementValue); + } + } + + return $commands + ->withInitialPropertyValues($propertyValues) + ; + } + }; + } +} \ No newline at end of file diff --git a/Classes/Package.php b/Classes/Package.php index c50300d..f2d0992 100644 --- a/Classes/Package.php +++ b/Classes/Package.php @@ -1,10 +1,9 @@ getSignalSlotDispatcher(); - - $dispatcher->connect(Node::class, 'nodePropertyChanged', function (NodeInterface $node, $propertyName, $_, $newValue) { - if ($propertyName !== 'identifier' || empty($newValue) || !$node->getNodeType()->isOfType(self::NODE_TYPE_IDENTIFIER_MIXIN)) { - return; - } - - $this->setUniqueFormElementIdentifier($node, $newValue); - }); - - $dispatcher->connect(Node::class, 'nodeAdded', function (NodeInterface $node) { - try { - $identifier = $node->getProperty('identifier'); - - if (empty($identifier) || !$node->getNodeType()->isOfType(self::NODE_TYPE_IDENTIFIER_MIXIN)) { - return; - } - } catch (\Neos\ContentRepository\Exception\NodeException $e) { - return; - } - - $this->setUniqueFormElementIdentifier($node, $identifier); - }); - } - - /** - * @param NodeInterface $node - * @param string $identifier - * @throws \Neos\Eel\Exception - */ - private function setUniqueFormElementIdentifier(NodeInterface $node, string $identifier): void - { - /** @noinspection PhpUndefinedMethodInspection */ - $flowQuery = (new FlowQuery([$node]))->context([ - 'invisibleContentShown' => true, - 'removedContentShown' => true, - 'inaccessibleContentShown' => true - ]); - $possibleIdentifier = $identifier; - $i = 1; - /** @noinspection PhpUndefinedMethodInspection */ - while ($flowQuery - ->closest('[instanceof Neos.Form.Builder:NodeBasedForm]') - // [identifier=".."] matches the Form Element identifier, [_identiier!="..."] excludes the current node - ->find(sprintf('[instanceof %s][identifier="%s"][_identifier!="%s"]', - self::NODE_TYPE_IDENTIFIER_MIXIN ,$possibleIdentifier, $node->getIdentifier())) - ->count() > 0) { - $possibleIdentifier = $identifier . '-' . $i++; - } - $node->setProperty('identifier', $possibleIdentifier); + # BREAKING in Neos 9: No node signals anymore + # Missing here: Setting of identifier for Neos.Form.Builder:NodeBasedForm on nodePropertyChanged and nodeAdded } } diff --git a/Configuration/NodeTypes.FormElement.yaml b/Configuration/NodeTypes.FormElement.yaml index 731919e..c020029 100644 --- a/Configuration/NodeTypes.FormElement.yaml +++ b/Configuration/NodeTypes.FormElement.yaml @@ -9,7 +9,7 @@ constraints: nodeTypes: '*': false - label: "${q(node).property('identifier') || q(node).property('label') || ((node.nodeType.label || node.nodeType.name) + ' (' + node.name + ')')}" + label: "${node.properties.identifier || node.properties.label || ((Neos.Node.label(node) || node.nodeTypeName) + ' (' + node.name + ')')}" ui: inlineEditable: true label: 'Form Element' diff --git a/Configuration/NodeTypes.FormPage.yaml b/Configuration/NodeTypes.FormPage.yaml index 7d1753d..8f98476 100644 --- a/Configuration/NodeTypes.FormPage.yaml +++ b/Configuration/NodeTypes.FormPage.yaml @@ -1,5 +1,5 @@ 'Neos.Form.Builder:FormPage': - label: "${String.cropAtWord(String.trim(String.stripTags(String.pregReplace(q(node).property('title') || q(node).property('label') || ((I18n.translate(node.nodeType.label) || node.nodeType.name) + (node.autoCreated ? ' (' + node.name + ')' : '')), '/|\\x{00a0}|[^[:print:]]|\\s+/u', ' '))), 100, '...')}" + label: "${String.cropAtWord(String.trim(String.stripTags(String.pregReplace(q(node).property('title') || q(node).property('label') || ((I18n.translate(node.nodeType.label) || node.nodeTypeName.value) + (node.autoCreated ? ' (' + node.name + ')' : '')), '/|\\x{00a0}|[^[:print:]]|\\s+/u', ' '))), 100, '...')}" superTypes: 'Neos.Neos:Content': true constraints: diff --git a/Configuration/NodeTypes.SelectOption.yaml b/Configuration/NodeTypes.SelectOption.yaml index 19f7c6f..ff28575 100644 --- a/Configuration/NodeTypes.SelectOption.yaml +++ b/Configuration/NodeTypes.SelectOption.yaml @@ -33,7 +33,7 @@ options: nodeCreationHandlers: documentTitle: - nodeCreationHandler: 'Neos\Form\Builder\NodeType\SelectOptionsCreationHandler' + factoryClassName: 'Neos\Form\Builder\NodeType\SelectOptionsCreationHandler' fusion: prototypeGenerator: null properties: diff --git a/README.md b/README.md index 4d335b9..4682284 100644 --- a/README.md +++ b/README.md @@ -375,7 +375,7 @@ selectable: // ... properties { options = Neos.Form.Builder:SelectOptionCollection { - collection = ${q(site).children('[instanceof Some.Package:NewsletterCategory]')} + items = ${q(site).children('[instanceof Some.Package:NewsletterCategory]')} # we use the node identifier as value, we could use "name" or "label" instead for example valuePropertyPath = 'identifier' } diff --git a/Resources/Private/Fusion/Form.fusion b/Resources/Private/Fusion/Form.fusion index 2391eda..4471252 100644 --- a/Resources/Private/Fusion/Form.fusion +++ b/Resources/Private/Fusion/Form.fusion @@ -8,7 +8,7 @@ prototype(Neos.Form.Builder:Form) { renderingOptions = Neos.Fusion:DataStructure renderCallbacks = Neos.Fusion:DataStructure firstPage = Neos.Form.Builder:FormPage.Definition { - elements = Neos.Form.Builder:ElementCollection + elements = Neos.Form.Builder:ElementCollection } furtherPages = Neos.Form.Builder:PageCollection finishers = Neos.Form.Builder:FinisherCollection diff --git a/Resources/Private/Fusion/NodeBased/NodeBasedFinisher.fusion b/Resources/Private/Fusion/NodeBased/NodeBasedFinisher.fusion index c308664..dee427a 100644 --- a/Resources/Private/Fusion/NodeBased/NodeBasedFinisher.fusion +++ b/Resources/Private/Fusion/NodeBased/NodeBasedFinisher.fusion @@ -5,13 +5,13 @@ prototype(Neos.Form.Builder:NodeBasedFinisher) < prototype(Neos.Fusion:Renderer) } } -prototype(Neos.Form.Builder:NodeBasedFinisherCollection) < prototype(Neos.Fusion:Collection) { +prototype(Neos.Form.Builder:NodeBasedFinisherCollection) < prototype(Neos.Fusion:Loop) { itemName = 'finisherNode' itemRenderer = Neos.Fusion:Case { formElementTypeFromNodeType { - condition = ${!finisherNode.nodeType.options.form.formElementType} + condition = ${!Neos.Node.nodeType(finisherNode).options.form.formElementType} renderer = Neos.Form.Builder:NodeBasedFinisher { - type = ${finisherNode.nodeType.name + '.Definition'} + type = ${finisherNode.nodeTypeName.value + '.Definition'} } } @@ -19,7 +19,7 @@ prototype(Neos.Form.Builder:NodeBasedFinisherCollection) < prototype(Neos.Fusion condition = ${true} renderer = Neos.Form.Builder:NodeBasedFinisher { type = 'Neos.Form.Builder:Finisher.Definition' - element.formElementType = ${finisherNode.nodeType.options.form.formElementType} + element.formElementType = ${Neos.Node.nodeType(finisherNode).options.form.formElementType} } } } diff --git a/Resources/Private/Fusion/NodeBased/NodeBasedForm.fusion b/Resources/Private/Fusion/NodeBased/NodeBasedForm.fusion index 6209074..5bd60fb 100644 --- a/Resources/Private/Fusion/NodeBased/NodeBasedForm.fusion +++ b/Resources/Private/Fusion/NodeBased/NodeBasedForm.fusion @@ -1,12 +1,12 @@ prototype(Neos.Form.Builder:NodeBasedForm) < prototype(Neos.Form.Builder:Form) { @context.formNode = ${q(node).closest('[instanceof Neos.Form.Builder:NodeBasedForm]').get(0)} @context.formFusionPath = ${this.path} - identifier = ${formNode.properties.identifier ? formNode.properties.identifier : 'form-' + formNode.identifier} + identifier = ${formNode.properties.identifier || 'form-' + pageNode.aggregateId.value} presetName = ${formNode.properties.preset ? formNode.properties.preset : 'default'} - formElementType = ${formNode.context.inBackend ? 'Neos.Form:FormEditMode' : 'Neos.Form:Form'} + formElementType = ${renderingMode.isEdit ? 'Neos.Form:FormEditMode' : 'Neos.Form:Form'} renderCallbacks.formElementWrapping = Neos.Form.Builder:FormElementWrapping { - @if.isInBackend = ${formNode.context.inBackend} + @if.isInBackend = ${renderingMode.isEdit} } firstPage { @@ -14,18 +14,18 @@ prototype(Neos.Form.Builder:NodeBasedForm) < prototype(Neos.Form.Builder:Form) { renderingOptions._node = ${formNode} renderingOptions._fusionPath = ${formFusionPath} elements = Neos.Form.Builder:NodeBasedElementCollection { - collection = ${q(formNode).children('elements').children()} + items = ${q(formNode).children('elements').children()} } } furtherPages = Neos.Form.Builder:NodeBasedPageCollection { - collection = ${q(formNode).children('furtherPages').children()} + items = ${q(formNode).children('furtherPages').children()} } finishers = Neos.Form.Builder:NodeBasedFinisherCollection { - collection = ${q(formNode).children('finishers').children()} + items = ${q(formNode).children('finishers').children()} } @process.contentElementWrapping = Neos.Neos:ContentElementWrapping { additionalAttributes { - 'data-_neos-form-builder-type' = ${formNode.nodeType.name} + 'data-_neos-form-builder-type' = ${formNode.nodeTypeName.value} } } diff --git a/Resources/Private/Fusion/NodeBased/NodeBasedFormElement.fusion b/Resources/Private/Fusion/NodeBased/NodeBasedFormElement.fusion index b2dddcf..b840d2d 100644 --- a/Resources/Private/Fusion/NodeBased/NodeBasedFormElement.fusion +++ b/Resources/Private/Fusion/NodeBased/NodeBasedFormElement.fusion @@ -1,45 +1,45 @@ prototype(Neos.Form.Builder:NodeBasedFormElement) < prototype(Neos.Fusion:Renderer) { element { @context.element = ${this} - identifier = ${elementNode.properties.identifier ? elementNode.properties.identifier : elementNode.identifier} + identifier = ${elementNode.properties.identifier || pageNode.aggregateId.value} label = ${elementNode.properties.label} required = ${elementNode.properties.required} defaultValue = ${elementNode.properties.defaultValue} properties.@process.addNodeProperties = ${Neos.Form.Builder.Node.mergeProperties(value, elementNode)} validators = Neos.Form.Builder:NodeBasedValidatorCollection { - collection = ${q(elementNode).children('validators').children()} + items = ${q(elementNode).children('validators').children()} } renderingOptions._node = ${elementNode} renderingOptions._fusionPath = ${element.path} properties.options.@process.overrideFromNode = Neos.Form.Builder:SelectOptionCollection { - collection = ${q(elementNode).children('options').children()} + items = ${q(elementNode).children('options').children()} valuePropertyPath = 'properties.value' labelPropertyPath = 'properties.label' @if.isSelectFormElement = ${q(elementNode).is('[instanceof Neos.Form.Builder:SelectionMixin]')} } elements.@process.overrideFromNode = Neos.Form.Builder:NodeBasedElementCollection { - collection = ${q(elementNode).children('elements').children()} + items = ${q(elementNode).children('elements').children()} @if.isSectionFormElement = ${q(elementNode).is('[instanceof Neos.Form.Builder:SectionMixin]')} } } } -prototype(Neos.Form.Builder:NodeBasedElementCollection) < prototype(Neos.Fusion:Collection) { +prototype(Neos.Form.Builder:NodeBasedElementCollection) < prototype(Neos.Fusion:Loop) { itemName = 'elementNode' itemRenderer = Neos.Fusion:Case { formElementTypeFromNodeType { - condition = ${!elementNode.nodeType.options.form.formElementType} + condition = ${!Neos.Node.nodeType(elementNode).options.form.formElementType} renderer = Neos.Form.Builder:NodeBasedFormElement { - type = ${elementNode.nodeType.name + '.Definition'} + type = ${elementNode.nodeTypeName.value + '.Definition'} } } default { condition = ${true} renderer = Neos.Form.Builder:NodeBasedFormElement { type = 'Neos.Form.Builder:FormElement.Definition' - element.formElementType = ${elementNode.nodeType.options.form.formElementType} + element.formElementType = ${Neos.Node.nodeType(elementNode).options.form.formElementType} } } } diff --git a/Resources/Private/Fusion/NodeBased/NodeBasedFormPage.fusion b/Resources/Private/Fusion/NodeBased/NodeBasedFormPage.fusion index cd9fa02..ded17d3 100644 --- a/Resources/Private/Fusion/NodeBased/NodeBasedFormPage.fusion +++ b/Resources/Private/Fusion/NodeBased/NodeBasedFormPage.fusion @@ -1,24 +1,24 @@ prototype(Neos.Form.Builder:NodeBasedFormPage) < prototype(Neos.Fusion:Renderer) { element { @context.page = ${this} - identifier = ${pageNode.properties.identifier ? pageNode.properties.identifier : pageNode.identifier} + identifier = ${pageNode.properties.identifier || pageNode.aggregateId.value} label = ${pageNode.properties.label} renderingOptions._node = ${pageNode} renderingOptions._fusionPath = ${page.path} elements = Neos.Form.Builder:NodeBasedElementCollection { - collection = ${q(pageNode).children('elements').children()} + items = ${q(pageNode).children('elements').children()} } } } -prototype(Neos.Form.Builder:NodeBasedPageCollection) < prototype(Neos.Fusion:Collection) { +prototype(Neos.Form.Builder:NodeBasedPageCollection) < prototype(Neos.Fusion:Loop) { itemName = 'pageNode' itemRenderer = Neos.Fusion:Case { formElementTypeFromNodeType { - condition = ${!pageNode.nodeType.options.form.formElementType} + condition = ${!Neos.Node.nodeType(pageNode).options.form.formElementType} renderer = Neos.Form.Builder:NodeBasedFormPage { - type = ${pageNode.nodeType.name + '.Definition'} + type = ${pageNode.nodeTypeName.value + '.Definition'} } } @@ -26,8 +26,8 @@ prototype(Neos.Form.Builder:NodeBasedPageCollection) < prototype(Neos.Fusion:Col condition = ${true} renderer = Neos.Form.Builder:NodeBasedFormPage { type = 'Neos.Form.Builder:FormPage.Definition' - element.formElementType = ${pageNode.nodeType.options.form.formElementType} + element.formElementType = ${Neos.Node.nodeType(pageNode).options.form.formElementType} } } } -} \ No newline at end of file +} diff --git a/Resources/Private/Fusion/NodeBased/NodeBasedValidator.fusion b/Resources/Private/Fusion/NodeBased/NodeBasedValidator.fusion index a316c93..d9c46d3 100644 --- a/Resources/Private/Fusion/NodeBased/NodeBasedValidator.fusion +++ b/Resources/Private/Fusion/NodeBased/NodeBasedValidator.fusion @@ -5,13 +5,13 @@ prototype(Neos.Form.Builder:NodeBasedValidator) < prototype(Neos.Fusion:Renderer } } -prototype(Neos.Form.Builder:NodeBasedValidatorCollection) < prototype(Neos.Fusion:Collection) { +prototype(Neos.Form.Builder:NodeBasedValidatorCollection) < prototype(Neos.Fusion:Loop) { itemName = 'validatorNode' itemRenderer = Neos.Fusion:Case { formElementTypeFromNodeType { - condition = ${!validatorNode.nodeType.options.form.formElementType} + condition = ${!Neos.Node.nodeType(validatorNode).options.form.formElementType} renderer = Neos.Form.Builder:NodeBasedValidator { - type = ${validatorNode.nodeType.name + '.Definition'} + type = ${validatorNode.nodeTypeName.value + '.Definition'} } } @@ -19,7 +19,7 @@ prototype(Neos.Form.Builder:NodeBasedValidatorCollection) < prototype(Neos.Fusio condition = ${true} renderer = Neos.Form.Builder:NodeBasedValidator { type = 'Neos.Form.Builder:Validator.Definition' - element.formElementType = ${validatorNode.nodeType.options.form.formElementType} + element.formElementType = ${Neos.Node.nodeType(validatorNode).options.form.formElementType} } } } diff --git a/composer.json b/composer.json index 582c0a4..e6c4ac1 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "Flow Form Framework integration into Neos CMS", "license": "GPL-3.0+", "require": { - "neos/neos": "^5.0 || ^7.0 || ^8.0", + "neos/neos": "^9.0", "neos/form": "^5.0" }, "autoload": {