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

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

Hi @asmecher,

It is that this json has 84000 characters and the editor allows only 32000.

Equally as soon as I activate the PLN plugin, and I try to open the plugins link, it keeps loading and never ends and the following error appears:

200.24.17.147 - - [04/Aug/2020:15:53:59 -0500] “GET /index.php/pruebas_diego/$$$call$$$/grid/settings/plugins/settings-plugin-grid/manage?verb=settings&plugin=plnplugin&category=generic&_=1596574377542 HTTP/1.1” 500 444 “https://revistas.udea.edu.co/index.php/pruebas_diego/management/settings/website” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36”

And when I am clicking on PLN plugin settings, I get the following error:

Hi @diegomejia07,

Before I debug further – have you installed the Archive_Tar PEAR module? The PKP|PN plugin requires this.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello all,

I have the same problem, after installing the PKP PN plugin I get the AJAX error,

The error log file gives me the following error

[05-Aug-2020 15:41:15 UTC] PHP Fatal error: require_once(): Failed opening required '/home/jastt2/public_html/lib/pkp/classes/helpers/PKPCurlHelper.inc.php' (include_path='.:/opt/cpanel/ea-php73/root/usr/share/pear') in /home/jastt2/public_html/lib/pkp/includes/functions.inc.php on line 25

also, I’ve updated the PLNPlugin.inc.php file and changed the following code

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

So, any update about this issue?

BTW, the Pear module and Zip extension are both installed on the server.

The OJS version I’m using is: 3.2.1.1 and PKP PN V 2.0.3.1 2020.07.21

Thanks in advance and kind regards,
Jacksi

Hi @KarwanJacksi,

Are you sure you’re using OJS 3.2.1-1? It should definitely include a lib/pkp/classes/helpers/PKPCurlHelper.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry for the incorrect mention of PKP PN version. It is pln-v2.0.1-0.

Yes, I do, it is the latest version released. Current Production Release (June 26, 2020)

So, any idea about that? I still get the AJAX error with the above PHP fatal error. When I disable the PN Plugin, there is no fatal error in the PHP log file.

Kind regards,
Jacksi

Hi @KarwanJacksi,

I think the file lib/pkp/classes/helpers/PKPCurlHelper.inc.php is missing from your installation. You can get it from the .tar.gz download corresponding to the version of OJS that you’re running.

Regards,
Alec Smecher
Public Knowledge Project Team