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:
- Installed a plugin.
- deleted the plugin via the “delete” link provided in “website/installed plugins”
- folder still exists
Application Version - e.g., OJS 3.1.2:
OJS 3.3.0.8