? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
31 Jul 2021

Pull Request for Issue #34992.

Summary of Changes

Currently, if we uninstall a plugin which was deleted for some reasons (or at least the manifest file was deleted), we will get fatal error because in the PluginAdater, we have code which didn't handle the case manifest not found.

This PR just adds some check to prevent these fatal error and allows these plugins still be uninstalled properly (mean the folder being deleted, the record is deleted from extensions table).

I think we can do it better. For example, in getElement, we can just return $this->extension->folder (it's plugin group) and in the code to detect plugin group, we can use $this->extension->folder, too, instead of getting these information from manifest object. But this is just handle some special case, so I think it is fine.

Testing Instructions

  1. Try to delete a plugin folder (or delete the xml file of that plugin)
  2. Uninstall that plugin
  3. Before patch: you will get fatal error
  4. After patch, the plugin will be uninstalled. Joomla also shows a warning to tell users that manifest not found.
avatar joomdonation joomdonation - open - 31 Jul 2021
avatar joomdonation joomdonation - change - 31 Jul 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jul 2021
Category Libraries
avatar richard67 richard67 - test_item - 31 Jul 2021 - Not tested
avatar richard67
richard67 - comment - 31 Jul 2021

Grr, I had forgotten to select test result.

avatar richard67 richard67 - test_item - 31 Jul 2021 - Tested successfully
avatar richard67
richard67 - comment - 31 Jul 2021

I have tested this item successfully on 2e02c39

If complete folder is missing, a warning alert "Joomla\CMS\Filesystem\Folder::delete: Path is not a folder." is shown.

If only the manifest XML is missing, a warning alert "JInstaller: :Install: Can't find XML setup file." is shown.

In both cases the plugin has been properly uninstalled.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34996.

avatar alikon alikon - test_item - 31 Jul 2021 - Tested successfully
avatar alikon
alikon - comment - 31 Jul 2021

I have tested this item successfully on 2e02c39


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34996.

avatar alikon alikon - change - 31 Jul 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 31 Jul 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34996.

avatar richard67
richard67 - comment - 31 Jul 2021

@wilsonge I'd like to have that in 4.0 so I've set the 4.0 milestone.

avatar wilsonge wilsonge - close - 2 Aug 2021
avatar wilsonge wilsonge - merge - 2 Aug 2021
avatar wilsonge wilsonge - change - 2 Aug 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-08-02 09:31:02
Closed_By wilsonge
Labels Added: ? ?
avatar wilsonge
wilsonge - comment - 2 Aug 2021

Fair enough. I'm down with that. Thankyou!

Add a Comment

Login with GitHub to post a comment