ojsde / shariff

The Shariff plugin adds social media buttons to the website without compromising the privacy of website users, using Shariff (https://github.com/heiseonline/shariff) solution.
GNU General Public License v3.0
9 stars 16 forks source link

Issues with OJS 3.3.0 - Settings/Website display error #29

Closed azotase closed 1 year ago

azotase commented 2 years ago

Hi,

I don't know why this happens but I've activated the plugin in OJS 3.3.0 and it break the Admin/Website page in the dashboard. see attached photo. Disable and it reverts back to normal.

image
ronste commented 2 years ago

Hi @azotase,

I looked into this but I am not able to reproduce the issue on my system (OJS 3.3.0.10).

Please have a look at the PHP error log and look for anything containing the text 'shariff'. Sometimes the pages may also be mixed up by outdated cache items. In Firefox, please try to reload the page from the Inspector->Network Analysis page with disabled cache. You could also clear the template cache from within OJS (Adminsitration page).

Do you still have the issue?

Best wishes, Ronald

nwoodward commented 2 years ago

I am getting the same error on my OJS instance (3.3.0.11). I cleared the template cache and the emptied the cache/ directory and then tried again but got the same result. The PHP error, which references the Shariff plugin, is below:

[Tue Jun 28 15:47:55.228788 2022] [php:error] [pid 32037] [client] PHP Fatal error: Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array, null given in /ebs/ojs/twj/lib/pkp/classes/components/forms/FormComponent.inc.php:272\nStack trace:\n#0 /ebs/ojs/twj/lib/pkp/classes/components/forms/FormComponent.inc.php(272): array_values(NULL)\n#1 /ebs/ojs/twj/plugins/generic/shariff/ShariffPlugin.inc.php(121): PKP\\components\\forms\\FormComponent->getConfig()\n#2 /ebs/ojs/twj/lib/pkp/classes/plugins/HookRegistry.inc.php(107): ShariffPlugin->callbackAppearanceTab('Template::Setti...', Array)\n#3 /ebs/ojs/twj/lib/pkp/classes/template/PKPTemplateManager.inc.php(1518): HookRegistry::call('Template::Setti...', Array)\n#4 /ebs/ojs/twj/cache/t_compile/77c4afd9cd56e8d7cf6fd49c86c9ff2b8d67eec5^f8ae30b2471f92538d4bd2d211151910b9455c3f_0.app.managementwebsite.tpl.php(89): PKPTemplateManager->smartyCallHook(Array, Object(Smarty_Internal_Template))\n#5 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(248): Block_122253909262bb68fb2f55f7_34245188->callBlock(Object(Smarty_Internal_Template))\n#6 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(184): Smarty_Internal_Runtime_Inheritance->callBlock(Object(Block_122253909262bb68fb2f55f7_34245188), Object(Smarty_Internal_Template))\n#7 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(186): Smarty_Internal_Runtime_Inheritance->process(Object(Smarty_Internal_Template), Object(Block_122253909262bb68fb2f55f7_34245188), Object(Block_190722031962bb68fb342e63_78417148))\n#8 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(156): Smarty_Internal_Runtime_Inheritance->process(Object(Smarty_Internal_Template), Object(Block_190722031962bb68fb342e63_78417148))\n#9 /ebs/ojs/twj/cache/t_compile/77c4afd9cd56e8d7cf6fd49c86c9ff2b8d67eec5^164bd5a4f3891532cf93e9d19911fe9cb3308efd_0.app.layoutsbackend.tpl.php(234): Smarty_Internal_Runtime_Inheritance->instanceBlock(Object(Smarty_Internal_Template), 'Block_190722031...', 'page')\n#10 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_62bb68fb349862_19399619(Object(Smarty_Internal_Template))\n#11 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))\n#12 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))\n#13 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()\n#14 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php(116): Smarty_Internal_Template->_subTemplateRender('layouts/backend...', NULL, '77c4afd9cd56e8d...', 0, 3600, Array, 2, false, NULL, NULL)\n#15 /ebs/ojs/twj/cache/t_compile/77c4afd9cd56e8d7cf6fd49c86c9ff2b8d67eec5^f8ae30b2471f92538d4bd2d211151910b9455c3f_0.app.managementwebsite.tpl.php(33): Smarty_Internal_Runtime_Inheritance->endChild(Object(Smarty_Internal_Template), 'layouts/backend...')\n#16 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_62bb68fb315471_90475968(Object(Smarty_Internal_Template))\n#17 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))\n#18 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))\n#19 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render(false, 1)\n#20 /ebs/ojs/twj/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, '77c4afd9cd56e8d...', NULL, 1)\n#21 /ebs/ojs/twj/lib/pkp/classes/template/PKPTemplateManager.inc.php(1187): Smarty_Internal_TemplateBase->display('management/webs...', NULL, '77c4afd9cd56e8d...', NULL)\n#22 /ebs/ojs/twj/lib/pkp/pages/management/ManagementHandler.inc.php(202): PKPTemplateManager->display('management/webs...')\n#23 /ebs/ojs/twj/lib/pkp/pages/management/ManagementHandler.inc.php(69): ManagementHandler->website(Array, Object(Request))\n#24 /ebs/ojs/twj/lib/pkp/classes/core/PKPRouter.inc.php(395): ManagementHandler->settings(Array, Object(Request))\n#25 /ebs/ojs/twj/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)\n#26 /ebs/ojs/twj/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route(Object(Request))\n#27 /ebs/ojs/twj/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))\n#28 /ebs/ojs/twj/index.php(68): PKPApplication->execute()\n#29 {main}\n thrown in /ebs/ojs/twj/lib/pkp/classes/components/forms/FormComponent.inc.php on line 272...

ronste commented 2 years ago

Hi @nwoodward ,

unfortunately I still can't reproduce this error on my system. However, your error log gave me a clue on what might be the problem. I updated the repo accordingly. But I am not able to tell if this update fixes the error. Just a guess ...

Could you try to install the plugin from the repo and not from the plugin gallery?

To do this: 1) Please uninstall th plugin via the plugin gallery. 2) Clone the repo (https://github.com/ojsde/shariff/tree/stable-3_3_0) into your OJS plugin/generic folder 3) From the OJS folder run php lib/pkp/tools/installPluginVersion.php plugins/generic/shariff/version.xml

If this fixes the error I will prepare a new relase for the plugin gallery.

By the way, what PHP version are you using?

Best wishes, Ronald

nwoodward commented 2 years ago

Hi @ronste, OK, I'll attempt to install the plugin from the repo and let you know how it goes. I'm using PHP 8.0.18.

Thanks, Nick

noemiejamar commented 1 year ago

Your fix made the trick! Thanks @ronste !

I personally use php 8.0.21 (guess it was due to php 8 ? it was working with php 7.4)

ronste commented 1 year ago

Your fix made the trick! Thanks @ronste !

I personally use php 8.0.21 (guess it was due to php 8 ? it was working with php 7.4)

Yes, indeed. There was a warning in PHP 7 which in PHP 8 is now handled as an error.

I published a new release and submitted it to the plugin gallery. Should be available there soon.