User tests: Successful: Unsuccessful:
Pull Request for Issue # .
With pull request (PR) #40768 , a function for uninstalling and optionally migrating extensions on update has been added to script.php, and with PR #40147 that function is used to uninstall the demo tasks plugin.
However, this results in an alert about an error when trying to delete the plugin's folder and in PHP notices at the end of the update.
The reason is that the "deleteUnexistingFiles" method is not only called from function "update" in script.php but also from the "finalisation.php" file of the update component.
That means the plugin's files and folders are deleted before the function to uninstall the plugin is executed.
We once had similar problems in 4.x when uninstalling the eos310 plugin on update, and the solution was to not include the files and folders of the plugin in the lists of deleted files and folders. See #34898 .
This PR here solves it in the same way by removing the files and folders from the deleted files and folders lists and add them as exceptions to the "deleted_file_check.php" file so they will not be added again to the lists later due to that script reporting them as to be deleted.
On a current 4.4-dev or 4.4 nightly build or 5.0.0-alpha1, set error reporting to maximum and make sure that PHP errors are logged into a file.
Update to the latest 5.0 nightly build to get the actual result, and update with the same starting conditions to the update package built by Drone for this PR to get the expected result.
In the PHP error log file:
Warning: Attempt to read property "files" on null in /home/richard/lamp/public_html/test-1/libraries/src/Installer/Adapter/PluginAdapter.php on line 291
(and others of this kind)
However, the update succeeds despite of these issues.
Update succeeds without PHP notices and without the alert about deleting the folder.
Please select:
No documentation changes for docs.joomla.org needed
No documentation changes for manual.joomla.org needed
Category | ⇒ | Administration com_admin Repository |
Status | New | ⇒ | Pending |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-06-27 15:10:27 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
PR-5.0-dev
|
I just see that excluding the files
/administrator/language/en-GB/plg_task_demotasks.ini
and/administrator/language/en-GB/plg_task_demotasks.sys.ini
in filedeleted_file_check.php
doesn't work. I should not have added them to the$filesToKeep
array and not to the$previousReleaseExclude
array, which is only working for folders but not for files. I will create a PR to fix that.