From 74e84877e4d8d87bf68428bdb46e1298a58f8480 Mon Sep 17 00:00:00 2001
From: Uma <uma.s@vtiger.com>
Date: Fri, 15 May 2020 16:43:03 +0530
Subject: [PATCH] Fixes api cleanup for webservice get attachemnt ids

---
 vtlib/Vtiger/Functions.php | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php
index c1fb483dd..a1581bb62 100644
--- a/vtlib/Vtiger/Functions.php
+++ b/vtlib/Vtiger/Functions.php
@@ -1571,12 +1571,10 @@ class Vtiger_Functions {
             $query = "SELECT attachmentsid FROM vtiger_seattachmentsrel WHERE crmid = ?";
             $result = $adb->pquery($query, array($crmid));
             $noofrows = $adb->num_rows($result);
-            if ($noofrows > 1) {
+            if ($noofrows) {
                 for ($i = 0; $i < $noofrows; $i++) {
                     $attachmentIds[] = vtws_getId($WsEntityId,$adb->query_result($result, $i, 'attachmentsid'));
                 }
-            } else if($noofrows > 0){
-                $attachmentIds[] = vtws_getId($WsEntityId, $adb->query_result($result, 0, 'attachmentsid'));
             }
         }
         return $attachmentIds;
-- 
GitLab