I have a case where I'm attempting to use the following in a list field's Allowed Values List:
1|X > 3
2|X < 3
3|X >= 3
4|X <= 3
It turns out that the characters <= are stripped along with the following characters in the label. The label shows properly when output to the final view HTML but is stripped when shown in the edit mode list combo box. Surprisingly the open tag character < is not affected.
Some debugging showed that the labels are being run through strip_tags() in \modules\field\modules\options\options.module _options_prepare_options(). This is resulting in X <= 3 being stripped to X .
I'm wondering if there is a more robust way to handle labels. Specifically it would be nice if we could use HTML character entities in the labels:
1|X > 3
2|X < 3
3|X >=; 3
4|X <= 3
When this is done currently, the codes are not decoded when shown in the edit mode list combo box.
Are there any other workarounds to displaying the characters <= in a label?
Comments
Comment #1
shyamala commentedReplicated issue:
- added field Select list with list text as below:
- As mentioned above on the edit form the <= gets stripped in the list box. On the view page the selection is displayed correctly as X <= 3
If the list text is
- As mentioned above the text is displayed as in the list box, but correctly in the view page.
In the function _options_properties in \modules\field\modules\options\options.module
The Property for case type 'select' is set as:
but property for case 'buttons' is set as:
'filter_xss' => TRUEThis means that the above options work as radio buttons but are not working in select list. There is some inconsistency in the way these are handled.
Comment #2
liquidcms commentednot sure why they think < and > do work as i do not get these rendered correctly as well.
Comment #3
johnvIn version 7.39, this doesn't happen anymore.