OJS 3 cannot click on download links

I have just installed OJS 3.0 from ojs-3.0.0.tar.gz
Installation was smooth, but now
I’m having a strange problem: the download links are not active (eg; download a submission by clicking on the name of the uploaded file, or by clicking on “Download All Files”). The link, initially blue, becomes grey after being clicked, and the mouse cursor is changed into a “forbidden” sign (red circle with a bar).

However this does not seem to be an authorization problem, because if, instead of clicking, I right-click and select “open link in another tab”, then it works !

This happens when I’m logged as an editor wishing to view a submission, and even when I’m logged as an author uploading a file and trying to review my submission…

Any idea ??
I can provide a link to the website if my description is not clear enough.

thanks for any help
San

Hi @san,

Can you check your PHP error log, and if you have a Javascript developer toolbar or equivalent, check its console to see whether your browser hit a Javascript error?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec

thanks for the message. In the apache logs, as soon as I log into the OJS website I have 1000 lines of logs, but as far as I can tell they are all warnings for deprecated PHP, or “PHP Strict Standards”, eg:

AH01215: PHP Deprecated: Non-static method SubmissionFileManager::recordView() should not be called statically, assuming $this from incompatible context in /var/www/annales/lib/pkp/controllers/api/file/FileApiHandler.inc.php on line 44: /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3

And in the JS console, the only thing I see is a jquery warning:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

Below are some more logs, in case you see something.

Best regards
San

[Fri Sep 23 07:58:41.082553 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: PHP Strict Standards:  Declaration of LensGalleyPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/annales/plugins/generic/lensGalley/LensGalleyPlugin.inc.php on line 157: /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                                                
[Fri Sep 23 07:58:41.082630 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: /var/www/annales/plugins/generic/lensGalley/LensGalleyPlugin.inc.php(157) : Strict Standards - Declaration of LensGalleyPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false): /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                                                            
[Fri Sep 23 07:58:41.083251 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: PHP Strict Standards:  Declaration of WebFeedPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/annales/plugins/generic/webFeed/WebFeedPlugin.inc.php on line 190: /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                                                         
[Fri Sep 23 07:58:41.083309 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: /var/www/annales/plugins/generic/webFeed/WebFeedPlugin.inc.php(190) : Strict Standards - Declaration of WebFeedPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false): /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                                                                     
[Fri Sep 23 07:58:41.092577 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: PHP Strict Standards:  Declaration of FileApiHandler::authorize() should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in /var/www/annales/lib/pkp/controllers/api/file/FileApiHandler.inc.php on line 25: /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3         
[Fri Sep 23 07:58:41.092655 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: /var/www/annales/lib/pkp/controllers/api/file/FileApiHandler.inc.php(25) : Strict Standards - Declaration of FileApiHandler::authorize() should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true): /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                     
[Fri Sep 23 07:58:41.120152 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: PHP Strict Standards:  Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in /var/www/annales/classes/article/SubmissionFileDAO.inc.php on line 23: /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                                                  
[Fri Sep 23 07:58:41.120240 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: /var/www/annales/classes/article/SubmissionFileDAO.inc.php(23) : Strict Standards - Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation): /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                                                              
[Fri Sep 23 07:58:41.126511 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: PHP Deprecated:  Non-static method SubmissionFileManager::recordView() should not be called statically, assuming $this from incompatible context in /var/www/annales/lib/pkp/controllers/api/file/FileApiHandler.inc.php on line 44: /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3                                             
[Fri Sep 23 07:58:41.126582 2016] [cgi:error] [pid 23161] [client XXX.XXX.XXX.XXX:60816] AH01215: /var/www/annales/lib/pkp/controllers/api/file/FileApiHandler.inc.php(44) : Deprecated - Non-static method SubmissionFileManager::recordView() should not be called statically, assuming $this from incompatible context: /usr/lib/cgi-bin/php-cgi-5.6.26, referer: http://annales.MYSITE.fr/index.php/AnnLeb/workflow/index/3/3

Hi @san,

Those messages are all cosmetic – you can configure your PHP installation to suppress these warnings by disabling strict warnings. We’ll be working to clean these up over the next few releases but they shouldn’t cause problems in the meantime.

I’d suggest turning off strict and deprecated warnings, then trying the download again to see if you can spot something in the log without all that noise included.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec

thanks for the suggestion. In fact, this is weird, if I disable warnings by setting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
in php.ini, then it works! I can download files. The link does turn gray and the “forbidden” red sign does appear, but only for one second, and then the download starts, and the link becomes blue again, and the mouse cursor becomes normal again.

Just to check, if I revert to
error_reporting = E_ALL
in php.ini, then the download links stop working, as in my first report.

So it seems that php error reporting (resulting in a slight delay ?) is enough to make the links stop working…

thanks again
San

Hi @san,

I suspect that the problem is actually that warnings are being sent back to the browser, when the browser is expecting a JSON response. The warnings can’t be parsed, so the Javascript handlers stop running.

Generally it’s a good idea to direct errors to the log rather than the browser for production uses.

Glad to hear you’ve gotten it going!

Regards,
Alec Smecher
Public Knowledge Project Team