Advice for a novice Drupal developer hitting javascript problems?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
bflora's picture

Hi folks,

I'm developing an online news site that uses the Drigg module, panels, OG and views.

Somewhere along the way, I've picked up some nasty problems that I believe are javascript related.

They have to do with how forms work on my site.

Problems:

  1. The CCK Imagefield forms no longer works as designed. When I browse for an image and DON'T click "upload" it works. If click the upload button, the image info is not saved.

  2. I can no longer enable of disable modules, or uninstall disabled modules. When I click checkboxes and hit submit, the page simply refreshes with no change.

  3. I can no longer add content to panel panes. The popups aren't working anymore.

Javascript is a mysterious, very intimidating, scary entity to me. I think a lot of my problems trace to the Drigg module, which requires some jquery file replacing which may have gummed up the works. I believe some JS stuff is interfering with how forms work on my site. Is there a way I can "debug" the problem somehow? I've tried looking at a few tutorials, but they seem to be a bit over my head. Suggestions?

Comments

Firebug

dwees's picture

First step, install the Firefox add-on called Firebug. Keep track of when it is giving you errors, and post some of those errors here. You might even be able to figure out the problem from the error messages.

Second step, make a backup of your site. Create a duplicate somewhere else for testing, and try copying over the misc folder in your duplicate site with the original misc folder from the Drupal tar ball. See if the errors persist.

Third step, try disabling contributed modules one at a time until the errors go away, this will help narrow down where the problem actually is.

Hey Dwees, Thanks for the

bflora's picture

Hey Dwees,

Thanks for the pointers.

  1. I've got Firebug installed. I've heard its able to help me, but it seems like a pretty complicated tool. I've tried clicking the "scripts" tab while on pages that aren't working properly, but all I see is the source code to the page in question. Am I doing something wrong?

  2. I've done this before and been able to get duplicate sites working, just not my production site. That's the vexing (and depressing) thing.

  3. I can take another swing at this. I've done this before and never been able to narrow it down to any one module. Haven't been able to find any consistency. It's as if there's a confluence of javascript badness in the works.

Are my symptoms out of the ordinary? Have other people seen similar things?

Firebug

dwees's picture

You need to enable the console for this site. Click on console when Firebug is open, then click all the boxes there and it should reload the page, but with the console active. Next, check for JavaScript errors showing up in the console.

Ok. Here's one of the

bflora's picture

Ok. Here's one of the problems I'm having.

When I enable the jquery_update module and go to some pages (like the status page, for example) I get this error:

Fatal error: Cannot redeclare jquery_update_requirements() (previously declared in /home/windyc/sites/windycitizen.com/public/sites/all/modules/jquery_update/jquery_update.module:29) in /home/windyc/sites/windycitizen.com/public/sites/all/modules/jquery_update/jquery_update.install on line 45

I think whatever's causing that could be giving me these other headaches.

Any ideas on what this error is telling me? It sounds like it thinks there's already a jquery install somewhere?

Okay try this then.

dwees's picture

Okay try this then. Download a fresh copy of the jQuery update module. Delete the current version on your server, and extract/upload the newer version. See if the problems persist. If they do, there is obviously a problem with the current version of the jQuery module.

Hi Dwees. I've done

bflora's picture

Hi Dwees.

I've done that....no luck.

I've consulted with the subdomain module developer and his theory is that something's messing with the redirect URL stuff. Might not be JS. I dunno.

I'll keep plugging away at it.

-Brad