HTMLarea is undefined?

HTMLarea is undefined?

by Cypercat Saint -
Number of replies: 11

Just started getting this error on my pages. I have read through most if not all messages here and don't see a solution. Please help! Thanks

Error: HTMLArea is not defined
Source File: http://www.ooo.org/Teacher/course/mod.php?update=201&sesskey=PjUoxOoa3B
Line: 168

Teachers can not see toolbar and only html code is showing up when they turn on the editor.

<p align="center"><font color="#000099"><font face="georgia,times new roman,times,serif" size="5"><em>We enter to learn...we leave to achieve</em></font></font></p><p align="center"><img height="49" alt="books" hspace="0" src="http://www.ooo.org/Teacher/file.php?file=/1/books.JPG" width="374" border="0" /></p>

The emails have started coming in........need a fix for this. I have been using the version of 1.43+ for the past several months. No major changes to site...was working fine this past weekend. This is happening in both explorer and firefox. Same error for both.

The only strange thing that I see and don't know how to fix or if it needs fixing is when I click on admin/configuration I see this      configvariables

Average of ratings: -
In reply to Cypercat Saint

Re: HTMLarea is undefined?

by Janne Mikkonen -
Has there been any changes in your site configuration? Is debug mode off? If you look at the page source can you confirm that these four files are loaded:
htmlarea.php
dialog.js
en.php
popupwin.js
 

And can you find config part somewhere at the bottom of the page source like:

var config = new HTMLArea.Config
....
....
....

- Janne -

In reply to Janne Mikkonen

Re: HTMLarea is undefined?

by Cypercat Saint -
 This is what the source code has:
</td></tr></table><script language="javascript" type="text/javascript" defer="1">
var config = new HTMLArea.Config();
config.pageStyle = "body { background-color: #ffffff; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px; }";
config.killWordOnPaste = true;
config.fontname = {
"Arial":	'arial,helvetica,sans-serif',
"Courier New":	'courier new,courier,monospace',
"Georgia":	'georgia,times new roman,times,serif',
"Tahoma":	'tahoma,arial,helvetica,sans-serif',
"Times New Roman":	'times new roman,times,serif',
"Verdana":	'verdana,arial,helvetica,sans-serif',
"Impact":	'impact',
"Wingdings":	'wingdings'};
HTMLArea.replaceAll(config);
</script>
There has been no major site changes. This feature was working fine on Sunday night. 
In reply to Cypercat Saint

Re: HTMLarea is undefined?

by Dan Clarke -

We had a very similiar problem when ITS started 'updating' computers college-wide with Office 2003. They essentially re-imaged all the computers, and suddenly this problem popped up. I tracked the problem down to htmlarea.php, and found the problem was the presence of strings / regular expressions not being enclosed in speech marks.

The problem is, I don't have enough experience with regular expressions in general, let alone REs in Javascript. I've basically wrapped everything I could in speech marks, and commented out parts that used them in an if statement:

if (/separator|space/.test(line[j + 1])) {
    len = 2;
}

As far as I can tell, all but the aforementioned statement are for Mozilla-specific checks. This won't be an issue for us (all internal PCs apart from dev PCs are running IE only) but it will most likely present an issue to other people - especially universities. I haven't found any bugs as a result of the change, but it hasn't been fully tested yet.

I've attached the updated PHP file if anyone is having similiar problems. Would appreciate anyone more experienced with JS REs to help out smile

In reply to Dan Clarke

Re: HTMLarea is undefined?

by Dan Clarke -

OK its still not working...

Not sure how to fix this anymore tbh. It seems the DOM isn't working either which is a very bad thing. Is this a fairly common IE bug with a solution / workaround?

These same installations had a fit over the Array.push() function too, don't have a clue why that would occur either.

In reply to Dan Clarke

Re: HTMLarea is undefined?

by Stuart Douglas -
No offense, but I'm glad this is happening to at least one other person...I was beginning to think I was the only one cursed by the HTMLarea undefined problem with IE.

This first appeared for me sometime while I was running either 1.5.1 or 1.5.2, and at that time, upgrading the site fixed the problem.  Of course it's occuring again, and I'm on the most recent version (1.5.2+), so I can't upgrade to fix this.

If only we could convert the world off of IE...
In reply to Cypercat Saint

Re: HTMLarea is undefined?

by Michael Tanczos -
For what it's worth, I'm experiencing the same exact problem.  Just adding my name to the pile..

---
Michael Tanczos

In reply to Cypercat Saint

Re: HTMLarea is undefined?

by Pedro Benites -
I have the same problem...........
In reply to Pedro Benites

Re: HTMLarea is undefined?

by Pedro Benites -
replace the file htmlarea.php in  <root to moodle>/lib/editor/
I download the file of: http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/lib/editor/htmlarea.php?rev=1.65&view=log

That's all.
In reply to Pedro Benites

Re: HTMLarea is undefined?

by Torbjorn Bergsdal -

Thank you for your help with this file. It helped our problem with the html editor. It didn´t load when creating or editing courses. Same problem in Explorer, Firefox and Opera. After replacing the htmlarea.php file you enclosed, it now appears as if the problem is solved.

In reply to Pedro Benites

Re: HTMLarea is undefined?

by Kam Weng Chai -

Hi there,

I try to download the file but failed. Can you provide the link again?

Thank you.

Wings