My entity reference field uses an Entity selection mode of "Views: Filter by an entity reference view." The view can output HTML (ex Vodka & Tonic) and the standard Entity Reference autocomplete widget renders it correctly with the bold formatting and ampersand..

The Synonyms module autocomplete results show the actual HTML code instead of the rendered result.

Comments

derekw created an issue. See original summary.

bucefal91’s picture

Status: Active » Needs review
StatusFileSize
new3.65 KB

Hello!

I attach a patch that solves the issue. Actually not only with HTML but overall the synonyms integration with ""Views: Filter by an entity reference view." was pretty poor.

There is only 1 conceptual limitation: the synonyms autocomplete suggestions will always use entity label and not what the view renders. We must obey this principle because when the form is submitted, the synonyms module looks up all entities by their labels and thus knows which entity the user actually meant. If we start putting in there anything else but the entity labels we will confuse this mechanism of recognition and will break things.

However, that's the only thing limitation I currently see in this patch. Anyway, I think most of the people do not need anything fancier than entity name in the suggestion.

I have 100% tests pass on my local development environment.

  • bucefal91 committed 2130d94 on 7.x-1.x
    Issue #2851696 by bucefal91: Adding support for views-based entity...
bucefal91’s picture

Status: Needs review » Fixed

Committed into the development snapshot.

Status: Fixed » Closed (fixed)

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