Hello,

I have just installed Drupal 5.0. However, I always receive this error at the bottom left of my browser.

Can anyone tell me what this error means?

Line: 3
Char: 1
Error: 'Drupal' is undefined.
Code: 0
URL: http://dgflow.com/user/1 or any other page.

Thank you.

Comments

sjcctan’s picture

Hello,

I knew the problem. It is caused by the TinyMCE module that I have installed.

I have installed both IMCE & TinyMCE. But TinyMCE is not running. Is there anything I have overlooked?

Thank you.

Sean Buscay’s picture

What browser are you using? IE6 or IE7, or Firefox?

I had fckeditor working for Firefox, but had a problem in IE 7. I refreshed my IE 7 a few times, and got the jscript to load, then the error went away.

Given that IMCE is also a jscript power wysiwyg it may be a similar issue.

Using Firefox. you can view your js debug console to check for js errors.

If you don't get it solved, you can give me the url and I will take a look.

Sean Buscay
www.christian-web-masters.com
www.antiochian.org

sjcctan’s picture

You are right. When I use IE 6.0. I have the above error.

But when I use FireFox. There is no such error. So why is it IE 6.0 is giving such error?

BTW, my TinyMCE is working fine now. Thanks to tela who pointed out my mistake.

Thank you.

sjcctan’s picture

// $Id: imce_set_tinymce.js,v 1.1.2.2 2006/11/18 01:38:44 ufku Exp $
if (Drupal.jsEnabled) {
$(window).load(imceInitiateTinyMCE);
}
function imceInitiateTinyMCE() {
if ("undefined" != typeof(window.tinyMCE)) {
for (var i=0; i tinyMCE.configs[i]['file_browser_callback'] = 'imceImageBrowser';
}
}
}

Dear Sean Buscay,

The error is on the line 2. It states 'Drupal' is undefined. May I know is there anyway to overcome the problem? The codes are from imce_set_tinymce.js.

Thank you.

sjcctan’s picture

Dear Sean Buscay,

The error is on line 2. It states 'Drupal' is undefined. May I know is there anyway to overcome the problem? The codes are from imce_set_tinymce.js.

Thank you.

sjcctan’s picture

Hello,

Anyone has any idea on the above error? TinyMCE is running. But it keeps on giving the above error message when I login.

Thank you.

Andreas Wolf’s picture

Hi,

check if the HTML source of your page has a line similar to:

This is the file where Drupal.jsEnabled is defined.

If there is no such line it is likely that there is something wrong with one of your modules, because as of version 5.0, Drupal's built-in methods for implementing Javascript have changed a bit: http://drupal.org/node/83181

Did you upgrade your modules to version 5.0 too ? Btw due to a security issue it's highly advisible to upgrade to Drupal 5.1 (http://drupal.org/drupal-5.1)

You could add the above line to your page template, to get rid of this error, but I would try to track down the module who causes the error, because it's likely that other functions of this module won't work properly too.

Search your HTML output for other included Javascript files. Some modules e.g. img_assist add lines like:

This could be a hint which module causes the error.

I've checked the link you'd provided in your original post, but the mentioned error was not reproducible for me.

There is another post related to your problem, maybe it could help you too:

http://drupal.org/node/111596#comment-192171

sjcctan’s picture

Hello,

The error message appears only when I login as administrator.

Line: 3
Char: 1
Error: 'Drupal' is undefined
Code: 0
URL: http://www.dgflow.com

I have checked the link http://drupal.org/node/111596#comment-192171
& did what have been suggested. But the problem persist.

Anyone any idea?

Thank you.

Andreas Wolf’s picture

Ups, sorry. I forgot some html tags in my post, so the important line to check for was missing. The text should have been someting like:

check if the HTML source of your page has a line similar to:
<script type="text/javascript" src="/misc/drupal.js"></script>
This is the file where Drupal.jsEnabled is defined.

and

Search your HTML output for other included Javascript files. Some modules e.g. img_assist add lines like:
<script type="text/javascript" src="/modules/img_assist/img_assist.js"></script>
This could be a hint which module causes the error.

----

Have you tried to add:
<script type="text/javascript" src="/misc/drupal.js"></script>
to your page template manually ?

This is not the proper way to handle this, since the module which is in need of drupal.js should take care of this, as far as I know, but if everything else works as intended and you could not track down the problem, this may be a solution for you.

thenhan007’s picture

drupal.js is added at page.tpl.php


...
print $scripts

avpaderno’s picture

@Andreas Wolf: The comment you wrote misses some lines.
I.e., when you write check if the HTML source of your page has a line similar to:, the line below that is This is the file where Drupal.jsEnabled is defined..

If you added a line which starts with <script, that line has been removed from the filter used to render the comment; <script> is not listed between the HTML tags allowed in a comment.
If you want to make a line like <script type="text/javascript" src="/misc/jquery.js"></script> appear, you have to surround it with <code> tags.

-- Kiam
Kiam la luno renkontas la sunon