Drupal collapsible regions not working

Joined: 03/29/2007

I've seen this happen before and it's happened again...
I add or update a module and immediately afterwards the collapsible regions in Drupal die. The region expansion icon symbol is gone and the expansion behavior is gone. The XHTML and CSS seems unchanged. I think this is a javascript thing, but I'm not at all savvy on such stuff.

So far it has only happened on parallel test sites where I'm more casual about updating and trying out modules, but it is kind of scary and frustrating, as I don't know what is causing it. It appears the trouble is lodged in the Drupal database as the problem remains after disabling the new modules, yet do not appear in other sites of a multi-site install (and the sites settings.php file haven't changed).

I haven't done any deep diagnostics, but it's kind scthary. Last time it happened the update to Drupal 5.2 cleared it.

Mark

Mark

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
scripts

This has to do with scripts. Anything dynamic in a page like the collapsible blocks is javascript. For some reason it isn't loading. The first thing to do is check your theme for the $scripts variable. Make sure you are outputting it.

Don't let something like this scare you. This is usually easily correctable and isn't tied to your content itself.

Is there a particular module or theme that you enable when you see this happen? Next time this pops up you might want to record the exact change you made. That will narrow down where the issue is.

Matt Farina
Geeks and God Co-Host
www.mattfarina.com

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

Joined: 03/29/2007
Effecting all themes

Thanks for answering... and the pointers.

I've been off-line for a while. Lots of hardware swapping going on at church, a switch died, we're setting up a three person office and a mobile workstation, and swapping web hosts... so web development has taken a back seat this week. But I promised a Drupal site by Labor Day so I'm leaving the rest of the hardware stuff to others and getting back to Drupal.

Here is the story:
It is effecting all themes I've tested (including even the old and new standard themes distributed with Drupal core).

I upgraded a group of contrib modules that I had update notification on and activated one or two new ones. I'm afraid I wasn't doing this in a well documented or a one step at a time basis. On-the-other-hand....I wasn't doing it on a production site. Curiously, disabling all the newly activated modules is not eliminating the problem and the problem isn't showing itself on other sites using the same module and the same multi-site install.

Since there was little content on this test site... I might eventually just flush the database and rerun an install to clear it. It really want another alternative though ... in case it ever happens on a production install.

Since I've seen it twice and I've seen some old threads about past problems with JQuery getting messed up in Drupal I'd guess that is what is happening now. It looks like Drupal uses JQuery for this. I'm suspicious it is a semi-common problem that I could/should learn how to avoid and even better repair.

All hints and hunches are welcome.

Mark

Mark

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
is it in the head

First, does the call to the javascript show up in the head. You should see includes for drupal.js, jquery.js and some others in the head tag of your html page. Are they there?

This first step is important. We need to know if the javascript is being included or not. This will lead in the direction of the problem.

Matt Farina
Geeks and God Co-Host
www.mattfarina.com

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

Joined: 03/29/2007
Will investigate later..... could be common Drupal problem

Thanks Matt,
Good suggestions!

There are js files called in the head and they are loading, but I hadn't analyized if I'm getting the full or correct set.

I don't have time to troubleshoot anymore right now... as our church site build schedule has started to slip, cause of me I guess... so it will be another week (or two before) I can dig in again.

In the meantime ..... I just noticed that a site with the collapsibles working fine was loading a file called "collapse-fix.js". This inspired me to to Google the file name which turned up a link to "collapsed fieldsets won't/can't be expanded" on Drupal.org. So it may be connected to interaction with JQuery Update, Durpal's native JQuery and some other stuff I was using.

The strange thing is: I have JQuery Update running on another site with same modules and same themes active and sharing the same code base as the problem site... and they have no problems. It's like something got "permanently" altered in the database regarding Drupal's use of jQuery.

Maybe for now I should just stay away from aggressive use of JQuery and get my JQuery update from Drupal 6 when it's ready....

Ahhhh,
Thanks again.
L8r,
Mark

Mark

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
jquery update

jQuery update updates jQuery as the name implies. But, between the distributed version of jQuery and the updated one there were api changes. So, the collapsible blocks javascript doesn't work with the update. To fix that the collapsible-fix javascript file was included. It fixes for the api changes.

This has nothing to do with the back end database and is really just about changes to jQuery.

Matt Farina
Geeks and God Co-Host
www.mattfarina.com

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

Joined: 12/11/2010
we had the same problem

Hello!

We had the same problem on a Drupal test site while testing some features with jQuery Update 6.x-2.0-alpha1 & Drupal Core 6.17

after disabling jQuery Update 6.x-2.0-alpha1 the issue was gone.

Will look into it more deeply...