neos / form-builder

Flow Form Framework integration into Neos CMS
GNU General Public License v3.0
18 stars 26 forks source link

Problems with own properties on Neos.Neos:Content #31

Open patriceckhart opened 5 years ago

patriceckhart commented 5 years ago

Since updating to Neos 4 I get the following error, when I insert an email validator: Unsupported validation option (s) found: animation, delay, mt, mb, ml, mr.

I use these properties for Neos.Neos:Content. I'm not sure why the validators implement Neos.Neos:Content.

bwaidelich commented 5 years ago

I checked again and Validators have Neos.Neos:Content as superType so that they appear in the Neos Backend. The issue occurs in the NodeBasedValidator implementation that translates all node properties to options of the validator.. We should change that so that the options have to be defined in the corresponding *.Definition of the validator

patriceckhart commented 5 years ago

I have changed to line

options.@process.addNodeProperties = ${Array.concat(value, validatorNode.properties)}

in Private/Resources/Fusion/NodeBased/NodeBasedValidator.fusion to options >

and it works. The validators also.

erkenes commented 4 years ago

I have changed to line

options.@process.addNodeProperties = ${Array.concat(value, validatorNode.properties)}

in Private/Resources/Fusion/NodeBased/NodeBasedValidator.fusion to options >

and it works. The validators also.

You can fix it like this too:

'Neos.Form.Builder:AbstractValidator':
  properties:
    # Remove `marginTop` and` marginBottom` as they cause an error and don't work here anyway
    marginTop: FALSE
    marginBottom: FALSE
    ## your other options
lorenzulrich commented 2 years ago

Just for the record, I suggest additional properties to node types such as Neos.Neos:Node with a mixin instead of just adding properties. This makes it easier to deactivate those here:

'My.Site:Mixin.FooMixin':
  abstract: true
  properties:
    foo:
      type: string

'Neos.Neos:Node':
  superTypes:
    'My.Site:Mixin.FooMixin': true
'Neos.Form.Builder:AbstractValidator':
  superTypes:
    'My.Site:Mixin.FooMixin': false