Sugar: Error "Get Attendee List Failed!"

  • Updated
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.

 

Resolution

To fix the code responsible for returning the XML data:

  1. Connect to the Sugar server file system.

  2. In a text editor, edit the soap/SoapData.php file.

  3. At the bottom of the file, locate the ?>

  4. Just above the ?> , paste:

    // XML Entity Mandatory Escape Characters
    function xmlEncodeEntities ( $string )
    {
        return str_replace ( array ( '&', '"', "'", '<', '>' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;' ), $string );
    }

     

  5. 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>';

     

  6. 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>';

     

  7. Save the file.

Was this article helpful?

/