This is illegal as function is a reserved keyword.
May be the condition can be checked for reserved keywords and prevent saving in such a case. Also additionally may be rather than creating a variable for every form field only the variables used in the condition could be added to the Function (thus making such collisions less likely - at least in our case the function field was not actually used in any condition).
If you have a field named
function
in your Contao form ("function" of a person within an organisation), the following error will occur:This is because
function
is a reserved keyword, butconditionalformfields.js
produces JavaScript code like this for this field:https://github.com/terminal42/contao-conditionalformfields/blob/06dd538eb6c376e2ec88da75a7560145d51315bd/public/conditionalformfields.js#L36
This is illegal as
function
is a reserved keyword.May be the condition can be checked for reserved keywords and prevent saving in such a case. Also additionally may be rather than creating a variable for every form field only the variables used in the condition could be added to the
Function
(thus making such collisions less likely - at least in our case thefunction
field was not actually used in any condition).