Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-15626

Internet Explorer error with Expanding HTML editor

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.1, 1.9.2
    • Fix Version/s: None
    • Component/s: HTML Editor (TinyMCE)
    • Labels:
      None
    • Environment:
      Microsoft Windows XP, Internet Explorer 7
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Sometimes in IE, if you click on the "Expand Editor" button (e.g. when editing the forum introduction field), the popup will show but not load properly. The javascript error is as follows:

      Line: 538
      Char: 5
      Error: 'HTMLArea.l18N.msg' is null or not an object
      Code: 0
      URL: https://courses.mytwu.ca/lib/editor/htmlarea/popups/fullscreen.php?id=4961

      Sometimes you can get it to load properly by refreshing. When doing this, I frequently get a dialog box saying "overLIB 4.10 or later required for the CSS Style Plugin", whether it works after that or not. Other times though, even though it fully loads, once you try to highlight text, this error appears, and the editor freezes:

      Line: 1091
      Char: 13
      Error: 'HTMLArea.l18N.msg' is null or not an object
      Code: 0
      URL: https://courses.mytwu.ca/lib/editor/htmlarea/popups/fullscreen.php?id=4961

        Gliffy Diagrams

        1. fullscreen.php
          5 kB
          Dongsheng Cai
        2. MDL-15626.patch
          5 kB
          Dongsheng Cai
        1. first.PNG
          115 kB
        2. second.PNG
          121 kB

          Activity

          Hide
          nicolasconnault Nicolas Connault added a comment -

          I Cannot reproduce the bug with IE7 and the standard theme. Are you using a different browser or theme?

          Show
          nicolasconnault Nicolas Connault added a comment - I Cannot reproduce the bug with IE7 and the standard theme. Are you using a different browser or theme?
          Hide
          davidkazuhiro David Somers-Harris added a comment -

          We do use a different theme. I just tested with the standard theme, and reproduced the bug with the same results. I tested with both IE 7.0.5730.11 and IE 7.0.5730.13. I reproduced this with Moodle 1.9.1 and Moodle 1.9.2, in both themes.

          Show
          davidkazuhiro David Somers-Harris added a comment - We do use a different theme. I just tested with the standard theme, and reproduced the bug with the same results. I tested with both IE 7.0.5730.11 and IE 7.0.5730.13. I reproduced this with Moodle 1.9.1 and Moodle 1.9.2, in both themes.
          Hide
          nicolasconnault Nicolas Connault added a comment -

          Still cannot replicate. Could you please get more tests on different machines?

          Show
          nicolasconnault Nicolas Connault added a comment - Still cannot replicate. Could you please get more tests on different machines?
          Hide
          trick Alan Trick added a comment -

          (I work with David) My guess is that this might have something to with the Apache configuration on our server and IE. IE does a lot of really weird things sometimes. This wouldn't have anything to do with HTTP/HTTPS though, would it?

          Show
          trick Alan Trick added a comment - (I work with David) My guess is that this might have something to with the Apache configuration on our server and IE. IE does a lot of really weird things sometimes. This wouldn't have anything to do with HTTP/HTTPS though, would it?
          Hide
          pgrzesina Paul Grzesina added a comment -

          I just did a test on my server and the full screen mode works in HTTP but not in HTTPS. (I'm testing using IE6 though, so it might be different in IE7.)

          Show
          pgrzesina Paul Grzesina added a comment - I just did a test on my server and the full screen mode works in HTTP but not in HTTPS. (I'm testing using IE6 though, so it might be different in IE7.)
          Hide
          shaunprice Shaun Price added a comment -

          Have the same problem when trying to use fullscreeen editor when the site is HTTPS

          Changed the following code within /lib/editor/htmlarea/popups/fullscreen.php

          // load same scripts that were present in the opener page
          var scripts = opener.document.getElementsByTagName("script");
          var head = document.getElementsByTagName("head")[0];
          for (var i = 0; i < scripts.length; ++i) {
          var script = scripts[i];
          if (typeof script.src != "undefined" && /\S/.test(script.src)) {
          // document.write("<scr" + "ipt type=" + "\"script/javascript\"");
          // document.write(" src=\"../" + script.src + "\"></scr" + "ipt>");
          var new_script = document.createElement("script");
          //if (/^https?:/i.test(script.src))

          { //new_script.src = script.src; //}

          else

          { new_script.src = "../" + script.src; //}

          head.appendChild(new_script);
          }
          }

          Seems the fault is with the test if its HTTPS

          Works now and also works using HTTP as well

          Show
          shaunprice Shaun Price added a comment - Have the same problem when trying to use fullscreeen editor when the site is HTTPS Changed the following code within /lib/editor/htmlarea/popups/fullscreen.php // load same scripts that were present in the opener page var scripts = opener.document.getElementsByTagName("script"); var head = document.getElementsByTagName("head") [0] ; for (var i = 0; i < scripts.length; ++i) { var script = scripts [i] ; if (typeof script.src != "undefined" && /\S/.test(script.src)) { // document.write("<scr" + "ipt type=" + "\"script/javascript\""); // document.write(" src=\"../" + script.src + "\"></scr" + "ipt>"); var new_script = document.createElement("script"); //if (/^https?:/i.test(script.src)) { //new_script.src = script.src; //} else { new_script.src = "../" + script.src; //} head.appendChild(new_script); } } Seems the fault is with the test if its HTTPS Works now and also works using HTTP as well
          Hide
          pgrzesina Paul Grzesina added a comment -

          After I made that change I discovered that the apache error log had a bunch of errors relating to the popups/fullscreen.php. Strangely adding a call to a non-existent function at the end of the for loop also seemed to fix the problem for me and eventually I was able to determine that there was some sort of race condition between the scripts that are in the head and what happens in the function init(). Wrapping everything in init upto the existing setTimeout in another setTimeout cleared up that problem. That left me with an IE7 complaint about I18N which I was able to resolve by inserting the following just prior to the load same scripts script:

          <script type="text/javascript" src="<?php print $CFG->wwwroot."/lib/overlib.js" ?>" charset="utf-8"></script>

          Show
          pgrzesina Paul Grzesina added a comment - After I made that change I discovered that the apache error log had a bunch of errors relating to the popups/fullscreen.php. Strangely adding a call to a non-existent function at the end of the for loop also seemed to fix the problem for me and eventually I was able to determine that there was some sort of race condition between the scripts that are in the head and what happens in the function init(). Wrapping everything in init upto the existing setTimeout in another setTimeout cleared up that problem. That left me with an IE7 complaint about I18N which I was able to resolve by inserting the following just prior to the load same scripts script: <script type="text/javascript" src="<?php print $CFG->wwwroot."/lib/overlib.js" ?>" charset="utf-8"></script>
          Hide
          jrily Sharon Goodson added a comment -

          I just discovered this same problem with 1.9.3, but only on one of our two hosted servers.

          The problem occurs on my new site (hosted by a MP) when using IE7 or Maxthon browser, but the problem does not and has never occurred on my original site (now my test site), on a different hosted server.

          Both sites are being accessed from the same computer, using the same browser, running the same Moodle version, and both sites have the same modules, themes, etc. Editor enlarges fine on both sites when using Fire fox.

          The only difference I can find between the two sites in regards to the editor, is that the test site does not have aspell installed, and the new site does. Disabling spell check on the new site did not have an effect, though.

          Show
          jrily Sharon Goodson added a comment - I just discovered this same problem with 1.9.3, but only on one of our two hosted servers. The problem occurs on my new site (hosted by a MP) when using IE7 or Maxthon browser, but the problem does not and has never occurred on my original site (now my test site), on a different hosted server. Both sites are being accessed from the same computer, using the same browser, running the same Moodle version, and both sites have the same modules, themes, etc. Editor enlarges fine on both sites when using Fire fox. The only difference I can find between the two sites in regards to the editor, is that the test site does not have aspell installed, and the new site does. Disabling spell check on the new site did not have an effect, though.
          Hide
          jrily Sharon Goodson added a comment -

          Just curious - do any of the Moodle installs doing this have asciimathML.js installed as a filter?

          Show
          jrily Sharon Goodson added a comment - Just curious - do any of the Moodle installs doing this have asciimathML.js installed as a filter?
          Hide
          davidkazuhiro David Somers-Harris added a comment -

          I submitted this ticket, and don't have any filters enabled.

          Show
          davidkazuhiro David Somers-Harris added a comment - I submitted this ticket, and don't have any filters enabled.
          Hide
          dongsheng Dongsheng Cai added a comment -

          I removed script inserting code block, it worked on ie/firefox under http and https.
          Please try this patch

          Show
          dongsheng Dongsheng Cai added a comment - I removed script inserting code block, it worked on ie/firefox under http and https. Please try this patch
          Hide
          dongsheng Dongsheng Cai added a comment -

          Patched file against 1.9

          Show
          dongsheng Dongsheng Cai added a comment - Patched file against 1.9
          Hide
          dongsheng Dongsheng Cai added a comment -

          any comments about this patch?

          Show
          dongsheng Dongsheng Cai added a comment - any comments about this patch?
          Hide
          jonwitts Jon Witts added a comment -

          I just upgraded to version 1.9.5 last night and we are now seeing this problem in IE 7.0.5730.11 and IE 8.0..6001.18702. It does not appear with Firefox 3.0.10. I have tried clearing the cache on both IE browsers which does not help.

          There is an error reported in IE:

          Line: 1130
          Char: 13
          Error: 'HTMLArea.l18N.msg' is null or not an object
          Code: 0
          URL: http://<server-name>/lib/editor/htmlarea/popups/fullscreen.php?id=312

          Show
          jonwitts Jon Witts added a comment - I just upgraded to version 1.9.5 last night and we are now seeing this problem in IE 7.0.5730.11 and IE 8.0..6001.18702. It does not appear with Firefox 3.0.10. I have tried clearing the cache on both IE browsers which does not help. There is an error reported in IE: Line: 1130 Char: 13 Error: 'HTMLArea.l18N.msg' is null or not an object Code: 0 URL: http://<server-name>/lib/editor/htmlarea/popups/fullscreen.php?id=312
          Hide
          paolooprandi Paolo Oprandi added a comment -

          So far so good on the fix - why isn't it in core (I am using 1.95)

          Show
          paolooprandi Paolo Oprandi added a comment - So far so good on the fix - why isn't it in core (I am using 1.95)
          Hide
          dongsheng Dongsheng Cai added a comment -

          committed, thanks everyone

          Show
          dongsheng Dongsheng Cai added a comment - committed, thanks everyone

            People

            • Votes:
              12 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: