OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Problems with the Reading Tools frame

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Re: Problems with the Reading Tools frame

Postby asmecher » Thu Jul 04, 2013 12:35 pm

Hi tgc99,

Sorry, I made a mistake in that SQL query. Please try:
Code: Select all
SELECT f.file_id, f.file_type FROM article_galleys g, article_files f WHERE g.file_id = f.file_id AND g.article_id IN (2575, 2225);
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with the Reading Tools frame

Postby tgc99 » Fri Jul 05, 2013 12:50 am

asmecher wrote:Please try:
Code: Select all
SELECT f.file_id, f.file_type FROM article_galleys g, article_files f WHERE g.file_id = f.file_id AND g.article_id IN (2575, 2225);

Here's the result:
Code: Select all
ojs=#     SELECT f.file_id, f.file_type FROM article_galleys g, article_files f WHERE g.file_id = f.file_id AND g.article_id IN (2575, 2225);
 file_id |      file_type       
---------+----------------------
   12507 | application/download
    8504 | application/pdf
(2 rows)
tgc99
 
Posts: 56
Joined: Thu Oct 18, 2007 3:50 am
Location: Aarhus, Denmark

Re: Problems with the Reading Tools frame

Postby asmecher » Fri Jul 05, 2013 8:45 am

Hi tgc99,

That's the problem: all PDFs should have a file_type of application/pdf. If you update the entries for PDF files that read application/download, they'll behave properly. For new uploads, see http://pkp.sfu.ca/wiki/index.php/PKP_Frequently_Asked_Questions#HTML_Galleys_don.27t_display_properly_.2F_files_I_upload_aren.27t_being_identified_properly. It relates to HTML files but the MIME type identification code is the same.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with the Reading Tools frame

Postby tgc99 » Mon Jul 08, 2013 1:43 am

asmecher wrote:That's the problem: all PDFs should have a file_type of application/pdf. If you update the entries for PDF files that read application/download, they'll behave properly.

I updated the database as seen below and now the bad PDFs are working as expected.
Code: Select all
UPDATE article_files SET file_type = 'application/pdf' WHERE file_id IN (SELECT f.file_id FROM article_galleys g, article_files f WHERE g.file_id = f.file_id AND g.label = 'PDF' AND f.file_type = 'application/download');
UPDATE 198


Thanks for the pointer. We're still on php 5.1.6 so missing the Fileinfo extension out of the box. I've now added the Fileinfo extension from PECL to hopefully prevent future issues with filetypes.

-tgc
tgc99
 
Posts: 56
Joined: Thu Oct 18, 2007 3:50 am
Location: Aarhus, Denmark

Previous

Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests

cron