From cfff2cae5c80efe402391fa49e8ae19a61c4186a Mon Sep 17 00:00:00 2001
From: satish <satish.dvnk@vtiger.com>
Date: Tue, 30 May 2017 14:27:46 +0530
Subject: [PATCH] Fixes #552 - 1st Comment not show in summary

---
 modules/Vtiger/views/Detail.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/Vtiger/views/Detail.php b/modules/Vtiger/views/Detail.php
index e7a4ec94..e3d668df 100644
--- a/modules/Vtiger/views/Detail.php
+++ b/modules/Vtiger/views/Detail.php
@@ -478,9 +478,11 @@ class Vtiger_Detail_View extends Vtiger_Index_View {
 		}
 
 		$pagingModel->calculatePageRange($recentComments);
-		array_pop($recentComments);
-		$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
+		if ($pagingModel->get('limit') < count($recentComments)) {
+			array_pop($recentComments);
+		}
 
+		$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
 		$fileNameFieldModel = Vtiger_Field::getInstance("filename", $modCommentsModel);
 		$fileFieldModel = Vtiger_Field_Model::getInstanceFromFieldObject($fileNameFieldModel);
 
-- 
GitLab