Fixed CLI add-on importer doesn't delete orphaned data if folder is empty

Jon W

Well-known member
Affected version
2.0.10
If I'm developing an add-on with someone else and sharing my _output folder in a git repository or similar, there is currently no way for me to indicate that I have removed all items of a type (e.g. all admin navigation items), and I am forced to leave a dummy item behind.

If I have an add-on in developer mode and I delete one of the folders in my _output folder and then run:
Bash:
php cmd.php xf-dev:import --addon
I would expect the add-on content in the folder I just deleted to be removed from my add-on.

However, when I then run:
Bash:
php cmd.php xf-dev:export --addon
it magically comes back again.

Is this intentional?

If so, would it be possible to create a way to achieve what I want to achieve. For example, if instead of deleting the folder I remove everything in it and put an empty (except for {}) _metadata.json file, the same thing still happens.
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XF release (2.0.12).

Change log:
Fix add-on development data not being removed as expected when the last entry of a type has been removed. (The metadata JSON file must still exist.)
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom