Moodle

IE can't open powerpoint resource file type.

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not a bug
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Resource
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

When we click on the following powerpoint file resouce, a blank page will be displayed.
1. Resource type: ppt (Powerpoint file)
2. Window: new window

To prevent this blank page, we can modify mod/resource/type/file/resource.class.php as below.

Index: resource.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/resource/type/file/resource.class.php,v
retrieving revision 1.68
diff -u -r1.68 resource.class.php
— resource.class.php 19 Jul 2007 05:51:33 -0000 1.68
+++ resource.class.php 19 Jul 2007 22:51:38 -0000
@@ -605,6 +605,9 @@
echo '</div>';
echo "<div class=\"popupnotice\">(<a href=\"$fullurl\">$fullurl</a>)</div>";
}
+ if ($mimetype == "application/vnd.ms-powerpoint") { + $fullurl = $fullurl . "?forcedownload=1"; + }
redirect($fullurl);
}

  1. 0001-filelib-Work-around-IE-Powerpoint2007-download-bug.patch
    27/Feb/08 8:39 AM
    2 kB
    Martín Langhoff
  2. 0001-filelib-Work-around-IE-Powerpoint2007-download-bug.patch
    26/Feb/08 8:46 AM
    2 kB
    Martín Langhoff
  3. resource.class.php.patch
    20/Jul/07 6:59 AM
    0.7 kB
    Mitsuhiro Yoshida
  4. revision53.diff
    05/Feb/08 1:58 AM
    3 kB
    Daniel Pouliot

Issue Links

Activity

Hide
A. T. Wyatt added a comment -

This problem also affects 1.8! It was of huge concern to us, because we have a large number of powerpoint files in the system and many users who only use IE7.

This fix saved us, so thanks for posting! I hope this is adopted in core soon, and also provided for 1.8.2.

Show
A. T. Wyatt added a comment - This problem also affects 1.8! It was of huge concern to us, because we have a large number of powerpoint files in the system and many users who only use IE7. This fix saved us, so thanks for posting! I hope this is adopted in core soon, and also provided for 1.8.2.
Hide
Rob Faulkner added a comment -

Any ideas as to why this has not yet been comitted to core on the 1.8 branch? Still have this problem on 1.8.3, which is solved by the patch above.

Show
Rob Faulkner added a comment - Any ideas as to why this has not yet been comitted to core on the 1.8 branch? Still have this problem on 1.8.3, which is solved by the patch above.
Hide
Petr Škoda (skodak) added a comment -

I do not think this is a proper solution, unfortunately I do not have either MS Windows or MS Office on my computers anymore, sorry.
Assigning to Nicolas.

Show
Petr Škoda (skodak) added a comment - I do not think this is a proper solution, unfortunately I do not have either MS Windows or MS Office on my computers anymore, sorry. Assigning to Nicolas.
Hide
Kristian Thornley added a comment -

looks like this fixes it for power points opening in a new window only. same window powerpoint resources open in powerpoint but show only one blank slide.

We are currently advising teachers to use power point shows pps or ppsx as these have the added advantage of not needing powerpoint. But as a quick fix I edited mod/resource/type/file/resource.class.php to add at line 257

else if ($mimetype == "application/vnd.ms-powerpoint") { $resource->popup = 'resizable=1,scrollbars=1,directories=1,location=1,menubar=1,toolbar=1,status=1,height=450,width=620'; $inpopup = true; }

This forces all power points to open in a new window. Sorry cant do diff

Show
Kristian Thornley added a comment - looks like this fixes it for power points opening in a new window only. same window powerpoint resources open in powerpoint but show only one blank slide. We are currently advising teachers to use power point shows pps or ppsx as these have the added advantage of not needing powerpoint. But as a quick fix I edited mod/resource/type/file/resource.class.php to add at line 257 else if ($mimetype == "application/vnd.ms-powerpoint") { $resource->popup = 'resizable=1,scrollbars=1,directories=1,location=1,menubar=1,toolbar=1,status=1,height=450,width=620'; $inpopup = true; } This forces all power points to open in a new window. Sorry cant do diff
Hide
Nicolas Connault added a comment -

I don't have MS Office either, and unless it is offered to me (highly unlikely), I will never have it. Unless someone is opposed to it, I will implement the proposed fix to satisfy all the users who depend on MS Office.

Show
Nicolas Connault added a comment - I don't have MS Office either, and unless it is offered to me (highly unlikely), I will never have it. Unless someone is opposed to it, I will implement the proposed fix to satisfy all the users who depend on MS Office.
Hide
Petr Škoda (skodak) added a comment -

Oki, I finally have office licenses again, goint to work on this next week

Show
Petr Škoda (skodak) added a comment - Oki, I finally have office licenses again, goint to work on this next week
Hide
Daniel Pouliot added a comment -

We found and resolve this problem on 1.6.5. We migrating to 1.8 and found that the bug still there so we patched again.

With a sniffer I founded that PowerPoint try to open the file with a new socket has suggest Juan Segarra Montesinos on MDL-12308.

Our solution is a little different but still to force download. We have tested lately on Vista and Office 07 and found that it works whit out the patch but take to much time to display. The sniffer show us that it try to open and get file status before having no choice but to use the file get by the browser kept in cache.

Here our solution, hope it help.

    • See file attachment **
Show
Daniel Pouliot added a comment - We found and resolve this problem on 1.6.5. We migrating to 1.8 and found that the bug still there so we patched again. With a sniffer I founded that PowerPoint try to open the file with a new socket has suggest Juan Segarra Montesinos on MDL-12308. Our solution is a little different but still to force download. We have tested lately on Vista and Office 07 and found that it works whit out the patch but take to much time to display. The sniffer show us that it try to open and get file status before having no choice but to use the file get by the browser kept in cache. Here our solution, hope it help.
    • See file attachment **
Hide
Daniel Pouliot added a comment -

Patch for lib/filelib.php

Show
Daniel Pouliot added a comment - Patch for lib/filelib.php
Hide
Petr Škoda (skodak) added a comment -

I did extensive testing on several computers running XP, Vista + Office 2003 and 2007. I could replicate the problem only on systems with Office 2007 without service pack. After installing SP1 for 2007, everything works fine again.

this is not our bug, I suppose the problem involved is: http://support.microsoft.com/kb/935869

Show
Petr Škoda (skodak) added a comment - I did extensive testing on several computers running XP, Vista + Office 2003 and 2007. I could replicate the problem only on systems with Office 2007 without service pack. After installing SP1 for 2007, everything works fine again. this is not our bug, I suppose the problem involved is: http://support.microsoft.com/kb/935869
Hide
Petr Škoda (skodak) added a comment -

thanks for the report anyway!

Show
Petr Škoda (skodak) added a comment - thanks for the report anyway!
Hide
Martín Langhoff added a comment -

I do think it is possible and worthwhile to try to workaround this issue based on the client string. Trying to come up with a patch...

In terms of diagnosing what is happening, I think that IE sees the URL ending in ppt, and perhaps even does a HEAD on the URL to see the MIME type, and as it is application/vnd.ms-powerpoint it just invokes powerpoint and gives it the url. But Powerpoint does not have the right access cookies.

I also suspect that Powerpoint may be assuming that the URL is WebDAV-capable, and may be trying to do a WebDAV-style "in-place" open. In any case, this is literally limited to a particular version of IE. Trying to track this down...

Show
Martín Langhoff added a comment - I do think it is possible and worthwhile to try to workaround this issue based on the client string. Trying to come up with a patch... In terms of diagnosing what is happening, I think that IE sees the URL ending in ppt, and perhaps even does a HEAD on the URL to see the MIME type, and as it is application/vnd.ms-powerpoint it just invokes powerpoint and gives it the url. But Powerpoint does not have the right access cookies. I also suspect that Powerpoint may be assuming that the URL is WebDAV-capable, and may be trying to do a WebDAV-style "in-place" open. In any case, this is literally limited to a particular version of IE. Trying to track this down...
Hide
Martín Langhoff added a comment -

This patch implements a very specific workaround: only for IE clients, the application/vnd.ms-powerpoint mimetype gets changed to application/x-download.

The other two patches posted have the following problems

  • mod/resource is the wrong place to add the fix - this affects any file download
  • the 'revision53' patch changes mimetypes for everyone involved - this is an IE-specific problem

I think it is suitable that this remains as a patch – but if enough people have problem with installign SP1, then we could put this into CVS and make it conditional on a config setting ($CFG->workaroundppt2007downloadbug).

Show
Martín Langhoff added a comment - This patch implements a very specific workaround: only for IE clients, the application/vnd.ms-powerpoint mimetype gets changed to application/x-download. The other two patches posted have the following problems
  • mod/resource is the wrong place to add the fix - this affects any file download
  • the 'revision53' patch changes mimetypes for everyone involved - this is an IE-specific problem
I think it is suitable that this remains as a patch – but if enough people have problem with installign SP1, then we could put this into CVS and make it conditional on a config setting ($CFG->workaroundppt2007downloadbug).
Hide
Martín Langhoff added a comment -

This patch fixes up a problem with the previous one, and tests correctly.

Show
Martín Langhoff added a comment - This patch fixes up a problem with the previous one, and tests correctly.
Hide
Martín Langhoff added a comment -

And the fixed up colour coded patch http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=commitdiff;h=b277f77bafbada47359e799ba2a1aebae2fbd129

This problem seems to turn up when there are proxies or special cookie authentication mechanisms in place. With a vanilla moodle, I could not reproduce the issue - from the same client machine that reproduces the problem against a moodle with a special auth module.

Show
Martín Langhoff added a comment - And the fixed up colour coded patch http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=commitdiff;h=b277f77bafbada47359e799ba2a1aebae2fbd129 This problem seems to turn up when there are proxies or special cookie authentication mechanisms in place. With a vanilla moodle, I could not reproduce the issue - from the same client machine that reproduces the problem against a moodle with a special auth module.
Hide
Petr Škoda (skodak) added a comment -

Martín, I do not understand why it works for me on my Vista+office 2007SP1 test setup. Your "patch" breaks my PowerPoint, hmmm...

Does your Office 2007 have SP1 installed?

Show
Petr Škoda (skodak) added a comment - Martín, I do not understand why it works for me on my Vista+office 2007SP1 test setup. Your "patch" breaks my PowerPoint, hmmm... Does your Office 2007 have SP1 installed?
Hide
Petr Škoda (skodak) added a comment -

Could I get access to that machine to review what exactly is going over the wire? Or could you send me some wireshark dumps?

Show
Petr Škoda (skodak) added a comment - Could I get access to that machine to review what exactly is going over the wire? Or could you send me some wireshark dumps?
Hide
Martín Langhoff added a comment -

Hi Petr! My 2nd patch breaks stuff? Are you sure? All it does is change the mimetype and forces a download.

The test machine does not have SP1 applied – we checked – and I don't really have access to it. Yesterday I was visiting the user that has the problem, and I came up with this patch. Without the patch, it's broken, with the patch it works.

Show
Martín Langhoff added a comment - Hi Petr! My 2nd patch breaks stuff? Are you sure? All it does is change the mimetype and forces a download. The test machine does not have SP1 applied – we checked – and I don't really have access to it. Yesterday I was visiting the user that has the problem, and I came up with this patch. Without the patch, it's broken, with the patch it works.
Hide
Martín Langhoff added a comment -

Make sure you use the newer one - there are two patches I've uploaded.

Show
Martín Langhoff added a comment - Make sure you use the newer one - there are two patches I've uploaded.
Hide
Petr Škoda (skodak) added a comment -

If the Office does not have SP1 then PLEASE do install it, the vanilla 2007 is known to be broken in many ways.
"Breaks" means it open the file fine inside the browser, with the patch it open outside which is different from the rest

my -2 for the patch is SP1 works

Show
Petr Škoda (skodak) added a comment - If the Office does not have SP1 then PLEASE do install it, the vanilla 2007 is known to be broken in many ways. "Breaks" means it open the file fine inside the browser, with the patch it open outside which is different from the rest my -2 for the patch is SP1 works

Dates

  • Created:
    Updated:
    Resolved: