Issue Details (XML | Word | Printable)

Key: MDL-16745
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: moodle.com
Reporter: Robert Puffer
Votes: 18
Watchers: 18
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

YET ANOTHER Firefox Not Opening PDF docs correctly

Created: 30/Sep/08 11:28 PM   Updated: 13/Nov/09 04:08 PM
Component/s: Resource
Affects Version/s: 1.9.2
Fix Version/s: None

File Attachments: 1. File resource.class.php (42 kB)

Environment: SuSE Enterprise 10.x Apache 2 MySQL 5.024 PHP 5.1.6

Database: MySQL
Participants: Anthony Borrow, Arnaud saint-Georges, Bruce Webster, Heikki Wilenius, moodle.com, Nicolas Connault, Rob Black, Robert Puffer, Sam Hemelryk and Stephen Wilkinson
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
Lots of parties have posted lots of issues of PDFs not opening in Firefox. These have all been dismissed blaming Firefox and Adobe (both of which appear to represent PART of the problem) and generally recommending force download. My issue is:
   1. Once the "Force download" setting is "set" it does not allow you to unset it.
   2. On many occasions the "Force download" setting will not "stick". Even though you cannot change it once its set (as mentioned in #1) when you return, it is unset and the pdf document doesn't load correctly. I've seen this happen before my eyes. And I've seen it happen after days go by.
   3. MOST IMPORTANTLY: I can access the very same pdf document from the same course using the same computer on the same browser (Firefox) with the same Firefox version using the same (updated) Acrobat plugin using TWO DIFFERENT instances of Moodle (1.65+ and 1.92+) and have the 1.65+ open it without a problem while 1.92+ won't.

I think there really is more going on here than just browsers not playing well with plugins.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Nicolas Connault added a comment - 08/Oct/08 03:50 PM
You're right, there is more going on: 1.9 is XHTML compliant (a requirement for several large universities) while 1.65 is not. This has been explained in many places if you would care to research a bit

Robert Puffer added a comment - 08/Oct/08 08:32 PM
Is part of the XHTML compliance that the "Force download" setting cannot be unset (not even by the Admin) once set but manages to frequently unset itself?

Nicolas Connault added a comment - 10/Oct/08 04:58 PM
Robert,

I've added a resource "Link to a file or web site" linking to an uploaded pdf file. Not only does the file open fine in Firefox (FF3 on linux), but I don't have any problems with the "force download" setting.

Could you confirm that you are still having this problem, and, if so, could you give more details of the steps required to reproduce it?

Thanks


Arnaud saint-Georges added a comment - 24/Feb/09 06:58 PM
Bonjour Nicolas,

We recently migrated from Moodle 1.8.6 to Moodle 1.9.4
Since that day most of our client PCs (depending on OS+browser+Acrobat+Acrobat plugin+settings) cannot display PDF files "in" Moodle.

Symptoms:

  • a sort of frame opens for displaying the content within the plugin... but doesn't display it
  • the browser freeze
  • generally, keys <Ctrl>+<F5> (refresh) display the content! At the first try, or at the second or third try!
  • in some (rare) case, the same browser... display the content at the first time!

Note that:

  • we use eaccelerator
  • our whole Moodle is in secure mode (https)
  • whe have more than 5,000 PDF ressources of this type

You can reproduce this problem with PDF files of theme 5 of this course :
https://cursus.uhb.fr/course/view.php?id=2

Thanks
Arno


Stephen Wilkinson added a comment - 02/Mar/09 06:59 AM
Since upgrading to Moodle 1.9.4 this is now an issue for me with Vista and Firefox 3.0.4 and 3.0.6.

it worked fine with the same config, but Moodle 1.9.3.

Symptoms are as Arnaud above, but intermittent. To me, it seems that the first time you try to view a PDF it works, but thereafter it does not. It never seems to like you moving from one PDF directly to another using the pull down resource menu. Ctrl F5 (refresh) rarely seems to work for me. The browser crashes quite often.

We do not use eaccelerator and our Moodle site is not in secure mode.

Is there any progress with this issue? It continues to be mentioned in the forums.

Regards,
Stephen.


Anthony Borrow added a comment - 30/Mar/09 06:55 AM
For what it is worth, I too was having difficulty viewing pdfs from a 1.9 site from my Ubuntu 8.10 machine using FF 3.0.7; however, now that I have installed Acrobat Reader 9.1 (the .deb version) I have no problems. For me, this confirms what I had suspected all along that the issue was in fact more of an Adobe issue than a Moodle issue. Now that the 9.1 version is available for Linux hopefully this will be cleared up. To be reasonably certain that i it was the adobe installation, on a virtual machine I tried to open a file using the older 8.? version and it did not work. I installed the 9.1 version and it worked so it is not a matter of me having applied Firefox patches or anything else in the Moodle code. Peace - Anthony

Heikki Wilenius added a comment - 30/Mar/09 02:15 PM
I also recommend everyone to upgrade Acrobat Reader to 9.1. It solved the issue for us (Moodle 1.9.4).

Bruce Webster added a comment - 21/Apr/09 08:53 AM
We just started getting this with 1.9.4+. The same computer/browser/Adobe Reader 8.1 plugin can view PDFs fine in a moodle 1.9.3+ install.

It's not possible to tell everyone who might log in to u/g adobe so we're going to not embed pdfs.

Change $embedded = true; to $embedded = false; for PDFs around line 268 in resource/type/file/resource.class.php

The embedded view is poor design anyway - as well as freezing up firefox 3, it has no site header breadcrumbs and a fixed 800x800 object (double scrollbars!). Next, I want to get rid of the 'same window' option - we don't want people losing their course window or having to use the browser back button to find it.

If you want to fix this bug and retain normal moodle behaviour, you can replace the pdf object with an iframe containing the PDF. That's around line 695 of resource/type/file/resource.class.php.


Rob Black added a comment - 24/Apr/09 12:23 PM
I have made some changes to the /mod/resource/type/file/resource.class.php file that has resulted in the uploaded files being displayed correctly in when a user opens an uploaded file. The changes have been tested primarily with .pdf, .doc, .xls, .ppt, .pub files and FF 3.0.9, IE7, Opera 9.64. Acrobat Reader 8 (which was freezing prior to these changes)

The changes mean that the drop down menu for opening the file in the "Same Window" or "New Window" has been removed and the default is set to "New Window". Our feeling was that opening the file in the same window wasn't the best and when it did display the presentation wasn't that good (double scroll bars, etc). The setting for "Force download" is still there and if "Show Advanced" button is clicked the settings for the new window can be set. If the file is set to "Force download" (checked) then the advanced settings are disabled.

So far as presentation goes pdf files will open in a new window, of the specified size and attributes with the window displaying the pdf file as you would expect.

When it comes to the files that are created from MS Office (.doc, .xls, .ppt, .pub) these will be forced to download regardless. The presentation of these files wasn't great when not set to "Force download" as a new browser window would open and then the file would open either in an instance of the particular program - Word, Excel etc or the browser window depending on the browser. With the changes made the user is now prompted to either open, save or cancel from the File download window, if they open the file will open in the application, or save (download) as you would expect.

The changes to the code in the attached file occur at lines 138 - 143 - this forces the setting for downloading of MS Office files. Other changes were made at lines:

820 - added note to explain about the automatic setting of "Force download" on MS Office files (hard coded in English - should be moved to a lang file)
825 - see comment at end of line
828 - see comment at end of line
833 - see comment at end of line
845 - commented 846 line added
850 - line commented 851 line added

Each change is commented in the attached file.


Sam Hemelryk added a comment - 04/Jun/09 03:50 PM
For those who are experiencing a blank screen or crashing browser on some PDF files, I hit a similar issue with Dariem this morning. We managed to solve the problem with a very simple fix.

In /mod/resource/type/file/resource.class.php file the following line
echo '<object data="' . $fullurl . '" type="application/pdf">';
and add a # in the string after $fullurl as below
echo '<object data="' . $fullurl . '#" type="application/pdf">';

Strangely enough this little fix solved the problem of the unviewable PDF in Firefox for both Dariem and myself.
It is important to note that the problem effected only SOME pdf's not all that we experimented with. It was not a problem that effected all PDFs

I was running Ubuntu 9.04, FF 3.0.10.0, Adobe Reader 8

If anyone is having similar problems and tries this please let us know whether it solved your problems


Sam Hemelryk added a comment - 04/Jun/09 03:51 PM
Upgrading to Reader 9+ is a better solution for those who can