PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
27 Jun 2023

Pull Request for Issue # .

Summary of Changes

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.

Testing Instructions

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.

Actual result BEFORE applying this Pull Request

2023-06-27_j5-error-on-update

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.

Expected result AFTER applying this Pull Request

Update succeeds without PHP notices and without the alert about deleting the folder.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 27 Jun 2023
Category Administration com_admin Repository
avatar richard67 richard67 - open - 27 Jun 2023
avatar richard67 richard67 - change - 27 Jun 2023
Status New Pending
avatar richard67 richard67 - change - 27 Jun 2023
The description was changed
avatar richard67 richard67 - edited - 27 Jun 2023
avatar richard67 richard67 - change - 27 Jun 2023
The description was changed
avatar richard67 richard67 - edited - 27 Jun 2023
avatar HLeithner HLeithner - close - 27 Jun 2023
avatar HLeithner HLeithner - merge - 27 Jun 2023
avatar HLeithner HLeithner - change - 27 Jun 2023
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
avatar richard67
richard67 - comment - 22 Jul 2023

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 file deleted_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.

Add a Comment

Login with GitHub to post a comment