For weeks now I have been using collapsible fieldsets to display a particular node type field without problems. Sometime during the last week it inexplicably stopped working. Collapsible fieldsets still work correctly for core stuff (e.g. module listing) and the legend element appears as it used to, only the fieldset is collapsed (as it should be) and can't be expanded (the legend isn't clickable). Inspecting the HTML I can see that the value that should be in the fieldset is indeed there. What's extra curious is that in the Views GUI the fieldsets work correctly but not on the frontend of the same view.

Edit: I have been using collapsible fieldsets successfully outside of views on manually created content. This is the first time I try to use them in a view and it was how I discovered they'd ceased to function, both on the view I'm working on and the PHP code I've written myself. As per Laxman13's post, collapse.js is not being loaded on my own pages for some reason.

  • Please explain how you "tried to use them in a view" – Laxman13 Sep 14 '11 at 15:17
  • @Laxman13: The particular view I'm working on was meant to replace a component I'd pieced together manually several months ago, in a content template. Since the relevant field should only show to certain users I excluded it from view and added a Customfield: PHP type to output it instead. I saw they were not clickable, then went discovered the same is true for the existing component. I alone have permission to edit templates and I have never needed to add collapse.js manually. – Quail Sep 14 '11 at 18:35
  • so did the collapsing fieldset work in other views you have created? Also is your view using fields or nodes for the display type? – Laxman13 Sep 14 '11 at 18:44
  • I hadn't used them in a view before; but I just now did some experimentation and haven't been able to get collapsing fieldsets on any of my views, existing or new ones (except it works in the live preview). – Quail Sep 14 '11 at 18:56
  • I would assume Views wouldn't load collapse.js for all views as it isn't always needed, but I'm not sure. If you need this functionality, try adding manually – Laxman13 Sep 14 '11 at 19:05

This sounds like the necessary JS file is not being loaded. Check Firebug or Developer Tools, etc to see if collapse.js is being added to the <head> of the page. The file can be found at YOUR_DRUPAL_ROOT/misc/collapse.js

| improve this answer | |
  • It isn't, but why not? I've tried disabling every module I can remember adding over the last couple of weeks to no avail. The file is where it should be and, as mentioned, for core content it works fine. – Quail Sep 13 '11 at 23:02
  • This is a great example of why using version control for your sites it important, would allow you to roll back to a working version and compare – Chaulky Sep 14 '11 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.