Special characters in node titles are not rendered correctly when displayed in select box. For example having a node with title MY TITLE IS "ABC" will be displayed in select box as MY TITLE IS &quotABC&quot

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jygastaud’s picture

Project: Entity connect » Entity reference
Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
1.04 KB

That is not an issue caused by Entityconnect.
It happend in Entity Reference module in class "EntityReference_SelectionHandler_Generic" due to check_plain in label line 173.
$options[$bundle][$entity_id] = check_plain($this->getLabel($entity));

Remove check_plain() should be safe because form_select_options() already does a check_plain.

Attached patch apply the above suggestion.

Status: Needs review » Needs work

The last submitted patch, 1: special_chars_display_select_fields-2400689-1.patch, failed testing.

mbaev’s picture

Please, just apply the patch and submit new version. It's simply...

Test failed because need to delete same functions from tests: entityreference.handlers.test

// Row 100
$node_labels[$key] = check_plain($node->title);

// Row 247
$user_labels[$key] = check_plain($user->name);

// Row 405
$comment_labels[$key] = check_plain($comment->subject);

// Row 579
$node_labels[$key] = check_plain($node->title);
esolitos’s picture

I re applied the patch to HEAD and fixed the tests as suggested by mbaev in #3

esolitos’s picture

Status: Needs work » Needs review

Forgot to trigger the test bot.

mbaev’s picture

Thank you, @esolitos!