This issue occurs in a version of Sugar that is no longer supported. If this error occurs, upgrade your version of Sugar.
Background
The Sugar SOAP API returns invalid XML data. The bug has been in Sugar since version 4.5 - bug #39382
When the condition is encountered, the Meeting and Phone Call modules do not synchronize.
Issue
When retrieving the list of attendees from Sugar, the synchronization issues an error.
**** EXCEPTION ********************************************************************************
* System.Xml.XmlException: An error occurred while parsing EntityName. Line 1, position 467.
* System.Xml.XmlException: An error occurred while parsing EntityName. Line 1, position 467.
Resolution
To fix the code responsible for returning the XML data:
-
Connect to the Sugar server file system.
-
In a text editor, edit the soap/SoapData.php file.
-
At the bottom of the file, locate the ?>
-
Just above the ?> , paste:
// XML Entity Mandatory Escape Characters
function xmlEncodeEntities ( $string )
{
return str_replace ( array ( '&', '"', "'", '<', '>' ), array ( '&' , '"', ''' , '<' , '>' ), $string );
} -
Locate the get_attendee_list function:
function get_attendee_list($session, $module_name, $id){There are two instances of the following code in the get_attendee_list function:
$xml .= '<first_name>'.$row['first_name'].'</first_name>';
$xml .= '<last_name>'.$row['last_name'].'</last_name>'; - Replace those two instances so that they call the new xmlEncodeEntities function, like this:
$xml .= '<first_name>'.xmlEncodeEntities($row['first_name']).'</first_name>';
$xml .= '<last_name>'.xmlEncodeEntities($row['last_name']).'</last_name>'; - Save the file.