Moodle

itestwin.html is a missing file

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.8.1
  • Fix Version/s: 2.0
  • Component/s: General
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

itestwin.html is missing. The javascript in javascript-static.js calls it.

  1. javascript-static.patch
    07/Dec/09 10:43 AM
    0.7 kB
    Andrew Davis
  2. view.patch
    07/Dec/09 10:43 AM
    0.8 kB
    Andrew Davis

Activity

Hide
Tim Hunt added a comment -

The file is not meant to exist. The test is whether we can open pop-up windows. It does not matter that what you get in the test popup window is a 404 error page.

Show
Tim Hunt added a comment - The file is not meant to exist. The test is whether we can open pop-up windows. It does not matter that what you get in the test popup window is a 404 error page.
Hide
Alan Trick added a comment -

This is a bug. A 404 should not be used for something that is a normal operation.

404 pages are annoying. They fill up server logs and such. If the content is not important, then an empty file named iwintest.html would suffice.

Show
Alan Trick added a comment - This is a bug. A 404 should not be used for something that is a normal operation. 404 pages are annoying. They fill up server logs and such. If the content is not important, then an empty file named iwintest.html would suffice.
Hide
Tim Hunt added a comment -

OK, so it probably is a bug. But I can't immediately thing of a replacement for itestwin.html that is guaranteed not to give a 404. We are in a .js file, so we can't access $CFG->wwwroot, and this JS could be being included from any php file, we don't know where we are relative to any fixed point.

Anyway, this bug is not quiz specific, and since I don't have any ideas, I am reassigning it.

Show
Tim Hunt added a comment - OK, so it probably is a bug. But I can't immediately thing of a replacement for itestwin.html that is guaranteed not to give a 404. We are in a .js file, so we can't access $CFG->wwwroot, and this JS could be being included from any php file, we don't know where we are relative to any fixed point. Anyway, this bug is not quiz specific, and since I don't have any ideas, I am reassigning it.
Hide
Alan Trick added a comment -

What about if moodle includes a standard php generated javascript file which looks something like this:

CFG = {
<?php
foreach ($CFG as $k->$v) {
// make sure you escape stuff properly and figure out how to handle non-string values
echo "$k: '$v',\n";
}
?>
}

Then in your javascript file you can just use CFG.wwwroot.

Show
Alan Trick added a comment - What about if moodle includes a standard php generated javascript file which looks something like this: CFG = { <?php foreach ($CFG as $k->$v) { // make sure you escape stuff properly and figure out how to handle non-string values echo "$k: '$v',\n"; } ?> } Then in your javascript file you can just use CFG.wwwroot.
Hide
Andrew Walker added a comment -

Would there be any problem with using about:blank instead of itestwin.html?

Show
Andrew Walker added a comment - Would there be any problem with using about:blank instead of itestwin.html?
Hide
Ryan Smith added a comment -

Any update on this? Still getting tons of 404s filling up my Apache error log.

Show
Ryan Smith added a comment - Any update on this? Still getting tons of 404s filling up my Apache error log.
Hide
Serge LAOT added a comment -

In function popupchecker (line 3) of javascript-static.js just change the line :

var testwindow = window.open('itestwin.html', '', 'width=1,height=1,left=0,top=0,scrollbars=no');

by

var testwindow = window.open('', '', 'width=1,height=1,left=0,top=0,scrollbars=no');

Since there is no target page in the open method, the browser uses a blank page.

The server receives no request and so log no error.

Show
Serge LAOT added a comment - In function popupchecker (line 3) of javascript-static.js just change the line : var testwindow = window.open('itestwin.html', '', 'width=1,height=1,left=0,top=0,scrollbars=no'); by var testwindow = window.open('', '', 'width=1,height=1,left=0,top=0,scrollbars=no'); Since there is no target page in the open method, the browser uses a blank page. The server receives no request and so log no error.
Hide
mirek added a comment -

i agree with serge laot.

another solution could be to import index.html from the same directory, which is empty file.

anyway guys - fix it. bug is open over one year and solution is not so hard...

Show
mirek added a comment - i agree with serge laot. another solution could be to import index.html from the same directory, which is empty file. anyway guys - fix it. bug is open over one year and solution is not so hard...
Hide
Martin Dougiamas added a comment -

has anyone else tested Serge's solution? Have you tried different browsers?

If I get some confirmation it works then I'll happily check it in, we just have no time to do the testing right now.

Show
Martin Dougiamas added a comment - has anyone else tested Serge's solution? Have you tried different browsers? If I get some confirmation it works then I'll happily check it in, we just have no time to do the testing right now.
Hide
Brant Wells added a comment -

I have tested it with Firefox / Linux and Internet Explorer / Windows and Safari / Mac OS X and everything appears to function as it should.

~Brant

Show
Brant Wells added a comment - I have tested it with Firefox / Linux and Internet Explorer / Windows and Safari / Mac OS X and everything appears to function as it should. ~Brant
Hide
Sharon Goodson added a comment -

Serge's solution works for me in Mozilla 3.0.5, IE8 and Maxthon 1.3.3!

IE pops up a small blank page that wants to hang around a few minutes, but IE8 is obligated to be 'special.'

Show
Sharon Goodson added a comment - Serge's solution works for me in Mozilla 3.0.5, IE8 and Maxthon 1.3.3! IE pops up a small blank page that wants to hang around a few minutes, but IE8 is obligated to be 'special.'
Hide
Jason Goette added a comment -

I still have the apache error File does not exist: C:/**/quiz/itestwin.html. I removed itestwin from the .js file as Serge suggested and still get the error. Is there any other place than the .js file that the itestwin.html is called out?

Show
Jason Goette added a comment - I still have the apache error File does not exist: C:/**/quiz/itestwin.html. I removed itestwin from the .js file as Serge suggested and still get the error. Is there any other place than the .js file that the itestwin.html is called out?
Hide
Petr Škoda (skodak) added a comment -

we have lived very long time with this, please try to fix only in HEAD - we do not need any major regressions in STABLE (sorry)

Show
Petr Škoda (skodak) added a comment - we have lived very long time with this, please try to fix only in HEAD - we do not need any major regressions in STABLE (sorry)
Hide
Andrew Davis added a comment - - edited

I've attached patches for /lib/javascript-static.js and /mod/quiz/view.php in trunk. I used the fix suggested by Serge LAOT

Tested it in firefox 3.5.5. It now correctly detects whether or not I have a popup blocker active without adding anything to apache's error log.

I also made some changes to view.php. In 1.9 the page's onload javascript was constructed in a string then fed into the page object. In 2 it appears the onload string was being constructed but then never used. I've added code that should have the desired effect.

Awaiting a review of these patches before committing to trunk.

Show
Andrew Davis added a comment - - edited I've attached patches for /lib/javascript-static.js and /mod/quiz/view.php in trunk. I used the fix suggested by Serge LAOT Tested it in firefox 3.5.5. It now correctly detects whether or not I have a popup blocker active without adding anything to apache's error log. I also made some changes to view.php. In 1.9 the page's onload javascript was constructed in a string then fed into the page object. In 2 it appears the onload string was being constructed but then never used. I've added code that should have the desired effect. Awaiting a review of these patches before committing to trunk.
Hide
Andrew Davis added a comment -

Tim Hunt had a look at this. As per his advice I'll test this fix in IE and Safari before committing.

Show
Andrew Davis added a comment - Tim Hunt had a look at this. As per his advice I'll test this fix in IE and Safari before committing.
Hide
Andrew Davis added a comment -

I have tested this in IE 8, firefox 3.5.5 and safari 4.0.4. They all look fine so I have committed this to trunk.

I also tested this in google chrome and found a problem there that occurs with or without this bug fix. I've opened a separate item (MDL-21085).

Show
Andrew Davis added a comment - I have tested this in IE 8, firefox 3.5.5 and safari 4.0.4. They all look fine so I have committed this to trunk. I also tested this in google chrome and found a problem there that occurs with or without this bug fix. I've opened a separate item (MDL-21085).
Hide
Ryan Smith added a comment -

Is there any chance that this will get backported to Moodle 1.9.x? Our Apache error log is filled with 404s for this error.

Show
Ryan Smith added a comment - Is there any chance that this will get backported to Moodle 1.9.x? Our Apache error log is filled with 404s for this error.

Dates

  • Created:
    Updated:
    Resolved: