At the moment, drupal_add_js(..., 'core') doesn’t really do much more than any other value, it’s just output at the very first place.

This patch changes the behavior a little bit: the core scope now acts as a toggle for JavaScript: When there are only core files in the array, no JavaScript at all is added to the page. Core files are now meant to be “support” files that don’t do anything of their own. Only if another JS file, settings or inline JavaScript is also added, they are added to the page.

CommentFileSizeAuthor
#1 drupal-core-js_0.patch4.92 KBkkaefer
drupal-core-js.patch3.61 KBkkaefer

Comments

kkaefer’s picture

StatusFileSize
new4.92 KB

Changed three 'core' JavaScript files.

m3avrck’s picture

Most of these changes have been rolled into this JS aggregation patch since it's already mucking in that exact same area: http://drupal.org/node/119441#comment-197707

keith.smith’s picture

Status: Needs review » Needs work

no longer applies

patching file update.php
Hunk #1 FAILED at 322.
Hunk #2 FAILED at 403.
2 out of 2 hunks FAILED -- saving rejects to file update.php.rej
patching file includes/common.inc
Hunk #1 succeeded at 1656 (offset 93 lines).
Hunk #2 FAILED at 1698.
Hunk #3 FAILED at 1729.
Hunk #4 FAILED at 1744.
3 out of 4 hunks FAILED -- saving rejects to file includes/common.inc.rej

pancho’s picture

Version: 6.x-dev » 7.x-dev

Don't know if this is still needed after JS get aggregated, but if yes it's for the D7 queue.

casey’s picture

http://api.drupal.org/api/function/drupal_add_js/6

JS handling has changed in D7. Does this still apply?

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.