unclecheese / silverstripe-display-logic

The Display Logic module allows you to add conditions for displaying or hiding certain form fields based on client-side behavior.
BSD 3-Clause "New" or "Revised" License
73 stars 70 forks source link

Display logic fails if a field name has a period #122

Open GuySartorelli opened 3 years ago

GuySartorelli commented 3 years ago

If a form field name has a period in it, display logic fails with the following error: "Syntax error, unrecognized expression: [name=field.name]" (in the above, for demonstration purposes, "field.name" was the name of my field)

[name=${name}] should be [name="${name}"] to allow meta-characters in field names.

Note that it's understandable if it's considered not worth fixing the failure of the individual field, since it is technically an invalid selector... but this causes display-logic for the entire form to fail, not just for the one field with an invalid selector.