Difference between selectedvalue and items in InputDropdown

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Ertenal
Forum Members
Forum Members
Posts: 19
Joined: Fri Sep 30, 2011 2:28 pm

Difference between selectedvalue and items in InputDropdown

Post by Ertenal »

I have a product list page with filters for a couple of fields. One of the filters has values like '> 1', '< 1'. This will not work when you use the InputDropdown method. The select box shows up, but the option, when selected, will not have the selected="selected" attribute.

I was curious why so i tried to investigate it. The function InputDropdown goes to cms_module_CreateInputDropdown(). The html for the select box is build here. The selectedvalue field is filtered with the function cms_htmlentities(). So '>' turns into '>'. I can see why this is done. The problem however, this is not done for the value itself. So '>' stays '>'. So the equation $selectedvalue == $value will be '>' == '>' and this will never be true.

And to keep it more strange. There is a line before that says:

Code: Select all

//$value = cms_htmlentities($value);
Yes with comments. Why is this line not uncommented? Because when i do, it works..
Post Reply

Return to “Developers Discussion”