You are viewing the PKP Support Forum | PKP Home Wiki

XML Galley plugin bug

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.

XML Galley plugin bug

Postby MMeijer » Tue May 28, 2013 7:13 am

Dear OJS friends,
I think I've found (and solved) a tiny bug in the XML Galley plugin. We are migrating our OJS installations from Solaris to Linux systems, and the XML Galley plugin didn't work anymore. It appeared that the mimetype of uploaded xml files had changed from 'text/xml' to 'application/xml', in the database table 'article_files'.
The XML Galley plugin has two spots where it only checks for 'text/xml', while at other places it checks for more mimetypes.

Code: Select all
if ($galley->getFileType() == "text/xml") {

should read:
Code: Select all
if ($galley->getFileType() == "text/xml" || $galley->getFileType() == "application/xml") {

(or something more elegant than calling $galley->getFileType() twice)

Code: Select all
if ($galley->getFileType() == "text/xml") {

should read:
Code: Select all
if ($galley->getFileType() == "text/xml" || $galley->getFileType() == "application/xml") {

and as a byproduct of scanning for 'text/xml' I saw this typo:
Code: Select all
if (($type == 'text/xml' || $type == 'text/xml' || $type == 'application/xml' || $type == 'application/xslt+xml')

should read:
Code: Select all
if (($type == 'text/xml' || $type == 'text/xsl' || $type == 'application/xml' || $type == 'application/xslt+xml')

All this pertaining to the OJS 2.3.8 release, btw.
Posts: 36
Joined: Fri Nov 10, 2006 3:25 am
Location: Utrecht

Re: XML Galley plugin bug

Postby asmecher » Mon Jun 03, 2013 3:29 pm

Hi Maarten,

Thanks for contributing, and for the clear description. I've posted a Bugzilla entry and committed the above; see http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8244 for details.

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

Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 5 guests