[OJS 3.1.2] PKP PN Plugin error - Failed Ajax request or invalid JSON returned [close]

I activated from the Pugins Gallery section, the PKP PN Plugin but i have error Failed Ajax request or invalid JSON returned.

GET /$$$call$$$/grid/settings/plugins/settings-plugin-grid/manage?verb=settings&plugin=plnplugin&category=generic&_=1595520705874

And after activating it, it doesn’t let me list the plugins either and I get the following error

/$$$call$$$/grid/settings/plugins/settings-plugin-grid/fetch-grid?_=1595521522586

Hi @diegomejia07,

Is anything relevant in your PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

In the logs nothing registers me, but clicking on settings in the PKP PN plugin and inspecting the page shows me the following error

jquery.min.js
/$$$call$$$/grid/settings/plugins/settings-plugin-grid/manage?verb=settings&plugin=plnplugin&category=generic&_=1595528386716 500 (Internal Server Error)

Hi @diegomejia07,

If you see a 500 error, there should definitely be something in the server logs; I’d suggest double-checking. Another question: do you have the ZipArchive PHP extension installed?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Yes, the extension is installed on my server

image

Hi @diegomejia07,

Were you able to double-check the PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

This is what the error log shows, and there are no errors. They are all warnings

[Thu Jul 23 14:09:22.204068 2020] [php7:warn] [pid 19037] [client 190.28.126.145:51835] PHP Warning: Declaration of DRIVERDAO::setOAI(&$oai) should be compatible with PKPOAIDAO::setOAI($oai) in /var/www/html/site.revistas.udea.edu.co/plugins/generic/driver/DRIVERDAO.inc.php on line 19, referer: https://revistas.udea.edu.co/index.php/red
[Thu Jul 23 14:09:22.209244 2020] [php7:warn] [pid 19013] [client 31.127.226.65:64906] PHP Warning: Declaration of CoinsPlugin::register($category, $path) should be compatible with LazyLoadPlugin::register($category, $path, $mainContextId = NULL) in /var/www/html/site.revistas.udea.edu.co/plugins/generic/coins/CoinsPlugin.inc.php on line 0, referer: https://revistas.udea.edu.co
[Thu Jul 23 14:09:22.322048 2020] [php7:warn] [pid 19013] [client 31.127.226.65:64906] PHP Warning: Declaration of RegistrationHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in /var/www/html/site.revistas.udea.edu.co/lib/pkp/pages/user/RegistrationHandler.inc.php on line 19, referer: https://revistas.udea.edu.co
[Thu Jul 23 14:09:22.422257 2020] [php7:warn] [pid 19013] [client 31.127.226.65:64906] PHP Warning: Declaration of RegistrationForm::validate() should be compatible with Form::validate($callHooks = true) in /var/www/html/site.revistas.udea.edu.co/lib/pkp/classes/user/form/RegistrationForm.inc.php on line 21, referer: https://revistas.udea.edu.co
[Thu Jul 23 14:09:22.423616 2020] [php7:warn] [pid 19030] [client 45.65.220.232:14238] PHP Warning: Declaration of AddThisPlugin::register($category, $path) should be compatible with LazyLoadPlugin::register($category, $path, $mainContextId = NULL) in /var/www/html/site.revistas.udea.edu.co/plugins/generic/addThis/AddThisPlugin.inc.php on line 0, referer: https://revistas.udea.edu.co/index.php/rccp/issue/view/2434
[Thu Jul 23 14:09:22.618426 2020] [php7:warn] [pid 19011] [client 54.36.148.50:15978] PHP Warning: Declaration of AddThisPlugin::register($category, $path) should be compatible with LazyLoadPlugin::register($category, $path, $mainContextId = NULL) in /var/www/html/site.revistas.udea.edu.co/plugins/generic/addThis/AddThisPlugin.inc.php on line 0

Hi @diegomejia07,

There might be quite a few warnings, hiding an error further up in the log file. I’d recommend loading the request that causes the 500 error, and immediately checking the log, watching for only the new entries corresponding to the current time. (Newer releases of OJS have fewer warnings to get lost in.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

This is definitely not logged in the php logs as an error. Carefully review their logs and warnings, and nothing is displayed.

What else could I do.

Hi @diegomejia07,

Try removing the error-suppressing @ character in plugins/generic/PLNPlugin.inc.php around line 376 by changing:

if(!@include_once('Archive/Tar.php')) {

…to…

if(include_once('Archive/Tar.php')) {

Then trigger the error again, and check the log to see if something appears now.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

The following is shown:

Notice : Deprecated call without request object. in /var/www/html/site.revistas.udea.edu.co/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 873

Uncaught SyntaxError: Unexpected token < in JSON at position 0
at Function.parse [as parseJSON] ()
at a.pkp.controllers.TabHandler.dataFilter (pkp.min.js:199)
at Object.dataFilter (pkp.min.js:111)
at Ut (jquery.min.js:2)
at k (jquery.min.js:2)
at XMLHttpRequest. (jquery.min.js:2)

Hi @diegomejia07,

It looks like the request that fetches the plugin gallery is returning invalid JSON. I’d suggest using your web browser’s web developer tools to inspect that response and see if you can find where the illegal content is.

Regards,
Alec Smecher
Public Knowledge Project Team

Is there any resolution of this error- ‘Failed Ajax or Invalid JSON’?

Hi @hannanhazari,

Check the responses already listed on this thread and report back what the results were.

Regards,
Alec Smecher
Public Knowledge Project Team

No errors shown in Browser web console.
In PHP error log, I got 3 relevant errors

PHP Fatal error: Call to undefined method PLNPlugin::getTemplateResource() in /home/qamevedq/amphysiol.com/plugins/generic/pln/PLNGatewayPlugin.inc.php on line 165
PHP Fatal error: Call to undefined method PLNPlugin::getTemplateResource() in /home/qamevedq/amphysiol.com/plugins/generic/pln/classes/form/PLNStatusForm.inc.php on line 33
PHP Fatal error: Call to undefined method PLNPlugin::getTemplateResource() in /home/qamevedq/amphysiol.com/plugins/generic/pln/classes/form/PLNSettingsForm.inc.php on line 31

Hi @hannanhazari,

What version of OJS are you using, and what version of the PKP PN plugin?

Regards,
Alec Smecher
Public Knowledge Project Team

I am using OJS version 3.1.0.1 and PKP PN plugin version 3.1.2.

Below are the shared hosting server specifications:

OS platform Linux
PHP version 5.6.40
Apache version Apache
Database driver mysql
Database server version 10.3.23-MariaDB-log-cll-lve

Hi @hannanhazari,

I suspect you have the PKP PN plugin version wrong – it should be something starting with 2.

However, I think the problem is that you’re using an OJS version that’s too old for the PKP PN plugin. You’ll need to upgrade to at least OJS 3.1.2.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

This is the show,

{“status”:true,“content”:"<a href="#" class=“requestHelpPanel pkp_help_link pkp_help_tab” data-topic=“settings.md#website”>\n\t<span class=“fa fa-info-circle pkpIcon–inline” aria-hidden=“true”></span>\n\t\t\tAyuda\n\t</a>\n\n\n<script type=“text/javascript”>\n\t// Attach the JS file tab handler.\n\t$(function() {\n\t\t$(’#pluginsTabs’).pkpHandler(’$.pkp.controllers.TabHandler’);\n\t});\n</script>\n\n<div id=“pluginsTabs” class=“pkp_controllers_tab”>\n\t

    \n\t\t
  • <a href="#installedPluginsDiv">M\u00f3dulos instalados</a></li>\n\t\t
  • <a href="#pluginGalleryDiv">Galer\u00eda de m\u00f3dulos</a></li>\n\t</ul>\n\t<div id=“installedPluginsDiv”>\n\t\t\t\t\n\t// Initialise JS handler.\n\t$(function() {\n\t\t$(’#pluginGridContainer’).pkpHandler(\n\t\t\t’$.pkp.controllers.UrlInDivHandler’,\n\t\t\t{\n\t\t\t\tsourceUrl: “https:\/\/revistas.udea.edu.co\/index.php\/pruebas_diego\/$$$call$$$\/grid\/settings\/plugins\/settings-plugin-grid\/fetch-grid”,\n\t\t\t\trefreshOn: null\n\t\t\t}\n\t\t);\n\t});\n</script>\n\n<div id=“pluginGridContainer”><div class=“pkp_loading”>\n\t<span class=“pkp_spinner”></span>\n\t<span class=“message”>Cargando</span>\n</div>\n</div>\n\n\t</div>\n\t<div id=“pluginGalleryDiv”>\n\t\t\t\t\n\t// Initialise JS handler.\n\t$(function() {\n\t\t$(’#pluginGalleryGridContainer’).pkpHandler(\n\t\t\t’$.pkp.controllers.UrlInDivHandler’,\n\t\t\t{\n\t\t\t\tsourceUrl: “https:\/\/revistas.udea.edu.co\/index.php\/pruebas_diego\/$$$call$$$\/grid\/plugins\/plugin-gallery-grid\/fetch-grid”,\n\t\t\t\trefreshOn: null\n\t\t\t}\n\t\t);\n\t});\n</script>\n\n<div id=“pluginGalleryGridContainer”><div class=“pkp_loading”>\n\t<span class=“pkp_spinner”></span>\n\t<span class=“message”>Cargando</span>\n</div>\n</div>\n\n\t</div>\n</div>\n",“elementId”:“0”,“events”:null}

Hi @diegomejia07,

You’ll have to use code quoting tools to post that in this forum, or it won’t come through clearly – use the image button.

Regards,
Alec Smecher
Public Knowledge Project Team