RecommendBySimilarityPlugin Fatal Error

Hello,
After we upgraded our OJS to the latest version which is 3.4.0.8, The error below appears continuously. Could you please help us regarding this issue. Many Thanks.

PHP Fatal error: Uncaught TypeError: Unsupported operand types: string - int in //public_html/plugins/generic/recommendBySimilarity/RecommendBySimilarityPlugin.php:83 Stack trace: #0 //public_html/plugins/generic/recommendBySimilarity/RecommendBySimilarityPlugin.php(46): APP\plugins\generic\recommendBySimilarity\RecommendBySimilarityPlugin->buildTemplate() #1 [internal function]: APP\plugins\generic\recommendBySimilarity\RecommendBySimilarityPlugin->APP\plugins\generic\recommendBySimilarity\{closure}('Templates::Arti...', Array) #2 /public_html/lib/pkp/classes/plugins/Hook.php(139): call_user_func_array(Object(Closure), Array) #3 /public_html/lib/pkp/classes/plugins/Hook.php(113): PKP\plugins\Hook::run('Templates::Arti...', Array) #4 /public_html/lib/pkp/classes/template/PKPTemplateManager.php(1787): PKP\plugins\Hook::call('Templates::Arti...', Array) #5/public_html/cache/t_compile/a4fc84a2d9d2a85c011fcc528f09577e88e2fcff^1c372c95cd85572e0fbc9a53d0323a0b229cfc78_0.app.frontendpagesarticle.tpl.php(43): PKP\template\PKPTemplateManager->smartyCallHook(Array, Object(Smarty_Internal_Template)) #6 /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_67adfef71bfb08_04115926(Object(Smarty_Internal_Template)) #7 /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #8 /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #9 /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render(false, 1) #10 /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, 'a4fc84a2d9d2a85...', NULL, 1) #11 /public_html/lib/pkp/classes/template/PKPTemplateManager.php(1372): Smarty_Internal_TemplateBase->display('frontend/pages/...', NULL, 'a4fc84a2d9d2a85...', NULL) #12/public_html/pages/article/ArticleHandler.php(355): PKP\template\PKPTemplateManager->display('frontend/pages/...') #13 [internal function]: APP\pages\article\ArticleHandler->view(Array, Object(APP\core\Request)) #14 /public_html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func(Array, Array, Object(APP\core\Request)) #15 /public_html/lib/pkp/classes/core/PKPPageRouter.php(278): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array, false) #16 /public_html/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route(Object(APP\core\Request)) #17 /public_html/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher->dispatch(Object(APP\core\Request)) #18 /public_html/index.php(21): PKP\core\PKPApplication->execute() #19 {main} thrown in /public_html/plugins/generic/recommendBySimilarity/RecommendBySimilarityPlugin.php on line 83

Hi @Salam_Al-Khammasi,

It sounds like someone is requesting an article page with an invalid request parameter called articlesBySimilarityPage. When specified, this should be a numeric value, but it sounds like it’s being requested by somebody specifying a non-numeric string instead. I’d suggest looking through your web server’s access log for articlesBySimilarityPage to see what kinds of values are being supplied to it.

Regards,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 10 days. New replies are no longer allowed.