PKP Bugzilla – Bug 8404
XML Galleys broken in upgrade from OJS 2.3.6 to 2.4.2
Last modified: 2014-01-22 08:15:03 PST
The XMLGalleyPluginDAO produces incorrect filenames to XML files.
OJS 2.4.2 produces:
The previous OJS version produced:
Checking the database to be certain of the file_stage:
mysql> SELECT file_stage FROM article_files WHERE article_id=3;
Adding some debugging in function fileStageToPath($fileStage) led me to find:
Since these don't match, the default case is triggered:
default: return 'submission/original';
It turns out that there is a line missing from the following file:
In function _returnXMLGalleyFromArticleGalley(&$galley):
After the following line (important):
Add this line:
Without it, the fileStage is always hard-coded to 'public', when it should actually be an integer (7, in this case) inherited from the parent object type. This, in turn, causes fileStageToPath($fileStage) to produce an incorrect file path.
I might further suggest that the default case in fileStageToPath($fileStage) should produce an error, rather than happily creating a non-existent path.
Committed. Thanks for tracking this down, Charles; this plugin is not often used and suffers less than ideal maintenance.
Set file stage when fetching XML galley