- Issue created by @bwong
The "label" object variable in the row results is missing when using an entity reference view display.
It does not appear that the label is actually used and is not provided in this case in the file: config_views/src/Plugin/EntityReferenceSelection/ConfigViewsSelection.php
public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) {
$entities = [];
if ($results = $this->getDisplayExecutionResults($match, $match_operator, $limit)) {
foreach (Element::children($results) as $id) {
// $entities[$results[$id]['#row']->type][$results[$id]['#row']->id] = $results[$id]['#row']->label;
$entities[$results[$id]['#row']->type][$results[$id]['#row']->id] = $id;
}
}
return $entities;
}
I was not able to track down where the row results would be created with the label. Using $id instead seems to work just fine for entity references. The alternative would be to test if the label is missing and only use $id in that case.
Active
2.1
Code