Do we really need to load contentanalysis.js for every page load for every user? At the very least can we put it in hook_init() for users with the "perform content analysis" permission?

CommentFileSizeAuthor
#2 2829530-1-dont-load-javascript.patch1.09 KBmstrelan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mstrelan created an issue. See original summary.

mstrelan’s picture

Status: Active » Needs review
FileSize
1.09 KB
ron_s’s picture

Category: Feature request » Bug report
Status: Needs review » Needs work

The JavaScript should not be loaded based on permission, but rather added to the form where the "Analyze Content" button exists using the #attached parameter.

Otherwise, contentanalysis.js gets loaded on every page, including front-end pages.

Also, I consider this a bug, not a feature request. The way it currently works is the wrong way to add JS to a module.