Resource frameset error in IE6 (Moodle 1.6.1+)

Resource frameset error in IE6 (Moodle 1.6.1+)

by Chris Fryer -
Number of replies: 6
When I try to view an HTML resource in a frameset using Internet Explorer 6 (XPSP2), I get a blank page.  Oddly, refreshing the page (F5) brings it up correctly.  It looks like an old bug has resurfaced: Bug 5684 , this time in moodle/resource/type/file/resource.class.php around line 358.  The charset is declared before the title, as per the bug fix, but Internet Explorer still has problems rendering the frameset.  The only solution I've found is to add UTF8 as the default charset for the entire Moodle directory in httpd.conf:

http://httpd.apache.org/docs/2.0/mod/core.html#adddefaultcharset

but this obviously won't work for users that don't have access to the Apache configuration, or AllowOverride to let them use .htaccess

Is this an IE bug or a moodle one, and if the latter, should I add this to the Bug Tracker?
Average of ratings: -
In reply to Chris Fryer

Re: Resource frameset error in IE6 (Moodle 1.6.1+)

by José Neif Jury Fabre -
This is exactly what happens to me.

It happens in moodle 1.6.1 and 1.6.1+

However using .htaccess is not working for me.

Maybe my hosting company don't allow overriding their apache configuration with the .htaccess

Is there another possibe fix?

I'll try to find something and post it here, but if somebody has it allready I'll be happy to use his or her fix.

Thanks!

Thank you Chris for the light provided in your post.
In reply to José Neif Jury Fabre

Re: Resource frameset error in IE6 (Moodle 1.6.1+)

by Chris Fryer -
I've tried another fix, and this seems to work.  I'm not sure it's ideal as it involves sending a header, but it's a workaround.  In /moodle/mod/resource/type/file/resource.class.php around line 349, you should see this code:

    /// Now check whether we need to display a frameset

    $frameset = optional_param( 'frameset','' );
    if (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame")) {
        $encoding = current_charset();

Immediately after this line, add the following:

        header('Content-Type: text/html; charset=' . $encoding);

I've tested this, and it works even for content where the file in the frame is not HTML (e.g. a Word document, a PDF).  My understanding is that the "Content-Type: text/html" is only applied to the frameset.

Hope this helps.  If it does, I'll file a bug and suggest this as the fix.

Chris
In reply to Chris Fryer

Re: Resource frameset error in IE6 (Moodle 1.6.1+)

by José Neif Jury Fabre -
Thank You Very Much Chris.

I did the modification to /moodle/mod/resource/type/file/resource.class.php and I'm going to test it.

I can tell you that I'm having problems with the inline frames in the IMS resource type.

The modification you sent cannot be applied to the /moodle/mod/resource/type/ims/resource.class.php code, it seems to me very different than the file type resource code.

I'll be testing your modification and I will provide feedback to you as soon as possible.

Regards
In reply to José Neif Jury Fabre

Re: Resource frameset error in IE6 (Moodle 1.6.1+)

by Chris Fryer -
How did that header call work out for you?

Chris
In reply to Chris Fryer

Re: Resource frameset error in IE6 (Moodle 1.6.1+)

by Wen Hao Chuang -
Hi, Chris and all, we ran into some problem integrating our course streaming site with Moodle too, and I'm not sure whether this problem is related to what you have described here.

Basically, our instructor added a resource (Link to a file or web site) on his moodle course to his live video streaming site (http://coursestream.sfsu.edu/push/live/index.jsp?module=BIOL033002_090106), however, if he selected "Same window" and have the "Put resource in a frame to keep site navigation visible" checked, it won't work.. Moodle (1.5.2+) will just give him a error message (see attached screenshot), but if he select to have a pop-up New window, or uncheck the "Put resource in a frame to keep site navigation visible", then everything works just fine. Any idea why is that? Thanks!
Attachment please_wait_for_lecture.png
In reply to Wen Hao Chuang

Re: Resource frameset error in IE6 (Moodle 1.6.1+)

by Chris Fryer -
It seems to be a JavaScript error related to how you're addressing frames.  The video lecture tries to load something in to a frame called "video_frame", but this doesn't exist in the Moodle frameset.  If you really want to keep the navigation visible, I think you'll need to ask your developers to change the JavaScript in /push/live/index.jsp to load content into "parent.video_frame.location", rather than "top.video_frame.location".

Hope this helps.

Chris