OJS3 PHP Fatal error on "getGenreld() on null" and PHP warning on "array_flip()"

Dear colleagues,

I have been getting the following messages and I am not sure what does it mean. I am really new in PHP thingy and hope someone is patient enough to guide me!

Thank you - Michael!

[20-Mar-2018 03:12:06 Asia/Kuala_Lumpur] PHP Fatal error: Call to a member function getGenreId() on null in /home/neurosc1/public_html/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php on line 78
[20-Mar-2018 11:37:08 Asia/Kuala_Lumpur] PHP Warning: array_flip(): Can only flip STRING and INTEGER values! in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 702

Hi @neuroscirn

The first message is an error due to this bug: consider missing submission file in usage stats loader · Issue #3332 · pkp/pkp-lib · GitHub. Thus, you would need to apply this patch: pkp/pkp-lib#3332 consider missing submission file in usage stats loader by bozana · Pull Request #1816 · pkp/ojs · GitHub. – It seems like the access to a file was logged in the statistics log that does not exist and your code does not considers that situation…

For the second message I am not sure what it means i.e. when does it occur and why it occurs. If you could tell me when exactly it occurs, I could eventually help. It seems however to be a warning, not an error.

Best,
Bozana

1 Like

Hi @bozana

Thank you very much for your reply. Both errors were logged at the time I did nothing to OJS3. The fatal error seems to be random. I have now received more warning and deprecated messages. I attach here the selected error_log for your reference. I did not do anything when all the errors were logged.

Sorry for the long error list.

Thank you so much for spending time on my case!
Michael

[21-Mar-2018 02:40:09 Asia/Kuala_Lumpur] PHP Strict Standards: Declaration of PiwikPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /home/neurosc1/public_html/ojs/plugins/generic/piwik/PiwikPlugin.inc.php on line 155
[21-Mar-2018 03:26:42 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method Validation::verifyPasswordResetHash() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/pages/login/LoginHandler.inc.php on line 215
[21-Mar-2018 03:26:42 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method Core::removeBaseUrl() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/plugins/generic/usageStats/PKPUsageStatsLoader.inc.php on line 508
[21-Mar-2018 03:26:42 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method Core::_getBaseUrlAndPath() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/Core.inc.php on line 256
[21-Mar-2018 03:26:42 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method Config::getContextBaseUrls() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/Core.inc.php on line 313
[21-Mar-2018 03:26:43 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method Core::_getBaseUrlAndPath() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/Core.inc.php on line 256
[21-Mar-2018 03:26:43 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method Config::getContextBaseUrls() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/Core.inc.php on line 313
[21-Mar-2018 03:26:43 Asia/Kuala_Lumpur] PHP Fatal error: Call to a member function getGenreId() on null in /home/neurosc1/public_html/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php on line 78
[21-Mar-2018 03:29:30 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::getUser() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/mail/MailTemplate.inc.php on line 232
[21-Mar-2018 03:29:30 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPRequest.inc.php on line 564
[21-Mar-2018 03:29:30 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::getRemoteAddr() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/mail/Mail.inc.php on line 508
[21-Mar-2018 03:29:30 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPRequest.inc.php on line 425
[21-Mar-2018 03:29:46 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method Validation::verifyPasswordResetHash() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/pages/login/LoginHandler.inc.php on line 215
[21-Mar-2018 03:29:46 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::getUser() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/mail/MailTemplate.inc.php on line 232
[21-Mar-2018 03:29:46 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPRequest.inc.php on line 564
[21-Mar-2018 03:29:46 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::getRemoteAddr() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/mail/Mail.inc.php on line 508
[21-Mar-2018 03:29:46 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPRequest.inc.php on line 425
[21-Mar-2018 03:30:29 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::getUserVar() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/form/Form.inc.php on line 369
[21-Mar-2018 03:30:29 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPRequest.inc.php on line 592
[21-Mar-2018 03:30:46 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::getUserVar() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/form/Form.inc.php on line 388
[22-Mar-2018 03:34:54 Asia/Kuala_Lumpur] PHP Fatal error: Call to a member function getGenreId() on null in /home/neurosc1/public_html/ojs/plugins/generic/usageStats/UsageStatsLoader.inc.php on line 78
[22-Mar-2018 07:37:33 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::getUserVar() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/form/Form.inc.php on line 369
[22-Mar-2018 07:37:33 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPRequest.inc.php on line 592
[22-Mar-2018 08:45:39 Asia/Kuala_Lumpur] PHP Deprecated: Non-static method PKPApplication::getCCLicenseBadge() should not be called statically, assuming $this from incompatible context in /home/neurosc1/public_html/ojs/pages/article/ArticleHandler.inc.php on line 149

Hi @neuroscirn

Those Strict Standards and Deprecated messages are no errors – you could configure your error logging at the server so that they are not displayed…

Best,
Bozana

1 Like

Hi @bozana

I did that quite a while a go and I am still getting the error messages. I set

php_value error_reporting 30711
in .htaccess file

and

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
in php.ini file.

However, the php.ini file is at /public_html/ directory but the htaccess file for OJS is at /public_html/ojs/ directory where it was installed.

Not sure if I put the command in the right files.

Please advise.

Thank you so much!
Michael