The nodereference field formatter runs check_plain() on node titles. Drupal core also runs check_plain() on node titles. This means that using a nodereference field as a title can cause HTML entities to be displayed in the title.

Comments

darren oh’s picture

Status: Active » Needs review
StatusFileSize
new778 bytes
fago’s picture

Status: Needs review » Closed (duplicate)

this would kill most already working solutions, so it's a no go. You have to use raw tokens.

http://drupal.org/node/242643

darren oh’s picture

That issue does not say anything about raw tokens. What in the world is a raw token?

fago’s picture

a token, which isn't "check_plained" - it contains raw user input. If you use a check_plained token, you get the problems you got.. ;)

break9’s picture

but what if the token is a cck field referencing an existing taxonomy term. Then "raw" input isn't an option. What do we do then?

giorgosk’s picture

I am not sure if it helps but you can use something similar to the following php code

 return html_entity_decode('[field_texttext-formatted]');

in order to make the HTML entities display properly (i.e. & instead of & amp ;)

psynaptic’s picture

#6 does seem to work for me.

I am using content_taxonomy module and it doesn't provide a raw equivalent.

darren oh’s picture

Status: Closed (duplicate) » Active
darren oh’s picture

Status: Active » Needs work
StatusFileSize
new796 bytes

Updated patch. It works for me, so I hope someone will do the work necessary to get it accepted.

fago’s picture

Title: HTML entities in titles from nodereference fields » HTML entities in titles
Status: Needs work » Closed (won't fix)

Hm I'm not sure about that. This would change existing configurations to not work as before - it would decode entities that might be wanted (-> double encoded). So this can't get in.