Hotfix for SugarCRM 5.5

Important announcements about the Opacus SugarCRM Outlook Plugin
Post Reply
User avatar
opacus.daniel
Site Admin
Posts: 500
Joined: Thu Feb 04, 2010 5:01 pm
Contact:

Hotfix for SugarCRM 5.5

Post by opacus.daniel » Tue Feb 16, 2010 2:12 pm

To fix the problem with the plugin searching for records in SugarCRM 5.5 please apply the following fix.

In the SugarCRM installation open..... soap/SoapSugarUsers.php

In the function "get_entry_list" directly beneath

Code: Select all

global  $beanList, $beanFiles;
	$error = new SoapError();
	if(!validate_authenticated($session)){
		$error->set_error('invalid_login');
		return array('result_count'=>-1, 'entry_list'=>array(), 'error'=>$error->get_soap_array());
	}
add the following

Code: Select all

// BEGIN OPACUS FIX
	// copied the $seed from below up here
	$class_name = $beanList[$module_name];
	require_once($beanFiles[$class_name]);
	$seed = new $class_name();
     
    // check to see if the query is looking for an email address:
	 $GLOBALS['log']->info('hotfix: looking for ' . $query);
	 
	if(strstr($query,'email_address LIKE')){	
	       
			$tmpQuery .= "select $seed->table_name.id from $seed->table_name INNER JOIN email_addr_bean_rel eabl  ON eabl.bean_id = $seed->table_name.id and eabl.deleted=0";
			$tmpQuery .= " INNER JOIN email_addresses ea ON (ea.id = eabl.email_address_id) where " . $query ;
			$result = $seed->db->query($tmpQuery, $offset, $max_results);
			$row = $seed->db->fetchByAssoc($result);
			if (!empty($row['id'])) {
				$query = " $seed->table_name.id = '" . $row['id'] . "'";
				$GLOBALS['log']->info('hotfix: new q ' . $query);
			} else {  
				$query = " $seed->table_name.id = '1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0'";//else return a duff id because no result was found
			}
	}
	// END OPACUS FIX
After applying this fix you should now be able to search for records using the Opacus Outlook Plugin

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest