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.

CommentFileSizeAuthor
#4 radioactivity-2555141_history-fix.patch798 bytessammuell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dippers created an issue. See original summary.

badcrocodile’s picture

FWIW 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!

deanflory’s picture

Is 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.

sammuell’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community
FileSize
798 bytes

I 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.

lennart’s picture

Bug confirmed. Patch seems to fix it. Thanks!

  • Sutharsan committed cf2f2c5 on 7.x-2.x authored by sammuell
    Issue #2555141 by sammuell: History display causes page load to stall
    

Sutharsan’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.