Improper display of ampersand (&) in select list
capellic - August 28, 2008 - 14:59
| Project: | Content Taxonomy |
| Version: | 6.x-1.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Description
Improper display of ampersand (&) in select list. When adding a taxonomy as a CCK field and displaying it as a "Select List", it displays as &. See screenshot attached
It displays as expected in when choosing "Checkboxes/Radios".
| Attachment | Size |
|---|---|
| Select List with ampersands | 22 KB |

#1
Hi!
Thanks for your report.
There was one check_plain too much for select lists, I fixed that and committed it to the D6 dev version.
#2
Automatically closed -- issue fixed for two weeks with no activity.
#3
I have this issue in 6.x-1.0-rc1. The ampersand in select lists is rendered as &.
#4
This is important any ideas please?
#5
this may also depend on your CCK version. what version of cck are you using and is there a difference between content taxonomy beta6 and rc1?
#6
I just tried upgrading to the latest CCK module (6.x-2.4) and the problem remains. I have Content Taxonomy 6.x-1.0-rc1. Please advise, thanks.
#7
Now tried the 6.x dev but no difference.
#8
Out of desperation I tried editing it myself and by some miracle actually fixed it. I've attached a patch although I wrote it by hand and not sure if it follows the proper convention for patches. Either way it should be clear which line was changed.
#9
removing check_plain is a bad idea and dangerous. additionally your patch wouldn't change anything for select list. maybe you have been adding another check_plain instead?
#10
If the check_plain is left in then the ampersands are displayed incorrectly. I'm not sure why nobody else is having this problem.
If anyone has an alternative solution then I'd be happy to try it, but this hack allowed an otherwise ready site to go live (even if removal of the check_plain impairs security).
#11
I'm still wondering, why this patch changes something with select lists. The original code says:
$options[$term->tid] = ($field['widget']['type'] == 'content_taxonomy_select') ? $value : check_plain($value);it does a check_plain for every widget (like radios/checkboxes), except for a select list.
if you remove the second check_plain it only can have effects on widget not of the type 'content_taxonomy_select'.
so, I have to ask again, which widget are you exactly using? you can see that in your field settings or in your database (table content_node_field_instance)