Hi ! I can't update my custom fields on the tickets was merges. This bug relates to the issue marked at the following link : http://dev.kayako.com/browse/SWIFT-1809 However, I have these scripts retrieving information with the API and allowing us to do statistics. These are very important to us. However, if no information is filled in custom fields, I get this error message: Fatal error: Uncaught exception 'Exception' with message 'String Could not be parsed as XML' in E: \ TrackingSiteSurvey \ EasyPHP \ EasyPHP-5.3.9 \ www \ KayakoAPILibrary \ kyHelpers.php: 19 Stack trace: # 0 E: \ TrackingSiteSurvey \ EasyPHP \ EasyPHP-5.3.9 \ www \ KayakoAPILibrary \ kyHelpers.php (19): SimpleXMLElement-> __construct (' # 2 E: \ TrackingSiteSurvey \ EasyPHP \ EasyPHP-5.3.9 \ www \ KayakoAPILibrary \ kyBase.php (227): kyBase :: processRequest (NULL, 'GET', Array) # 3 E: \ TrackingSiteSurvey \ EasyPHP \ EasyPHP-5.3.9 \ www \ KayakoAPILibrary \ kyTicketCustomFieldGroup.php (30): kyBase _get :: (Array) # 4 E: \ TrackingSiteSurvey \ EasyPHP \ EasyPHP-5.3.9 \ www \ KayakoAPILibrary \ kyTicket.php (1017): kyTicketCustomFieldGroup getAll :: (379) # 5 E: \ TrackingSiteSurvey \ EasyPHP \ EasyPHP-5.3.9 \ www \ MajCustomField.php (133): kyTicket-> getCustomFieldGroups () # 6 {main} thrown in E: \ TrackingSiteSurvey \ EasyPHP \ EasyPHP-5.3.9 \ www \ KayakoAPILibrary \ kyHelpers.php on line 19 Here is the code for me to make the call on the API: $ Id = $ object-> getId (); $ ticket = kyTicket :: get ($ id); field_groups $ = $ ticket-> getCustomFieldGroups (); foreach ($field_groups as $field_group) { $FieldGroupTitle = $field_group-> getTitle (); switch ($ FieldGroupTitle) { case "Billing Information": $ field = $ field_group-> getFields (); foreach ($ field as $ field) { FiledTitle $ = $ field-> getTitle (); $ Value = $ field-> getValue (); switch ($ FiledTitle) { So how can I do to not get this error message ?
Enable debug mode in PHP Library and check PHP error log to see what is sent by Kayako that could not be parsed as XML (I guess there will be some notices/warnings printed by Kayako).
Thanks for you answer. I'activated the debug mode. Follow, all warning and error : Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 155: parser error : Opening and ending tag mismatch: contents line 152 and property in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: <property id_property="4"><![CDATA[Imprimé]]></property> in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 166: parser error : Sequence ']]>' not allowed in content in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ]]></contents> in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 166: parser error : Opening and ending tag mismatch: post line 135 and contents in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ]]></contents> in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 167: parser error : Opening and ending tag mismatch: posts line 34 and post in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </post> in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 216: parser error : Opening and ending tag mismatch: ticket line 3 and posts in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </posts> in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 217: parser error : Opening and ending tag mismatch: tickets line 2 and ticket in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </ticket> in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 218: parser error : Extra content at the end of the document in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </tickets> in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php:31 Stack trace: #0 E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php(31): SimpleXMLElement->__construct('<?xml version="...') #1 E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyRESTClient.php(202): ky_xml_to_array('<?xml version="...') #2 E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyRESTClient.php(219): kyRESTClient->processRequest('/Tickets/Ticket', 'GET', Array) #3 E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyObjectBase.php(215): kyRESTClient->get('/Tickets/Ticket', Array) #4 E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\MajCustomField.php(138): kyObjectBase::get(656) #5 {main} thrown in E:\TrackingSiteSurvey\EasyPHP\EasyPHP-5.3.9\www\KayakoAPILibrary\kyHelpers.php on line 31 Can you help me please ?
It's something... but I also need the raw response sent by server. If you enabled PHP Library debug mode there should be lines starting from Sending REST request to Kayako. You can send it through private conversation.