Empty reports using cached api data

Post Reply
liamdennehy
Posts: 6
Joined: 19 May 2021, 19:56

Some reports (e.g. Org Summary at "enterprise/core_el_org_summary_new.xsl" in screenshot) contain no data despite all supporting files being generated correctly in "platform\tmp\reportApiCache".
You do not have the required permissions to view the files attached to this post.
JohnM
Posts: 472
Joined: 17 Feb 2009, 20:19

Two things to look at :

1) Can you open the viewer and change the XSL= path in the URL to common/utils/core_util_recursion_finder_group_actor.xsl and see if there is any recursion going on, you'll see as the orgs will be nested. Note: we're aware of a bug if there is recursion which we're looking at.
2) Can you check the console for any errors, open the dev tools (right click > inspect in Chrome/Edge/Firefox, right click > Inspect Element in Safari)

If no issues there, can you let us know which browser you are using and we'll work out what to try next.

Thanks
liamdennehy
Posts: 6
Joined: 19 May 2021, 19:56

Indeed, the JSON is bad.

Firefox 105 on Windows:
Uncaught SyntaxError: JSON.parse: bad escaped character at line 186 column 181 of the JSON data
Chrome 105 on Windows:
Uncaught SyntaxError: Bad escaped character in JSON at position 9125
The offending string contains the phrase "company's risk appetite", and is rendered in the JSON as "company\'s risk appetite". The JSON spec does not require the single quote character to be escaped. The JSON has dozens of single quotes being escaped as it is full of well-formed English descriptions.

UPDATE: This appears to have been fixed in the just-released 6.16.2 viewer. in the api xsl, all calls to the text rendering functions were previously doing JavaScript escaping with "isRenderAsJSString", now correctly marked for JSON escaping with "isForJSONAPI":
https://github.com/essentialproject/ess ... 2.xsl#L202

I only stumbled upon this as I had performed the same change and was ready to make a PR with the fix. Is there any way to get involved in these developments before they are published to github or the web site?
Last edited by liamdennehy on 27 Sep 2022, 13:36, edited 1 time in total.
JohnM
Posts: 472
Joined: 17 Feb 2009, 20:19

Hi Liam,

Apologies, obviously one we missed and fixed in 6.16. Once we get these moved to XSL3 this sort of issue will disappear. It's on the stack, but not started yet.

Re earlier involvement, I'll talk to the team about how that could work

John
Post Reply