From bf6a366d60427150194f1a6cc77a31a86dab6f57 Mon Sep 17 00:00:00 2001 From: Joseph Flatt Date: Wed, 6 Oct 2021 16:57:40 -0700 Subject: [PATCH] Issue #23: Changed the autocomplete callback to use the text from the views results when using a view to get the list of autocomplete options. --- reference.module | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/reference.module b/reference.module index 2df14a3..e44f602 100644 --- a/reference.module +++ b/reference.module @@ -570,12 +570,8 @@ function reference_autocomplete($field_instance = NULL, $typed = '') { // Get the results. $results = $view->execute_display($display_name); - $entities = entity_load($target_entity_type, array_keys($results)); - - $matches = array(); - foreach ($entities as $id => $entity) { - $label = entity_label($target_entity_type, $entity); - $matches[$label . ' (' . $id . ')'] = $label; + foreach ($results as $id => $label) { + $matches[trim(strip_tags($label)) . ' (' . $id . ')'] = $label; } break;