Skip to content

Commit

Permalink
Fix salesagility#10532 Search Results show module names correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
abuzarfaris committed Sep 26, 2024
1 parent 1a114a9 commit 64fa7c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion lib/Search/UI/SearchResultsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,17 @@ public function display(): void
$smarty->assign('results', $this->results);
$smarty->assign('APP', $app_strings);
try {
$smarty->assign('resultsAsBean', $this->results->getHitsAsBeans());
$resultsAsBean = $this->results->getHitsAsBeans();
global $app_list_strings;
$moduleLabels = $app_list_strings['moduleList'];
//Redundency for any beans that don't have labels
foreach ($resultsAsBean as $module => $beans) {
if(!isset($moduleLabels[$module])) {
$moduleLabels[$module] = $module;
}
}
$smarty->assign('moduleLabels', $moduleLabels);
$smarty->assign('resultsAsBean', $resultsAsBean);
} catch (\SuiteCRM\Exception\Exception $e) {
LoggerManager::getLogger()->fatal("Failed to retrieve ElasticSearch options");
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Search/UI/templates/search.results.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
{/if}
{foreach from=$resultsAsBean item=beans key=module}
<h3>{$module}</h3>
<h3>{$moduleLabels[$module]}</h3>
<table class="list view">
<thead>
<tr>
Expand Down

0 comments on commit 64fa7c1

Please sign in to comment.