Skip to content

Conversation

@Bakual
Copy link
Contributor

@Bakual Bakual commented Nov 19, 2025

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

@richard67
Copy link
Member

As it is a new feature, this PR has to be rebased to 6.1-dev.

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.
@Bakual Bakual changed the base branch from 5.4-dev to 6.1-dev November 20, 2025 08:14
@Bakual
Copy link
Contributor Author

Bakual commented Nov 20, 2025

As it is a new feature, this PR has to be rebased to 6.1-dev.

Done, but I think I broke the CI and you need to restart it :-)
Sorry for that.

@richard67 richard67 changed the title Allow the module updater to automatically delete obsolete files [6.1] Allow the module updater to automatically delete obsolete files Nov 20, 2025
@richard67
Copy link
Member

As it is a new feature, this PR has to be rebased to 6.1-dev.

Done, but I think I broke the CI and you need to restart it :-) Sorry for that.

@Bakual The easiest way to fix that is to commit a change. I've allowed myself to apply a necessary change (use __DEPLOY_VERSION__) so we did not need a dummy change for that.

@Bakual
Copy link
Contributor Author

Bakual commented Nov 20, 2025

Perfect, thanks!

Bakual added a commit to Bakual/SermonSpeaker that referenced this pull request Nov 21, 2025
joomla/joomla-cms#46474 created to add this feature to Joomla itself (like components and plugins already have)
Bakual added a commit to Bakual/SermonSpeaker that referenced this pull request Nov 21, 2025
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants