From b21498165c847aff1cfb86bdf9f6e624dfc2273f Mon Sep 17 00:00:00 2001
From: Richard Bushell <rb@living.video>
Date: Sat, 9 May 2020 18:40:54 +0100
Subject: [PATCH] Fix user's profile image for Comments

Fix user's profile image for Comments to use public.php url format
---
 .../ModComments/modules/ModComments/models/Record.php  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php b/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php
index aee0a319d..6d8807df4 100644
--- a/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php
+++ b/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php
@@ -118,14 +118,14 @@ class ModComments_Record_Model extends Vtiger_Record_Model {
 			if (!empty($customer)) {
 				$recordModel = Vtiger_Record_Model::getInstanceById($customer);
 				$imageDetails = $recordModel->getImageDetails();
-				if(!empty($imageDetails)) {
-					return $imageDetails[0]['path'].'_'.$imageDetails[0]['name'];
+				if (!empty($imageDetails[0]['url'])) {
+					return $imageDetails[0]['url'];
 				} else
 					return vimage_path('CustomerPortal.png');
 			} else {
-				$imagePath = $commentor->getImageDetails();
-				if (!empty($imagePath[0]['name'])) {
-					return $imagePath[0]['path'] . '_' . $imagePath[0]['name'];
+				$imageDetails = $commentor->getImageDetails();
+				if (!empty($imageDetails[0]['url'])) {
+					return $imageDetails[0]['url'];
 				}
 			}
 		} elseif ($isMailConverterType) {
-- 
GitLab