-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[6.1] Allow the module updater to automatically delete obsolete files #46474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 6.1-dev
Are you sure you want to change the base?
Conversation
|
As it is a new feature, this PR has to be rebased to 6.1-dev. |
4f873f2 to
672d920
Compare
Added a property to track old installed files for updates. This allows the parseFiles() method to automatically remove deleted files. Same code is already used in plugin and component adapter.
672d920 to
5e56f68
Compare
Done, but I think I broke the CI and you need to restart it :-) |
@Bakual The easiest way to fix that is to commit a change. I've allowed myself to apply a necessary change (use |
|
Perfect, thanks! |
joomla/joomla-cms#46474 created to add this feature to Joomla itself (like components and plugins already have)
* Adjust to "new" MVC and namespacing Sermonspeaker classes. * More adjusting to namespaced application * More namespacing * Namespacing Frontend * Last Namespacing work for component * Renamed metadata.xml to default.xml * metadata.xml still needed for menutypes * \stdClass * Renaming catid parameter in menuitems to specify sermons/series/speakers. Menuitem may have to be reset/resaved for properly working. Fallback to saved catid parameter. * Namespace Tables * Remove Non-Flash Uploader * getUser is deprecated * Remove unused language string * Adding frontend icons * getInstance is deprecated * getTable is needed for frontend editing * $id -> $pk * Blog serie title wasn't linked * Cleanup * Remove unused CSS * Inconsistent return points * Needs to be getUser since getIdentity can't load a user by id. * Inconsistent Return point * Use namespaced classes * Return value isn't used * Boolean expression can be simplified * Remove redundant parameters (default value) * Ternary * Unnecessary return/continue * Unnecessary local variable * unnecessary pass-by-ref * coaslesce * one isset is enough * Replace str* calls * switch -> match * unneeded type cast * Remove curly braces * Remove qualifier * Duplicate * If controls with common parts * $array to $src * return is unneeded * Remove require_once as class are namespaced and autoloaded * $array to $src * Pointless * Undefined classes * Remove legacy router code * Import classes * remove JComments integration (JComments isn't available for J5 and J6) * Removing autotweet from repo * Removing autotweet from repo * Remove language strings related to JComments * Use namespaced classes * Use namespaced classes * Duplicate files * No longer needed * Adjust manifest file * Remove require_once as classes are autoloaded * Remove JLoader as classes are autoloaded * Standardize on namespace * Adding namespace to module manifests * Codestyle * Working on namespacing mod_latestsermons * Adding provider and dispatcher classes * Add new folders to manifest * Module works * Check if icon service is already loaded * CS * Rewrite to new MVC and namespaces * Rewrite to new MVC and namespaces * Declare the variables * Adjust manifest * Latestsermons ofc * Typos * Return false when no sermons are found (resulting in the module not displaying) * Ensure $id is not null * Fixed carousel * Namespacing mod_sermonarchive * Remove reference to SermonSpeaker 4.3 version * Codestyle * Namespacing * Remove unused code * Codestyle * Namespace sermoncast * Remove unneeded references * Remove file * Use namespaced fields * Fix namespace * Namespaced mod_sermonspeaker * Name space admin module * Move images to media folder * Moving to my own icon class * Move to new MVC * Finishing new MVC work on mod_sermonspeaker_categories * Namespacing mod_sermonupload * Namespaced content plugin * Namespaced editor plugin * Namespaced finder plugin * Namespaced quickicon plugin * Namespaced search plugin * Namespace mediaelement plugin * Trying to namespace base plugin (may fail due to case sensitivity) * Adjust naming to standard * Namespacing Vimeo * Namespacing generic player plugin * Namespacing jwplayer7 player plugin * Fixing Vimeo plugin * Standardizing Vimeo parameter * Adding script to modules to delete obsolete files. joomla/joomla-cms#46474 created to add this feature to Joomla itself (like components and plugins already have) * Change copyright to 2025 Release date to 2025-11-21 * Composer Update * Raising version
The installer for components and plugins already automatically delete files, which are no longer present in the extension manifest. The module installer doesn't do that for some reason.
This PR proposes to add this functionality as I think it's a helpful feature for extension developers. Otherwise one has to manage a script file to delete no longer used files.
Summary of Changes
Added a property to track old installed files for updates.
This allows the parseFiles() method to automatically remove deleted files.
The Same code is already used in plugin and component adapter.
Testing Instructions
Install a module which used to have a file or folder that got deleted. Make sure it's an update (the module was already installed before).
You can fake such a module by taking any module and remove a file or folder line in the manifest and then install it.
Actual result BEFORE applying this Pull Request
The removed files or folder in the manifest are still present on the webserver after the update
Expected result AFTER applying this Pull Request
The removed files or folder in the manifest are deleted on the webserver after the update
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed