3.2.0-2 PHP Fatal Errors (citations style language and getLocalizedFullTitle() on null )

Server Information

Setting Name Setting Value
OS platform Linux
PHP version 7.2.29
Apache version Apache
Database driver mysqli
Database server version 10.3.22-MariaDB

Today, when I visited my PHP error log, I noticed the error below but I don’t know what triggered these errors.

[18-Apr-2020 15:00:43 UTC] PHP Fatal error: Uncaught Error: Call to undefined method Request::handle404() in /home/seisense/journal.seisense.com/plugins/generic/citationStyleLanguage/pages/CitationStyleLanguageHandler.inc.php:100
Stack trace:
#0 /home/seisense/journal.seisense.com/plugins/generic/citationStyleLanguage/pages/CitationStyleLanguageHandler.inc.php(69): CitationStyleLanguageHandler->_setupRequest(Array, Object(Request))
#1 /home/seisense/journal.seisense.com/lib/pkp/classes/core/PKPRouter.inc.php(391): CitationStyleLanguageHandler->download(Array, Object(Request))
#2 /home/seisense/journal.seisense.com/lib/pkp/classes/core/PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#3 /home/seisense/journal.seisense.com/lib/pkp/classes/core/Dispatcher.inc.php(143): PKPPageRouter->route(Object(Request))
#4 /home/seisense/journal.seisense.com/lib/pkp/classes/core/PKPApplication.inc.php(278): Dispatcher->dispatch(Object(Request))
#5 /home/seisense/journal.seisense.com/index.php(68): PKPApplic in /home/seisense/journal.seisense.com/plugins/generic/citationStyleLanguage/pages/CitationStyleLanguageHandler.inc.php on line 100

Here is another one. ( I searched the forum and found someone has reported this issue here as well Problem after upgrading to OJS 3.2.0-2. Crossref Plugin and another errors - #6 by Adriano_Jose
[18-Apr-2020 17:42:37 UTC] PHP Fatal error: Uncaught Error: Call to a member function getLocalizedFullTitle() on null in /home/seisense/journal.seisense.com/cache/t_compile/011e5a5c6ec6ee79d574ba236ee5fce1afabbea9^504348cc7222e1110a6019067f9a002726c02324_0.plugins-plugins-generic-pdfJsViewer-generic-pdfJsViewer.display.tpl.php:94
Stack trace:
#0 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5e9b3c0dda73d0_86846590(Object(Smarty_Internal_Template))
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smar in /home/seisense/journal.seisense.com/cache/t_compile/011e5a5c6ec6ee79d574ba236ee5fce1afabbea9^504348cc7222e1110a6019067f9a002726c02324_0.plugins-plugins-generic-pdfJsViewer-generic-pdfJsViewer.display.tpl.php on line 94

Please suggest a fix to this issue.
Thanks

These two fatal errors are repeatedly appearing in the php error log. I have no idea what is triggering these errors. Please anyone here can suggest a sloution.
Thanks

Hi @seisense,

This is a cosmetic bug, i.e. the user would be getting a 404 Not Found error rather than a 500 Internal Server Error, but I’ve filed and fixed it at citationStyleLanguage refers to nonexistent Request::handle404 · Issue #5761 · pkp/pkp-lib · GitHub. Applying the patch there will keep this out of your PHP error log.

(This applies to the CitationStyleLanguage error – the other is a different issue.)

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi all,

The second issue, for viewing an issue galley published in PDF, is filed here: Error when viewing a PDF issue galley · Issue #5762 · pkp/pkp-lib · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,
I applied the suggested commit here pkp/pkp-lib#5190 Added title to iframe in html galley · pkp/ojs@3f04c60 · GitHub
Yet, today this error appeared again in my PHP error log.

I noticed there is a further development in this issue highlighted Error when viewing a PDF issue galley · Issue #5762 · pkp/pkp-lib · GitHub
So, I reversed the change (as suggested), I made before in plugins/generic/htmlArticleGalley/templates/display.tpl at line 47 to its original state.

When I try to apply the commits suggested in the next comment, I noticed there is no difference what is suggested and what I found in my file (see the screenshot) {translate key="article.pageTitle" title=$title|escape}

Capture

Please guide.
Thanks

[22-Apr-2020 08:33:53 UTC] PHP Fatal error: Uncaught Error: Call to a member function getLocalizedFullTitle() on null in /home/seisense/journal.seisense.com/cache/t_compile/011e5a5c6ec6ee79d574ba236ee5fce1afabbea9^504348cc7222e1110a6019067f9a002726c02324_0.plugins-plugins-generic-pdfJsViewer-generic-pdfJsViewer.display.tpl.php:94
Stack trace:
#0 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5ea001713cc112_94325862(Object(Smarty_Internal_Template))
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smar in /home/seisense/journal.seisense.com/cache/t_compile/011e5a5c6ec6ee79d574ba236ee5fce1afabbea9^504348cc7222e1110a6019067f9a002726c02324_0.plugins-plugins-generic-pdfJsViewer-generic-pdfJsViewer.display.tpl.php on line 94

Hi @seisense,

Did you reverse the change applied in pkp/pkp-lib#5190 Added title to iframe in html galley · pkp/ojs@3f04c60 · GitHub? [edit: should be https://github.com/thinkbulecount2/pdfJsViewer/commit/a2c3136260824b0cc19338345a281a024b65c496]

Regards,
Alec Smecher
Public Knowledge Project Team

Yes I reversed the change @asmecher

Hi @seisense,

Are the file permissions wrong in your cache/t_compile directory? If so, OJS won’t be able to replace the compiled template file with a new version including the change. You should be able to remove cache/t_compile/*.php to force OJS to recompile them.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I don’t see if file permissions are wrong. I have compared the permission level with my test OJS installation site as well and found the same. Yet below are the screenshots for your review:

1- Screenshot of permission levels within Cache directory
Capture

2- Screenshot of permission levels within t_compile
tcompile

Regards,

Hi @seisense,

It’s not just a question of numeric permission codes, but also file ownership and your server setup. You can be sure by removing cache/t_compile/*.php and checking if the files get re-generated.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
I just deleted all the *.php from cache/t_compile and it regenerated the files in it. Screenshot is attached
Capture

Thanks

Hi @seisense,

Ok, good. Now check the line in the compiled template file that’s referenced from the error log; what does that like look like?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I found the referenced PHP error file in the t_compile folder and have attached it here for your review.

PHP error file

Thanks for your support

Hi @seisense,

That link shows a 500 error. If you can just quote the line in question here, that would be enough.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
I am sorry for this mistake. Below is the line no 94

" width="100%" height="100%" style="min-height: 500px;" title="<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['translate'][0], array( array('key'=>"submission.representationOfTitle",'representation'=>$_smarty_tpl->tpl_vars['galley']->value->getLabel(),'title'=>call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'escape' ][ 0 ], array( $_smarty_tpl->tpl_vars['publication']->value->getLocalizedFullTitle() ))),$_smarty_tpl ) );?>

Thanks

Hi @seisense,

My apologies, I think I gave you the wrong commit to reverse. It should be this change: https://github.com/thinkbulecount2/pdfJsViewer/commit/a2c3136260824b0cc19338345a281a024b65c496

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

I am not sure if I am getting it right. I have made the following commits, my files look like this. Please correct me if I am wrong.

commit at line number 47
1- plugins/generic/htmlArticleGalley/templates/display.tpl
2

At the following path in the display.tpl, I found the commit at line number 59, not at 52. I have reversed the change but I am not sure if it is the correct place as the line number suggested is not the same.
2- plugins/generic/pdfJsViewer/templates/display.tpl
3

Thanks and looking forward to your reply.

Hi @seisense,

Yes, at a glance that looks fine. Does it correct the problem you were encountering?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Yes, problem is solved. Thanks once again for your support.
Regards,