Autocomplete Results from Entity Reference View contains HTML tags and the selection shows only the entity label.

Created on 2 June 2020, over 4 years ago
Updated 5 May 2023, over 1 year ago

Reproduce

HTML Tags

  1. Create a reference view
  2. Create an entity refence field and select the reference view as reference type.
  3. On form settings select Autocomplete checkbox
  4. The autocomplete result will contain HTML tags

Selection contains only label

  1. Create a reference view
  2. Create an entity refence field and select the reference view as reference type.
  3. On form settings select Autocomplete checkbox
  4. On edit form of a content, the selection will display only the label and it will not respect the entity reference view

Suggested Solution

At EntityAutocompleteController, strip all the tags before return the result.
At Select2Trait, load view configuration, find inline fields and get the field values from the entity. This is not a good solution because dont retrieve the data from view result.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Views integration

Created by

πŸ‡¬πŸ‡·Greece Orestis Nerantzis Thessaloniki

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States w01f

    Tried @kecsot's suggestion, works perfectly! Perhaps just some help text on the option for autocomplete would be sufficient.

Production build 0.71.5 2024