Unable to Delete Plugins

Description of issue or problem I’m having:
Cannot delete plugins using the “delete” link provided in “website/installed plugins”
The following error message is given:

[php7:error] [pid 22033] [client 134.95.147.149:59278] PHP Fatal error:  Uncaught Error: Call to a member function getFilePath() on null in /var/www/html/lib/pkp/controllers/grid/plugins/form/UploadPluginForm.inc.php:83\nStack trace:\n#0 /var/www/html/lib/pkp/classes/controllers/grid/plugins/PluginGridHandler.inc.php(334): UploadPluginForm->execute()\n#1 /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php(395): PluginGridHandler->saveUploadPlugin(Array, Object(Request))\n#2 /var/www/html/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)\n#3 /var/www/html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))\n#4 /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))\n#5 /var/www/html/index.php(68): PKPApplication->execute()\n#6 {main}\n\nNext Error: Call to a member function getId() on null in /var/www/html/lib/pkp/controllers/grid/plugins/form/UploadPluginForm.inc.php:88\nStack trace:\n#0 /var/www/html/lib/pkp/classes/controllers/g in /var/www/html/lib/pkp/controllers/grid/plugins/form/UploadPluginForm.inc.php on line 88

This probably relates to

$temporaryFileManager->deleteById($temporaryFile->getId(), $user->getId());

Since I’m logged in, the problem is with $temporaryFile->getId().
I tested this with two different plugins on different installations with the same OJS version.
File permissions for the plugin folder are set to 755.

While one could delete the folder directly via the command line, the same error occurs when updating a plugin via “upload a new plugin”.

Steps I took leading up to the issue:

  1. Installed a plugin.
  2. deleted the plugin via the “delete” link provided in “website/installed plugins”
  3. folder still exists

Application Version - e.g., OJS 3.1.2:

OJS 3.3.0.8

Hi @felixhelix,

Are you able to upload or install a new plugin? Maybe it’s a permissions issue.

Best,
Josh

Hi @jnoronha,

yes, installing plugins works. It’s just deleting and updating via the manual upload.

Best,
Felix

Hi @jnoronha,

also updating plugins via the gallery works: I just updated the ORCID profile plugin from v.1.1.3.1 to 1.1.3.2 without problems.

Best,
Felix

Cross-posted: OJS: Unable to Delete Plugins · Issue #8087 · pkp/pkp-lib · GitHub

@felixhelix, with OJS 3.3.0-11 I’m unable to replicate this issue. I’m confused about the error coming from UploadPluginForm.inc.php; that shouldn’t be involved in deleting a plugin that’s already been installed. The code for deleting a plugin is in PluginGridHandler.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi all,
I tried to replicate the problem on our development server again, and it turned out that I can successfully install and delete plugins now: by means of the gallery as well as by uploading the plugin files.
So this issue can be closed.
Thanks and sorry for the hassle,
Felix

Hi @felixhelix,

Not a problem!

Regards,
Alec Smecher
Public Knowledge Project Team