html editor randomly fails to load

html editor randomly fails to load

by Rob Johnson -
Number of replies: 17
I have one site where the html editor randomly fails to load. Sometimes the toolbar loads, and sometimes I get a text box. Occasionally, the site hangs for several minutes before the text box loads (no toolbar). This happens with both IE 7 and FF 2. I am running moodle 1.8.2+ on a hosted Linux server.

I have looked for empty spaces at the end of config.php, cleared the browser cache, turned off the chat module, turned on error reporting (none), and pulled out my hair.smile

The site is www.sheryhigh.org. Any help is appreciated.

Rob

Average of ratings: -
In reply to Rob Johnson

Re: html editor randomly fails to load

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In reply to Tim Hunt

Re: html editor randomly fails to load

by Jan Dierckx -

Tim,

Rob pointed out this happens on both FF2 and IE7. Does this mean it is not related to the use of innerhtml in IE? I ask because we have been experiencing what looks like the same problem since upgrading to Moodle 1.6. Someone in the Dutch Moodle had the same issue

In my opinion it is related to this other issue we started experiencing back then: sometimes Moodle is served with a missing or incomplete stylesheet.

Rob, do you also have this issue? (A Moodle page sometimes shows up with some colours / fonts / backgrounds missing)

The problem dissappeared when I manually assembled all the styles in one big .css file. I did the same with the javascript for the editor: I put everything inside a .js file. Now the HTML editor works again (but you can't access the course file area because that's where the PHP part iss needed for.) That's why I think it must somehow be related to the way Moodle uses PHP to assemble the CSS and javascript necessary for the stylesheets and the html editor.

I really want to solve this problem as it has kept us from upgrading Moodle ever since.

In reply to Jan Dierckx

Re: html editor randomly fails to load

by Rob Johnson -
Jan,
I Have seen the incomplete stylesheet problem with this same host in the past, but not in the past year, and never with this installation. If this information is of any help,
  • I am using a standard theme.
  • I am using the En_US language pack, but the same thing happens with En
  • I have no third party add-ons.
  • I have not hacked the base Moodle code in any way.
As far as Tim's reply, I have no idea what Innerhtml is or does, but it seems that IE7 is more consistent on my site than FF.sad

Thank you for the replies. Any further ideas are appreciated.

Rob
In reply to Rob Johnson

Re: html editor randomly fails to load

by Mauno Korpelainen -

Check first that left up corner logo (is it in a html block ?)

In source code

<img title="Logo" style="150px; height: 183px; 179px: " height="183" alt="Logo" hspace="0" src="http://sheryhigh.org/file.php/1/shery_logo.gif" width="150" border="0" />

In reply to Mauno Korpelainen

Re: html editor randomly fails to load

by Rob Johnson -
Yes, it is an html block. I tried removing it, but the html editor is still inconsistent with both browsers. I am curious as to why you suspect this block. This block will occasionally show the Alt text only (FF) or a broken image (IE7). I have to force a reload (FF) or clear cache (IE) to get it back. This does not happen nearly as often as the editor not displaying the toolbar.

Thanks for the help.

RJ
In reply to Rob Johnson

Re: html editor randomly fails to load

by Mauno Korpelainen -

<img title="Logo" style="150px; height: 183px; 179px: " height="183" alt="Logo" hspace="0" src="http://sheryhigh.org/file.php/1/shery_logo.gif" width="150" border="0" />

is not valid code and if you have more this kind of tags on your course pages or theme the code may simply be broken. I have seen a couple of cases where one unclosed div tag caused a huge problem. If you notice that something is for example visible in IE and not in FF the reason may be in css or sometimes in config.php or theme config.php, header.html or footer.html

In reply to Mauno Korpelainen

Re: html editor randomly fails to load

by Rob Johnson -
This is the code generated by the wysiwyg editor in Moodle. Unfortunately for me, I am not knowledgeable enough to spot something like that. Thank you for the information. I will look at the files you mention above to see if something looks amiss.
In reply to Rob Johnson

Re: html editor randomly fails to load

by Rob Johnson -
I am pretty sure that this is not a Moodle or html encoding issue. Today I installed the latest Moodle 1.9 Beta+, and I get the same behavior with the html editor. It even happened during the install (I used FF). When I needed to set the admin password during the installation, I got only a textbox where I could edit my profile description. For site desciption, the toolbar loaded. After installation, I tried to make a blog entry. Once again it was text box only. I then tried to edit the topic section on the front page. The html editor loaded just fine.

This must be a server issue.
  • omnis.com is the host
  • Gentoo
  • mysql 5.0.46
  • php 5.2.x (I get the same issue with 4.4.x)
Any thoughts?
In reply to Rob Johnson

html editor randomly fails to load. Wrong headers?

by Jan Dierckx -

Rob,

I also think it is a server issue, not conflicting html or javascript (BTW innerhtml is just a quick method some javascripts use to replace content on a webpage).

When I was having this issue, I contacted my hosting provider. They were very helpful in trying to find out what was causing the issue. It seems sometimes the javascript for the HTML editor was sent out with a wrong header. I believe they mentioned the if-modified-since header, but I am not familiar with those header response / header request issues. I got no real answers from the Moodle forums and because I eventually got it to work by pasting everything inside one big js file, I gave up. Now I do want to find out what is causing this issue, because there seem to be more people with the same issue for their Moodle.

A question for the Moodle gurus. How do we found out which headers are sent? Is this something that can be done with FF ?

Rob, could you check if disabling the cache for your browser makes the problem dissappear. I believe the web developer toolbar, a great addon for FF, let's you do by clicking Disable > Disable cache.

In reply to Jan Dierckx

Re: html editor randomly fails to load. Wrong headers?

by Rob Johnson -
Jan - I am sorry to report that disabling the cache did not help.sad The web developer toolbar has a "Show Response Headers" under the Information menu. Here is the header information for a page that loaded only a textbox.

Response Headers - http://sheryhigh.org/course/editsection.php?id=1

Date: Mon, 20 Aug 2007 19:14:16 GMT
Server: Apache/2.0.58 (Gentoo) mod_ssl/2.0.58 OpenSSL/0.9.8d FrontPage/5.0.2.2635 1.0.1
X-Powered-By: PHP/5.2.2-pl1-gentoo
Content-Language: en-us
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Accept-Ranges: none
Keep-Alive: timeout=15, max=200
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/xhtml+xml; charset=utf-8

200 OK

I hope might shed light on the problem.

Rob
In reply to Rob Johnson

Re: html editor randomly fails to load. Wrong headers

by Jan Dierckx -

That looks normal to me. Then again I can't really tell what we need to look for. When your post appeared, I was just trying to find out more information about these headers and how they influence browser cache. I have downloaded and installed another FF extension which allows you to capture the header information of every separate file that your browser downloads (stylesheets, javascripts, images, etc...) when you request a Moodle page.

But before I have you install yet another FF extension, I would like to know from someone more knowledgable how to interpret these headers. Can they show why a particular file is sometimes sent / sometimes not? What type of information do we need to look for?

Because we both think it is not related to the specific javascript used by the HTML editor, I've started a new discussion here.

I hope one of the Moodle gurus is willing to help us.

In reply to Rob Johnson

Re: html editor randomly fails to load. Wrong headers?

by Michael Penney -
Attaching your php info (yoursiteurl/admin/phpinfo.php) file might help (but please save it as a file and attach it to the post).


In reply to Rob Johnson

Re: html editor randomly fails to load. Wrong headers?

by Mauno Korpelainen -

Rob,

try to turn your current debugging from

Administration -> Server -> Debugging
->DEVELOPER

to

Administration -> Server -> Debugging
->ALL

That developer debugging at least hides html editor buttons from my moodle 1.8.2 and your site is not visible in IE7 at all.

In reply to Mauno Korpelainen

Re: html editor randomly fails to load. Wrong headers?

by Rob Johnson -
Mauno,
I have changed the debugging setting. The editor behaves the same. I too (and my boss) noticed the IE7 issue today. The site was giving and xml parsing error with www.sheryhigh.org, and worked fine with just sheryhigh.org. If I changed the wwwroot setting, the situation would reverse. Later in the afternoon, both began working without me doing anything. I would think it is problem with my webhost.

Thanks again for the time and effort.
In reply to Rob Johnson

Re: html editor randomly fails to load. Wrong headers?

by Mauno Korpelainen -

Still some guesses:

Suhosin might cause this trouble (I have not used it so I don't know what are the correct settings for it) or some other php extension.

...or it might still be config.php if you have edited it manually (not empty rows at the end but some other characters that could be at the beginning too).

You could also take a mysql dump of your database and search if there are different (old and changed) paths saved if you have changed config.php lately.

Also max_input_time in php.ini could be for example 600 instead of 60 (maximum time in seconds a script is allowed to parse input data, like POST, GET and file uploads.) My guess is that for some reason moodle fails to load some information for editor from database - either something is breaking that process or time is out...

In reply to Jan Dierckx

Re: html editor randomly fails to load

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Oops, no I did not read the initial message properly. Sorry. You are clearly having a completely different problem from the one I linked to.

Intermittent problems are really hard to diagnose. It really helps if you can pin down a way to reproduce the issue fairly reliably.

And if you can make this happen on demand, then you can try seeing if there are any error messages that would give you a clue. Try the Error console in Firefox (and maybe the firebug extension) and also the log files from the web server.

The only other thing to do is to observe things that make a difference - like your observation that putting all the CSS and JS in one file makes a difference. Sometimes observations like that and a bit of lateral thinking leads to a clue.

However, at the moment, I can't think of anything that might help you. Sorry.