If the choice is made to show the radioactivity history on the node form then the page load of the node form either stalls with continual reloads or stops with javascript errors. The problem is caused by the radioactivity-history.js snippet that builds the sparkline graph. There is no protection around this code to stop multiple executions. The first execution on a radioactivity-history div works fine as there is JSON data to process and the graph is created in place of the JSON however subsequent calls no longer find any valid JSON as it is now a graph so there is a javascript error as dataset is NULL. On node form pages with WYSIWYG ajax loads attach behaviors can be called multiple times leading to the JS error and, in my case, continual reload attempts of the page.
The fix is to replace .each(function(match)) with .once('sparkline', function(match)) to avoid multiple processing on each div.
Comment | File | Size | Author |
---|---|---|---|
#4 | radioactivity-2555141_history-fix.patch | 798 bytes | sammuell |
Comments
Comment #2
badcrocodile CreditAttribution: badcrocodile commentedFWIW this was causing "Uncaught SyntaxError: Unexpected end of input" errors for me when trying to remove images from the node edit screen. I couldn't remove any images uploaded to a node until I implemented this patch. Thanks for the fix!
Comment #3
deanflory CreditAttribution: deanflory as a volunteer commentedIs there a ".each" anywhere in the current radioactivity file set's code? I'm not finding what is mentioned anywhere. I guess this is just over my head.
Comment #4
sammuell CreditAttribution: sammuell commentedI confirm this bug. The history view breaks async operations of file fields.
The attached patch contains the suggested fix above, which works perfectly. Can you please commit and release a new version? There are also other commits waiting to be released.
Comment #5
lennart CreditAttribution: lennart commentedBug confirmed. Patch seems to fix it. Thanks!
Comment #8
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commented