-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: BUGFIX: Fix Neos 4.3 compatibility
Fixes: #41
- Loading branch information
1 parent
5730117
commit 91e26f3
Showing
5 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
namespace Neos\Form\Builder\Fusion\Helper; | ||
|
||
use Neos\ContentRepository\Domain\Model\NodeInterface; | ||
use Neos\Eel\ProtectedContextAwareInterface; | ||
|
||
class NodeHelper implements ProtectedContextAwareInterface | ||
{ | ||
|
||
public function mergeProperties(array $properties, NodeInterface $node) | ||
{ | ||
$nodeProperties = $node->getProperties(); | ||
if ($nodeProperties instanceof \Traversable) { | ||
$nodeProperties = iterator_to_array($nodeProperties); | ||
} | ||
return array_merge($properties, $nodeProperties); | ||
} | ||
|
||
/** | ||
* @param string $methodName | ||
* @return boolean | ||
*/ | ||
public function allowsCallOfMethod($methodName): bool | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
prototype(Neos.Form.Builder:NodeBasedFinisher) < prototype(Neos.Fusion:Renderer) { | ||
element { | ||
@context.finisher = ${this} | ||
[email protected] = ${Array.concat(value, finisherNode.properties)} | ||
[email protected] = ${Neos.Form.Builder.Node.mergeProperties(value, finisherNode)} | ||
} | ||
} | ||
|
||
|
@@ -23,4 +23,4 @@ prototype(Neos.Form.Builder:NodeBasedFinisherCollection) < prototype(Neos.Fusion | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ prototype(Neos.Form.Builder:NodeBasedFormElement) < prototype(Neos.Fusion:Render | |
label = ${elementNode.properties.label} | ||
required = ${elementNode.properties.required} | ||
defaultValue = ${elementNode.properties.defaultValue} | ||
[email protected] = ${Array.concat(value, elementNode.properties)} | ||
[email protected] = ${Neos.Form.Builder.Node.mergeProperties(value, elementNode)} | ||
validators = Neos.Form.Builder:NodeBasedValidatorCollection { | ||
collection = ${q(elementNode).children('validators').children()} | ||
} | ||
|
@@ -43,4 +43,4 @@ prototype(Neos.Form.Builder:NodeBasedElementCollection) < prototype(Neos.Fusion: | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
prototype(Neos.Form.Builder:NodeBasedValidator) < prototype(Neos.Fusion:Renderer) { | ||
element { | ||
@context.validator = ${this} | ||
[email protected] = ${Array.concat(value, validatorNode.properties)} | ||
[email protected] = ${Neos.Form.Builder.Node.mergeProperties(value, validatorNode)} | ||
} | ||
} | ||
|
||
|
@@ -23,4 +23,4 @@ prototype(Neos.Form.Builder:NodeBasedValidatorCollection) < prototype(Neos.Fusio | |
} | ||
} | ||
} | ||
} | ||
} |