From 5902e773ba1aec568bb57db64f9647dff83176d9 Mon Sep 17 00:00:00 2001
From: akshath <akshath.t@vtiger.com>
Date: Fri, 30 Oct 2020 19:32:31 +0530
Subject: [PATCH] Fix for #1523 - Optimization of record label computation
 (Generalizing data population for entity names)

---
 data/CRMEntity.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/data/CRMEntity.php b/data/CRMEntity.php
index 0673e70ae..2ff6a3c47 100644
--- a/data/CRMEntity.php
+++ b/data/CRMEntity.php
@@ -288,9 +288,10 @@ class CRMEntity {
                 break;
 		}
 		
-        $record_label = (count($entityFieldNames) > 1) ? 
-                        $this->column_fields[$entityFieldNames[0]].' '.$this->column_fields[$entityFieldNames[1]] : 
-                        $this->column_fields[$entityFieldNames[0]];
+		$record_label = '';
+		foreach($entityFieldNames as $entityFieldName) {
+			$record_label .= $this->column_fields[$entityFieldName]." ";
+		}
         $label = decode_html($record_label);
         $this->column_fields['label'] = $label;
 
-- 
GitLab