form-builder icon indicating copy to clipboard operation
form-builder copied to clipboard

Problems with own properties on Neos.Neos:Content

Open patriceckhart opened this issue 6 years ago • 4 comments

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.

patriceckhart avatar Aug 16 '18 05:08 patriceckhart

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

bwaidelich avatar Aug 16 '18 13:08 bwaidelich

I have changed to line

[email protected] = ${Array.concat(value, validatorNode.properties)}

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

and it works. The validators also.

patriceckhart avatar Aug 29 '18 14:08 patriceckhart

I have changed to line

[email protected] = ${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

erkenes avatar Feb 18 '20 08:02 erkenes

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

lorenzulrich avatar Mar 01 '22 15:03 lorenzulrich