[Vtigercrm-commits] [vtiger-commits] r9576 - /vtigercrm/branches/5.0.1/include/utils/EditViewUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Oct 6 08:59:22 EDT 2006


Author: richie
Date: Fri Oct  6 06:59:18 2006
New Revision: 9576

Log:
Users->New Users throws a database error. Fixes #2278

Modified:
    vtigercrm/branches/5.0.1/include/utils/EditViewUtils.php

Modified: vtigercrm/branches/5.0.1/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.1/include/utils/EditViewUtils.php (original)
+++ vtigercrm/branches/5.0.1/include/utils/EditViewUtils.php Fri Oct  6 06:59:18 2006
@@ -1195,12 +1195,14 @@
 	elseif($uitype == 105)
 	{
 		$editview_label[]=$mod_strings[$fieldlabel];
-			$query = "select attachments.path, attachments.name from contactdetails left join seattachmentsrel on seattachmentsrel.crmid=contactdetails.contactid inner join attachments on attachments.attachmentsid=seattachmentsrel.attachmentsid where contactdetails.imagename=attachments.name and contactid=".$col_fields['record_id'];
-		$result_image = $adb->query($query);
-		for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++)	
-		{
-			$image_array[] = $adb->query_result($result_image,$image_iter,'name');	
-			$image_path_array[] = $adb->query_result($result_image,$image_iter,'path');	
+		 if( isset( $col_fields['record_id']) && $col_fields['record_id'] != '') {
+			$query = "select vtiger_attachments.path, vtiger_attachments.name from vtiger_contactdetails left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_contactdetails.contactid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where vtiger_contactdetails.imagename=vtiger_attachments.name and contactid=".$col_fields['record_id'];
+			$result_image = $adb->query($query);
+			for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++)	
+			{
+				$image_array[] = $adb->query_result($result_image,$image_iter,'name');	
+				$image_path_array[] = $adb->query_result($result_image,$image_iter,'path');	
+			}
 		}
 		if(is_array($image_array))
 			for($img_itr=0;$img_itr<count($image_array);$img_itr++)





More information about the vtigercrm-commits mailing list