Changing the type of response returned by the JSONReader


This page should only be applied if the script asks you to pass the manual migration code.20250602.core.JSONParse

The responses generated by the JSONReader now declare the MIME type json (instead of text/plain ). This has an impact on functions that handle the results of Ajax requests issued by JQuery. They now receive a javascript object directly, rather than a simple text. Calling JSON.parse, which was previously necessary, now fails.

Search forJSON.parse" in all your JS and XSL files (ignore occurrences found in external js libraries)
For each call to JSON.parse made to process an Ajax request response you must :

  • test the functionality to check if it's still working (if not, logs should appear in the JS console talking about JSON.parse). The functionality most likely to be impacted in your projects is the customization of directory links (adding links).
  • for failed calls, replace calls of the type:

    var result = JSON.parse(data);

    by

    var result = typeof data === 'object' ? data : JSON.parse(data);

In theory, these calls to JSON.parse are no longer necessary, but to be on the safe side, it's better to use the fix above, which manages both the old and the new behavior.

Back to top