View Issue with wrong headers?

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.
luiz_borges
Posts: 34
Joined: Tue Jun 30, 2009 1:44 pm
Location: Araraquara-SP / Brasil

View Issue with wrong headers?

Postby luiz_borges » Thu Jan 17, 2013 3:37 am

I just started using the View Issue feature of the new version of OJS, however, I've noticed that it is not working on Chrome see the links below:
This works: http://seer.fclar.unesp.br/itinerarios/ ... /5608/4413
This doesn't: http://seer.fclar.unesp.br/itinerarios/ ... ssue/451/2

Inspecting the links are called on by the pdfObject, I noticed that the first one shows normally on browser, but the second one tries to be downloaded.
This works http://seer.fclar.unesp.br/itinerarios/ ... /5608/4413
This doesn't: http://seer.fclar.unesp.br/itinerarios/ ... File/451/2

I'm guessing this has something to do with file headers. Is there a bug report open for this? I guess the patch would be simple to implement.

EDIT: I tested the links with http://web-sniffer.net/ and confirmed that indeed the headers are different one have "Content-Disposition: attachment;" the other "Content-Disposition: inline;"

luiz_borges
Posts: 34
Joined: Tue Jun 30, 2009 1:44 pm
Location: Araraquara-SP / Brasil

Re: View Issue with wrong headers?

Postby luiz_borges » Thu Jan 17, 2013 6:05 am

I solved the issue. I edited the file /pages/issue/IssueHandler.inc.php and changed:

Code: Select all

         return $issueFileManager->downloadFile($galley->getFileId(), null, $inline);

to

Code: Select all

         return $issueFileManager->downloadFile($galley->getFileId(), $inline);


The downloadFile function of issueFileManager takes just two parameters. I think it is necessary to create a bug report for this.

JasonNugent
Site Admin
Posts: 910
Joined: Tue Jan 10, 2006 6:20 am

Re: View Issue with wrong headers?

Postby JasonNugent » Thu Jan 17, 2013 6:36 am

Hi Luiz,

Thanks for the bug report and the fix. I've filed a bug report and also committed fixes to our OJS branches that use this feature.

http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8084

Cheers,
Jason


Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 2 guests