Hello,
I have a problematic JSON in a dashlet. The dashlet is "Pay tasks" - lists tasks I have to pay. But when I'm loading tasks, I get a JSON error:
[skip unnecessary]
Caused by: org.alfresco.web.scripts.WebScriptException: SyntaxError: missing } after property list (file:/opt/pbk-svn/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/dashlets/protenus/pay-tasks-list.get.js#10(eval)#5129)
at org.alfresco.web.scripts.PresentationScriptProcessor.executeScriptImpl(PresentationScriptProcessor.java:275)
at org.alfresco.web.scripts.PresentationScriptProcessor.executeScript(PresentationScriptProcessor.java:157)
… 23 more
Caused by: org.mozilla.javascript.EcmaError: SyntaxError: missing } after property list (file:/opt/pbk-svn/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/dashlets/protenus/pay-tasks-list.get.js#10(eval)#5129)
[further skip]
I located the error in the JSON I get from pay-tasks-list.json.ftl (big big thanks to MikeH), and I saw that this task was referring to a partner that had an extra quote (bold here):
[…]
{ "id": "jbpm$70791", "description": "Priprema plaćanja (Payment preparation)", "dueDate": "2009-12-02 00:00:00 GMT+0100 (CET)", "status": "Not Yet Started", "priority": "2", "startDate": "2009-12-03 14:54:56 GMT+0100 (CET)", "type": "Choose how you want to prepeare payment", "completeness": "0", "resources": [ { "nodeRef": "workspace://SpacesStore/9ac5b0d4-348f-42ed-8fc4-646972a4cb61", "fileName": "URA-0030263.pdf", "tip" : "{protenus.model}DokumentURA", "DokumentID": "0030263", "IRAbroj": "", "IZVbroj": "", "URAdatum": "2009-12-02", "URAdatumDospijeca": "02.12.2009.", "URAiznos": "369", "URAvendor": ""MIMA"", "PlacanjeIznosOstalo" : "369", "PlacanjeIznosPlatiti": "0", "displayName": "URA-0030263.pdf", "location": { "site": "####", "container": "documentLibrary", "path": "/1 - Na knjiženju (Company bills to book)" }, "icon": "/images/filetypes/pdf.gif" } ], "transitions": [ { "id": "PripremiPlacanje", "label": "Payment preparation for tmrw" }, { "id": "HitnoPripremiPlacanje", "label": "Prepare payment for today" }, { "id": "PripremiDioZaPlacanje", "label": "Prepeare partial payment " }, { "id": "Storniraj", "label": "Dispute invoice" }, { "id": "Placeno", "label": "Already paid" } ] } ,
[…]
I located that partner and removed the extra quotes, but I still get errors. When I try again with that script, I get the double quotes again.
Can somebody please confirm that these quotes are the thing that is actually breaking the JSON? And also, do tasks copy that information somewhere, so even if I change the information, jbpm would still have the old information? If yes, can you tell me where in the database, so I change that one too?