Skip to content

Conditional logic doesn’t work well with radio fields containing special characters #18

@jeanfredrik

Description

@jeanfredrik

If you create a radio field with label or values containing characters other than A–Z and 0–9 there’s a risk they will get mixed up because å, ä, ö and such characters are removed in the conditional logic, namely in this part of the admin JS code:

Conditional.prototype.conditionalString = function(string) {
string = string.toLowerCase();
string = string.replace(/\s+/g, '_');
string = string.replace(/[^a-z0-9_]+/ig, '');
string = string.replace(/_+$/, '');
return string;
};

This means that the editor needs to be careful not to create fields with labels or values that can get mixed up. It would be better if something matching Wordpress’ sanitize_title was used for the labels or that both labels and values are used as-is (or escaped) so that no information is lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions