Hi -

I've created a content type with a text field called "hours estimate". The drop down is supposed to have the following in it's list:
<10
11-20
>20

I have tried typing these with both < and < and > and >.
Either way, when you're editing something of this content type, you see "<" and ">" in the dropdown.

It's ending up as < in the database, no matter which it's entered as in the "allowed values list".

On the edit page itself, its html is &lt;
I'm guessing this happens because the html is being escaped twice via the htmlspecialchars function or something like it.

I think this is a bug, and I believe that it's cck related rather than core, but please let me know if there's a setting to change it already or if I should enter this into core's issue list.

Thanks!
-Rita

PS - thanks for your module, and all the work you do!

Comments

ksun’s picture

Indeed it does appear to be double-escaped somewhere. In the meantime, I found this work-around: By entering the following into the PHP Code block for allowed values, I got it to display properly on the edit page.

return array(
'<10' => '<10',
'11-20' => '11-20',
'>20' => '>20'
);
elfgirl’s picture

And wow, do I ever need to proof-read my posts.

Please mentally replace:
"I have tried typing these with both < and < and > and >.
Either way, when you're editing something of this content type, you see "<" and ">" in the dropdown.
It's ending up as < in the database, no matter which it's entered as in the "allowed values list".
On the edit page itself, its html is <"

with:
"I have tried typing these with both &lt; and < and &gt; and >.
Either way, when you're editing something of this content type, you see "&lt;" and "&gt;" in the dropdown.
It's ending up as &lt; in the database, no matter which it's entered as in the "allowed values list".
On the edit page itself, its html is &amp;lt;"

That's displayed as it should be.
-R

elfgirl’s picture

And thanks!
-R