Hi,
I am getting these javascript errors on a drupal site - Drupal.behaviors is undefined - what is causing this and where do I start to debug?
Thanks in advance
Hi,
I am getting these javascript errors on a drupal site - Drupal.behaviors is undefined - what is causing this and where do I start to debug?
Thanks in advance
Comments
Comment #1
alexfisher commentedSame issue here. I've got all non-core modules disabled and it will go away. I enable various modules one at a time that use Drupal.behaviors or Drupal.settings and the problem exhibits itself. For example, the Administrator Menu or Google Analytics module will prompt these errors.
Comment #2
alexfisher commentedBTW, running Drupal 6.14. Just upgraded from 5.20.
Sometimes, /misc/tableheader.js causes the same 'Drupal.behaviors' is null or not an object error (line 9) without non-core modules enabled.
Comment #3
alexfisher commentedAlright, this seems to have been caused by /misc/drupal.js. It's in core so I have no idea how it got edited, but I found the first line of code in the file was:
var Drupal = Drupal || {};
instead of:
var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
What I don't understand is how the file was changed as I've never edited any core files and this was a fresh download of 6.14 just a few days ago. Not sure if the jQuery Update module makes any changes to core or what. Will let you guys know if I find-out what caused this in case someone else is having the same issue.
Comment #4
alexfisher commentedAlright, after further analysis, I'm ashamed to admit the piece of code above appears in drupal.js from D5. It looks to me like some of the D5 files were left-over or over-wrote files on the upgraded site.
Stupid mistake/sloppy. Hope the hair I pulled out this weekend grows back.
Comment #5
gbaudoin commented