Failed Ajax request or invalid JSON returned when installing plugin

Hi all,
With fresh install of ojs 3.1, I have the notification when installing plugin from plugin gallery.

@asmecher

@kawahyu, what plugin do you try to install, or it happens for all of them? What do you see in your error log, or maybe even in the browser development tools ?

I tried installing all available plugins in the gallery especially Piwik.
Here is the current error log

[06-Nov-2017 14:14:13 UTC] PHP Fatal error: Call to a member function getId() on null in /home/k1504467/public_html/cache/t_compile/ff43eca8db86ec49781254a586e22b16a0ddd1d6^%%9B^9B0^9B0BB3F9%%linkAction.tpl.php on line 7

Hmmm… What is on that like in that file?
Maybe you could also try to clear the cache and try again?

I have cleared caches, nothing changes
image

And how does that code line the error point to look like?

Sorry, I do not understand “code line”. Would you mind to explain it?

Hi @kawahyu

You wrote that you get this error:

[06-Nov-2017 14:14:13 UTC] PHP Fatal error: Call to a member function getId() on null in /home/k1504467/public_html/cache/t_compile/ff43eca8db86ec49781254a586e22b16a0ddd1d6^%%9B^9B0^9B0BB3F9%%linkAction.tpl.php on line 7

So I asked you to take a look at that file /home/k1504467/public_html/cache/t_compile/ff43eca8db86ec49781254a586e22b16a0ddd1d6^%%9B^9B0^9B0BB3F9%%linkAction.tpl.php, line number 7.

Best,
Bozana

Thanks @bozana
Here is the line 7

<?php $this->assign('staticId', ((is_array($_tmp=$this->_tpl_vars['contextId'])) ? $this->_run_mod_handler('concat', true, $_tmp, "-", $this->_tpl_vars['action']->getId(), "-button") : $this->_plugins['modifier']['concat'][0][0]->smartyConcat($_tmp, "-", $this->_tpl_vars['action']->getId(), "-button"))); ?>

Aaaa… I figured it out – you are accessing the plugin gallery as journal manager, not as admin…
@asmecher, should journal managers be able to install the plugins from the plugin gallery?

Journal managers should be able to see the plugin info, so I created this GitHub Issue to fix that: viewPlugin in the plugin gallery for journal managers · Issue #3066 · pkp/pkp-lib · GitHub

Hi all,

Journal managers should be able to look at plugins in the gallery, but not install them unless they are Site Administrators.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @bozana @asmecher
As an admin, I tried installing Piwik plugin. When I clciked OK button, nothing happens

image

http://ulumuna.or.id/index.php/ujis/management/settings/website# popped up at the left bottom corner mozilla browser

Hi @kawahyu,

Check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher
Here is the error logs

[18-Nov-2017 05:11:01 UTC] PHP Warning: copy(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/k1504467/public_html/lib/pkp/classes/file/FileManager.inc.php on line 159
[18-Nov-2017 05:11:01 UTC] PHP Warning: copy(https://github.com/pkp/piwik/releases/download/ojs-3_1_0-0/piwik-ojs-3_1_0-0.tar.gz): failed to open stream: no suitable wrapper could be found in /home/k1504467/public_html/lib/pkp/classes/file/FileManager.inc.php on line 159
[18-Nov-2017 05:11:01 UTC] ojs2: Incorrect MD5 checksum!
[18-Nov-2017 05:11:02 UTC] PHP Warning: copy(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/k1504467/public_html/lib/pkp/classes/file/FileManager.inc.php on line 159
[18-Nov-2017 05:11:02 UTC] PHP Warning: copy(https://github.com/pkp/piwik/releases/download/ojs-3_1_0-0/piwik-ojs-3_1_0-0.tar.gz): failed to open stream: no suitable wrapper could be found in /home/k1504467/public_html/lib/pkp/classes/file/FileManager.inc.php on line 159
[18-Nov-2017 05:11:02 UTC] ojs2: Incorrect MD5 checksum!

Hi @kawahyu,

You need to enable the https stream wrapper in your PHP configuration. See e.g. this StackOverflow thread.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Most Json errors are caused by the display_errors = On entry in the config.inc.php file.
Setting display_errors=Off the problem should disappear