Page 1 of 3

gChart Broken after 6.0.13

Posted: 15 Jun 2017, 03:37
by csyperski
I have a web app where the only thing I changed was primefaces was updated from 6.0.13 to 6.0.19 (with PF-ext 6.0.0) and it seems as if gChart broke somewhere in between. I need to renew my elite membership, so I don't currently have access to the version in between. With 6.0.13, everything worked as expected, but now on 6.0.19 I get the following error:

Code: Select all

VM3563:1 Uncaught SyntaxError: Unexpected token \ in JSON at position 1
    at JSON.parse (<anonymous>)
    at Class.init (http://localhost:8080/powerptc/javax.faces.resource/primefaces-extensions.js.html?ln=primefaces-extensions&v=6.0.0:40:133)
    at Class.prototype.(anonymous function) [as init] (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.0.19-SNAPSHOT:1915:26)
    at new Class (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.0.19-SNAPSHOT:1928:19)
    at Object.createWidget (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.0.19-SNAPSHOT:311:47)
    at Object.cw (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.0.19-SNAPSHOT:296:18)
    at http://localhost:8080/powerptc/protected/admin/graphs/fillratio.html:63:345
It looks let the json data has an extra escape character in it?

Code: Select all

{\"type\":\"PieChart\",\"options\":{},\"data\":[[\"Topping\",\"Slices\"],[\"Mushrooms\",2],[\"Onions\",22]]}
I've updated to PF 6.1.1 with PF-Ext 6.1.1 and I get the same error.

Re: gChart Broken after 6.0.13

Posted: 15 Jun 2017, 13:05
by Melloware
I think it is related to these two tickets...

https://github.com/primefaces-extension ... issues/463

https://github.com/primefaces/primefaces/issues/2395

Basically PF made a fix in 6.0.19 that is "double escaping" things that were already escaped. They made the fix in Elite 6.1.3 but you may have to request that they make it in a 6.0.X elite release as well if you comment on that #2395 ticket.

Re: gChart Broken after 6.0.13

Posted: 18 Jun 2017, 05:49
by csyperski
Thank you!

Re: gChart Broken after 6.0.13

Posted: 11 Jul 2017, 21:54
by csyperski
I'm getting the same error with 6.1.3, was this actually included in this release?
VM249:1 Uncaught SyntaxError: Unexpected token \ in JSON at position 1
at JSON.parse (<anonymous>)
at Class.init (http://localhost:8080/powerptc/javax.fa ... 6.1:27:133)
at Class.prototype.(anonymous function) [as init] (http://localhost:8080/powerptc/javax.fa ... OT:1942:26)
at new Class (http://localhost:8080/powerptc/javax.fa ... OT:1955:19)
at Object.createWidget (http://localhost:8080/powerptc/javax.fa ... HOT:323:47)
at Object.cw (http://localhost:8080/powerptc/javax.fa ... HOT:308:18)
at http://localhost:8080/powerptc/protecte ... ml:59:2682

Re: gChart Broken after 6.0.13

Posted: 11 Jul 2017, 22:31
by Melloware
See below post....

Re: gChart Broken after 6.0.13

Posted: 12 Jul 2017, 01:47
by Melloware
I apologize it looks like they fix did not make the 6.1.3 release but will make the 6.0.22 and 6.1.4 release.

https://github.com/primefaces/primefaces/issues/2395

Re: gChart Broken after 6.0.13

Posted: 12 Jul 2017, 02:59
by csyperski
I saw conflicting posts so thanks for the clarification.

Re: gChart Broken after 6.0.13

Posted: 11 Aug 2017, 13:07
by Melloware
6.1.4 was officially released.

Re: gChart Broken after 6.0.13

Posted: 14 Aug 2017, 19:27
by csyperski
So I just updated to 6.1.4 and I'm getting the same error....

Code: Select all

VM1122:1 Uncaught SyntaxError: Unexpected token \ in JSON at position 1
    at JSON.parse (<anonymous>)
    at Class.init (http://localhost:8080/powerptc/javax.faces.resource/primefaces-extensions.js.html?ln=primefaces-extensions&v=6.1:27:133)
    at Class.prototype.(anonymous function) [as init] (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.1.4-SNAPSHOT:1953:26)
    at new Class (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.1.4-SNAPSHOT:1966:19)
    at Object.createWidget (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.1.4-SNAPSHOT:323:47)
    at Object.cw (http://localhost:8080/powerptc/javax.faces.resource/core.js.html?ln=primefaces&v=6.1.4-SNAPSHOT:308:18)
    at http://localhost:8080/powerptc/protected/admin/graphs/fillratio.html:59:268
The data is coming across as:

Code: Select all

{\"type\":\"PieChart\",\"options\":{},\"data\":[[\"Metric\",\"Value\"],[\"HS1 - Open Slots\",579],[\"HS1 - Breaks\",65],[\"HS1 - Scheduled Slots\",4],[\"HS2 - Open Slots\",0],[\"HS2 - Breaks\",0],[\"HS2 - Scheduled Slots\",0]]}
Am I missing something here?

Re: gChart Broken after 6.0.13

Posted: 14 Aug 2017, 20:02
by Melloware
OK and you are sure you are using PFE 6.1.1 with PF 6.1.4?