History | Log In     View a printable version of the current page.  
We are currently focused especially on Moodle 2.0, Moodle 1.9.x bugs and Moodle 1.9.x testing.    Confused? Lost? Please read this introduction to the Tracker.
Issue Details (XML | Word | Printable)

Key: MDL-10538
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Not a bug
Priority: Major Major
Assignee: Petr Škoda
Reporter: Mitsuhiro Yoshida
Votes: 4
Watchers: 8
Operations

If you were logged in you would be able to see more operations.
Moodle

IE can't open powerpoint resource file type.

Created: 20/Jul/07 06:59 AM   Updated: 27/Feb/08 05:04 PM
Component/s: Resource
Affects Version/s: 1.9
Fix Version/s: None

File Attachments: 1. Text File 0001-filelib-Work-around-IE-Powerpoint2007-download-bug.patch (2 kb)
2. Text File 0001-filelib-Work-around-IE-Powerpoint2007-download-bug.patch (2 kb)
3. Text File resource.class.php.patch (0.7 kb)
4. File revision53.diff (3 kb)

Issue Links:
Duplicate
 
Relates
 

Participants: A. T. Wyatt, Daniel Pouliot, Kristian Thornley, Martín Langhoff, Mitsuhiro Yoshida, Nicolas Connault, Petr Škoda and Rob Faulkner
Security Level: None


 Description  « Hide
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);
     }



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
A. T. Wyatt - 25/Aug/07 04:15 AM
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.

Rob Faulkner - 17/Dec/07 08:28 PM
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.

Petr Škoda - 18/Dec/07 04:17 AM
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.

Kristian Thornley - 24/Jan/08 06:07 AM
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

Nicolas Connault - 25/Jan/08 05:02 AM
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.

Petr Škoda - 25/Jan/08 05:06 AM
Oki, I finally have office licenses again, goint to work on this next week

Daniel Pouliot - 05/Feb/08 01:57 AM
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 **

Daniel Pouliot - 05/Feb/08 01:58 AM
Patch for lib/filelib.php

Petr Škoda - 05/Feb/08 05:04 AM
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

Petr Škoda - 05/Feb/08 05:38 AM
thanks for the report anyway!

Martín Langhoff - 26/Feb/08 04:25 AM
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...

Martín Langhoff - 26/Feb/08 08:46 AM
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).


Martín Langhoff - 27/Feb/08 08:39 AM
This patch fixes up a problem with the previous one, and tests correctly.

Martín Langhoff - 27/Feb/08 08:45 AM
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.

Petr Škoda - 27/Feb/08 08:45 AM
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?

Petr Škoda - 27/Feb/08 09:10 AM
Could I get access to that machine to review what exactly is going over the wire? Or could you send me some wireshark dumps?

Martín Langhoff - 27/Feb/08 11:15 AM
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.

Martín Langhoff - 27/Feb/08 11:16 AM
Make sure you use the newer one - there are two patches I've uploaded.

Petr Škoda - 27/Feb/08 05:04 PM
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