Reviewer unable to download file (OJS 3.3.0.11)

Some of the reviewer unable to download the file. If he was clicking to download then page not responding. 500 error was showing.

We have checked error log bellow mentioned error log was generated:-

[22-Jun-2022 16:44:07 Asia/Kolkata] PHP Fatal error: Uncaught Error: Call to a member function getLocalizedName() on null in /EPUB/ojs/lib/pkp/controllers/api/file/FileApiHandler.inc.php:109
Stack trace:
#0 /EPUB/ojs/lib/pkp/classes/core/PKPRouter.inc.php(395): FileApiHandler->downloadFile()
#1 /EPUB/ojs/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest()
#2 /EPUB/ojs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route()
#3 /EPUB/ojs/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()
#4 /EPUB/ojs/index.php(68): PKPApplication->execute()
#5 {main}
thrown in /EPUB/ojs/lib/pkp/controllers/api/file/FileApiHandler.inc.php on line 109

Hi @shantanusingh,

I suspect you’ve deleted a “genre” (also named “component” in the user interface) and that has affected any associated files. Try the following database query:

SELECT sf.genre_id FROM submission_files sf
LEFT JOIN genres g ON (sf.genre_id = g.genre_id)
WHERE g.genre_id IS NULL AND sf.genre_id IS NOT NULL;

If you get any results, you’ll need to correct the entries in submission_files that use the genre_id from the query results so that they point to an existing entry in genres.

If that is not the cause, then check this issue for a patch that may resolve it:

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like