On a number of our sites, when upload.js is loaded it seems to prevent further jQuery functionality from loading on the page. Collapsed fieldsets cannot be uncollapsed ('A' tags are not being added to the Legend elements), autocomplete fields don't autocomplete, resizable textareas aren't resizable and the inline upload functionality itself (provided by upload.js) doesn't work. The only commonality seems to be that the themes involved are all derived from Garland, though they have been heavily modified and little remains of the original theme code.
Here are the headers from a site where everything functions as intended:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Submit Page | Link 51</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="index,follow" />
<style type="text/css" media="all">.mceEditor img { display: inline; }</style>
<link rel="shortcut icon" href="" type="image/x-icon" />
<style type="text/css" media="all">@import "/modules/book/book.css";</style>
<style type="text/css" media="all">@import "/modules/node/node.css";</style>
<style type="text/css" media="all">@import "/modules/system/defaults.css";</style>
<style type="text/css" media="all">@import "/modules/system/system.css";</style>
<style type="text/css" media="all">@import "/modules/user/user.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/cck/content.css";</style>
<style type="text/css" media="all">@import "/sites/retailstoragesolutions.co.uk/themes/link-retail/style.css";</style>
<script type="text/javascript" src="/misc/jquery.js"></script>
<script type="text/javascript" src="/misc/drupal.js"></script>
<script type="text/javascript" src="/misc/progress.js"></script>
<script type="text/javascript" src="/misc/upload.js"></script>
<script type="text/javascript" src="/sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/misc/autocomplete.js"></script>
<script type="text/javascript" src="/misc/collapse.js"></script>
<script type="text/javascript" src="/misc/textarea.js"></script>
<script type="text/javascript" src="/sites/all/modules/spamspan/spamspan.compressed.js"></script>
[... TinyMCE initialisation code snipped ...]
<!--[if IE]>
<style type="text/css" media="all">@import "/sites/retailstoragesolutions.co.uk/themes/link-retail/ie.css";</style>
<script type="text/javascript" src="/sites/retailstoragesolutions.co.uk/themes/link-retail/ie.js"></script>
<![endif]-->
</head>
<body>
And here's the top of a page where the upload script is rendering everything non-functional, on the same server, in the same Drupal installation:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-UK" lang="en-UK">
<head>
<title>Ascot Hamper with glasses - 2 Person | CPL Garden & Leisure</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Coolers and Hampers" />
<meta name="robots" content="index,follow" />
<meta name="DC.title" content="Ascot Hamper with glasses - 2 Person" />
<style type="text/css" media="all">.mceEditor img { display: inline; }</style>
<link rel="shortcut icon" href="" type="image/x-icon" />
<style type="text/css" media="all">@import "/modules/node/node.css";</style>
<style type="text/css" media="all">@import "/modules/system/defaults.css";</style>
<style type="text/css" media="all">@import "/modules/system/system.css";</style>
<style type="text/css" media="all">@import "/modules/user/user.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/cck/content.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/cck/fieldgroup.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/ecommerce/cart/cart.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/ecommerce/store/store.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/nice_menus/nice_menus.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/taxonomy_context/taxonomy_context.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/devel/devel.css";</style>
<style type="text/css" media="all">@import "/sites/cplgnldev.livelinknewmedia.com/themes/cplgnl/style.css";</style>
<script type="text/javascript" src="/misc/jquery.js"></script>
<script type="text/javascript" src="/misc/drupal.js"></script>
<script type="text/javascript" src="/sites/all/modules/nice_menus/nice_menus.js"></script>
<script type="text/javascript" src="/misc/progress.js"></script>
<script type="text/javascript" src="/misc/upload.js"></script>
<script type="text/javascript" src="/sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/misc/autocomplete.js"></script>
<script type="text/javascript" src="/misc/collapse.js"></script>
<script type="text/javascript" src="/misc/textarea.js"></script>
[... TinyMCE initialisation code snipped ...]
<style type="text/css" media="print">@import "/sites/cplgnldev.livelinknewmedia.com/themes/cplgnl/print.css";</style>
<!--[if lt IE 7]>
<style type="text/css" media="all">@import "/sites/cplgnldev.livelinknewmedia.com/themes/cplgnl/fix-ie.css";</style>
<![endif]-->
</head>
<body class="sidebars">
I am reasonably certain everything before the upload.js call is working - the Nice Menus function perfectly. TinyMCE also functions, but I don't think that uses jQuery (though I live to be corrected). I've tried systematically removing each .js file in turn and it's definitely upload.js that's throwing the spanner in the works.
I welcome suggestions regarding more things to try and/or more information that I can provide.
Help!
Comments
Comment #1
kingandyAnybody?
Comment #2
kingandyFinally figured it out - this was due to a forms.inc theme override function (detailed here: http://drupal.org/node/62647) forgetting an ID attribute for submit buttons (as discovered here: http://drupal.org/node/165502), and not in fact anything to do with the core javascript itself (which was correctly looking for a submit button with a specific ID).