Closed (won't fix)
Project:
Drupal core
Version:
6.x-dev
Component:
javascript
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
29 Dec 2006 at 15:40 UTC
Updated:
5 Nov 2007 at 01:57 UTC
Currently, a single file can be added twice when it’s in different theme layers. For example, if you require jQuery for your theme, you typically add drupal_add_js('misc/jquery.js', 'theme');. If jQuery is already present in the core layer, it’s added again because the file check is restricted to the layer.
Comments
Comment #1
morbus iffSomething to consider would be if a duplicate file is found, do we a) ignore the second request, b) find out which request is lower or higher and logically choose the Right One. Would there ever be a situation where a file is added to 'core', then added again in 'theme', and having it lower (in 'theme') is The Right and Desired Way? With the "ignore the second request" possibility, we'd seemingly only care about 'core' if it was ever added first... would there ever be a use case where we want a lower scope to prevail should duplicates exist?
Comment #2
kkaefer commentedI'm marking this as won't fix because I haven't got any report on that flaw actually causing problems. It probably won't happen that a single JS file is put into two different scopes and/or types.
Comment #3
pingers commentedWe're having the exact same trouble where in conjunction with panels we're including js twice... it's very annoying and I'm thinking a drupal_add_js_once would be very nice right now.