It seems I keep coming across this in some form or another - something about one of my homebrew themes will cause the jquery collapsible fieldsets to fail. They appear collapsed, and are not expandable. It's usually on the Node Edit page and doesn't occur in other themes so I figure I must be doing something wrong.
In the most recent case, by systematically removing each included .js file in turn, I've narrowed it down to the upload.js file. Without this file the page behaves itself (though obviously inline uploads are not functional - thankfully the upload module degrades gracefully, submitting to itself and reloading with the file attached and all edit changes retained, yay team).
I'm afraid I have no clue what I'm doing that would cause this conflict. It appears to be a perfectly normal Garland-derived[1] theme, with all the colour change functionality stripped out and my own styles inserted. $scripts and $closure all present and correct.
A temporary workaround is to leave the upload.js disabled but obviously I'd rather not rely on that in the long term ... any suggestions?
[1] The Garland theme itself, meanwhile, works fine.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 143921.patch | 820 bytes | solipsist |
| #6 | 143921.patch | 297 bytes | solipsist |
Comments
Comment #1
kingandyI so meant to Preview that instead of Submit.
Changing title to reference actual .js file.
Comment #2
mamasdiner commentedI'm having the opposite problem. I can not view the collapsible fieldsets when creating nodes EXCEPT on the theme I created myself, which was made last year. All of the included themes are affected. I recently upgraded my FF browser, but I don't think that's the cause since my other sites are not affected. Both of my sites are running 5.1, but only one site is affected.
I've read every post I can find on Drupal regarding collapsible fieldset problems, but am still unsure how to fix this problem. A few of the posts are:
http://drupal.org/node/119724
http://drupal.org/node/137651
http://drupal.org/node/118697 - the screenshots here are what is happening on my site.
I'm not an expert at programming, but I can open a file and insert code if I only I knew what and where. I'm using the latest version of CCK.
Any help would be greatly appreciated.
Heather
Comment #3
mamasdiner commentedFixed.
I went back and followed the simple steps in a few of the links above and now I am able to expand and collapse the fieldsets within all of the themes. I cleared the browser cache and installed javascript updates. So far it's working.
Apologies for jumping the gun on this post.
Heather
Comment #4
kingandyThat's nice for you, but my original problem remains.
It's happening in both IE 6 and Firefox, on multiple computers. Clearing the cache does not help.
(Oddly in IE7 the collapsible fieldsets are just as inactive but are at least pre-expanded, but removing upload.js has no effect on that so I'm assuming it's a separate issue. Since the site remains usable, that's the kind of issue I can live with.)
What did you mean by "installed javascript updates"? I've got the latest 5.1 .js files from the most recent Drupal release, is there a patch or code snippet in one of those links that I missed?
Comment #5
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).
Comment #6
solipsist commentedThis bug has existed even until current 5.10 so it's time we get rid of it for good. The bug is not in the theme function but in upload.module itself, line 804 where the FAPI property #id is used. #id is not a property, instead the #attribute property should be used. Making that modification fixes the problem. The attached does the fix.
Comment #7
solipsist commentedClarification: The bug is in upload.module, not in the JS.
Comment #9
solipsist commentedImproved patch.
Comment #10
damien tournoud commentedSorry
#idis indeed a FAPI property (even if it is not documented), and the upload module has all the right to use it. All FAPI theme functions have to output the #id asid=""on all low-level elements.Comment #11
solipsist commentedEven it being so, the patch above fixes the problems we've been having with non-collapsible fieldsets. Hopefully it can help someone else as well.
Now, why the use of (what you claim to be) a legit property causes the JS to fail remains to be understood. I haven't had time to do any serious debugging, just enough to keep our client's site working and with D5 being phased out it's not a priority for us ATM.
Comment #12
damien tournoud commentedThat's an issue of one of your theme function that does not properly output
id='#id'. Fix your theme, or reassign this issue to the correct theme if it is hosted on drupal.org.