12. Editor: A system error has occurred.
When an Editor request is made and the returned data is not in the expected format (JSON), Editor will show an error message stating that an error has occurred:
- 1.3.3+: A system error has occurred (more information)
- 1.3.2-: An error has occurred - Please contact the system administrator
This is a generic error message that Editor displays in the UI when it is unable to parse the returned data as JSON.
Diagnosis
If the server didn't reply to Editor's Ajax request with valid JSON data, we need to know what it did reply with, so we can take corrective action. Typically, the response will consist of an error message from the program on the server which is being used to create the JSON, which will be the starting point for resolving the issue fully.
Server data
Modern browsers all come with built in developer tools, which can be used to find out what data the server is responding to the DataTables Ajax request with. To access the developer tools for your browser, right click on the page and select "Inspect" (or "Inspect Element"). A panel will pop open with various debugging options. In this case we want the "Network" panel to show details of the requests and responses that the browser makes and the server replies with.
For more details about access the developer tools in your browser, please see the approiate documentation for your browser:
Error handler
It can also be useful to use the submitError event that Editor emits when an error occurs. The event has a number of parameters passed into it which can be useful for diagnosis:
``js editor.on( 'submitError', function ( e, xhr, err, thrown, data ) { this.error( xhr.responseText ); } ); ```
Resolution
Once you have followed the instructions above to find out what the data from the server actually is, it will provide the information required to resolve the underlying issue. The most common issues are:
- PHP 5.2 or earlier is being used (the Editor PHP libraries require PHP 5.3 or newer)
- A syntax error has been introduced into the code somewhere
- A bug exists in Editor causing PHP to dump an error message.
In any support requests, please ensure that you include the data returned from the server so we can help to resolve the error.