From 32166bddddebf4533701a2ddfdc762c96fc2944b Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Thu, 29 Jun 2023 09:02:37 -0300 Subject: [PATCH] use link field title instead of node title for bestbet results --- .../src/Controller/RoblibSearchSolrsiteController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php b/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php index 8cee127..1199eeb 100644 --- a/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php +++ b/modules/solr_site/src/Controller/RoblibSearchSolrsiteController.php @@ -103,6 +103,10 @@ class RoblibSearchSolrsiteController extends ControllerBase { $output['results'][$id]['type'] = reset($type); $urls = $result->getField('url')->getValues(); $output['results'][$id]['url'] = reset($urls); + if ($solr_type == 'BestBet') { + $entity = $result->getOriginalObject()->getValue(); + $output['results'][$id]['title'] = $entity->field_link->first()->title; + } $links = $result->getField('field_link')->getValues(); $output['results'][$id]['field_link'] = empty($links) ? '' : $links; }