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

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

@asmecher,

I don’t have this file that you mention in my OJS 3.1.2 installation, and I download the version of this official version and the helpers folder doesn’t exist either

This is my installation

This is the downloaded installation folder

Hi @asmecher,

The Archive_Tar PEAR module, if it is installed on my server.

image

Hi @diegomejia07,

The problem you’re encountering is different than the one @KarwanJacksi is encountering (with the missing class file). In OJS 3.1.2 that file shouldn’t exist (and the plugin doesn’t try to use it).

Thanks for confirming that the Archive_Tar module is enabled and working.

Next, I’d suggest trying to capture and check the server’s JSON that it sends to your browser, which seems not to be parseable. See these instructions: OJS 3.2.1-1 error: Failed Ajax request or invalid JSON returned

Regards,
Alec Smecher
Public Knowledge Project Team

OMG!, yes that was the problem!

Thanks a lot!
Jacksi

Hi @asmecher,

I have not asked to find the error, I do not know what happens when I activate the plugin, and I really want it to work.

My version of OJS is 3.1.2.0. This plugin should work in this version?

Hi @asmecher,

I found this error, but I don’t know if it has something to do with this

PHP Fatal error:  Uncaught InvalidArgumentException: Key may not be empty in /var/www/html/site.revistas.udea.edu.co/lib/pkp/lib/vendor/firebase/php-jwt/src/JWT.php:74\nStack trace:\n#0 /var/www/html/site.revistas.udea.edu.co/pages/article/ArticleHandler.inc.php(43): Firebase\\JWT\\JWT::decode(NULL, '', Array)\n#1 /var/www/html/site.revistas.udea.edu.co/lib/pkp/classes/core/PKPRouter.inc.php(382): ArticleHandler->authorize(Object(Request), Array, Array)\n#2 /var/www/html/site.revistas.udea.edu.co/lib/pkp/classes/core/PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)\n#3 /var/www/html/site.revistas.udea.edu.co/lib/pkp/classes/core/Dispatcher.inc.php(134): PKPPageRouter->route(Object(Request))\n#4 /var/www/html/site.revistas.udea.edu.co/lib/pkp/classes/core/PKPApplication.inc.php(252): Dispatcher->dispatch(Object(Request))\n#5 /var/www/html/site.revistas.udea.edu.co/index.php(68): PKPApplication->execute()\n#6 {main}\n  thrown in /var/www/html/site.revistas.udea.edu.co/lib/pkp/lib/vendor/firebase/php-jwt/src/JWT.php on line 74

Hi @diegomejia07,

Were you able to try my debugging suggestion above?

Regards,
Alec Smecher
Public Knowledge Project Team