Hi I am using D6 +i18n, both at latest version.
I am reporting this problem in the page where you are allowed to select a node to be the translation of another node. The path is

/node/[nid]/translate

Specifically in the autocomplete widget. If i have a node with an apostrophe in the title, by example

John's node

I start to type the first letters so that the autocomplete dropdown appears, then when I click on the node I need, the apostrophe is changed into an html entity, so it becomes:

John's node

Then if I try to submit with the update translation button, I get the error "Node title mismatch. Please check your selection".

I do not know if it is related to i18n or geneically to the autocomplete widget of drupal.

GP

CommentFileSizeAuthor
#1 i18n_autocomplete_encoding_bug-D6.patch1.03 KBhass

Comments

hass’s picture

Component: User interface » Code
Status: Active » Needs review
StatusFileSize
new1.03 KB

This is a bug of _i18n_node_references() that encodes the string for HTML and drupal_json() does it again with drupal_to_js().

I removed the check_plain() on node->title and changed the array key to 'title_raw' to make sure nobody reuses the variable somewhere else without check_plain'ing or drupal_to_js'ify it.

@Jose: What do you think?

hass’s picture

Title: Node "select translations" page: apostrophes in nodes' titles are translated into ' » Select translations autocomplete shows htmlspecialchars as entities
jose reyero’s picture

Status: Needs review » Fixed

Looks good, and anyway it's what nodereference module does, so we'll trust that. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.