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.
MMeijer
Posts: 36
Joined: Fri Nov 10, 2006 3:25 am
Location: Utrecht
Contact:

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.

ArticleXMLGalleyDAO.inc.php(117):

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)

XMLGalleyPlugin.inc.php(111):

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:
XMLGalleyPlugin.inc.php(272):

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.
Cheers!
Maarten

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

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.

Regards,
Alec Smecher
Public Knowledge Project Team


Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 3 guests