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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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: 8869
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: 8869
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: No registered users and 3 guests

cron