modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 528 forks source link

Elements in categories not being removed on uninstall #10938

Closed BobRay closed 14 years ago

BobRay commented 14 years ago

bobray created Redmine issue ID 10938

When I uninstall a package that has snippets and chunks in a category (using the remove all versions option), the resources and lexicon entries are removed, but none of the elements are removed. No messages appear in the console related to the elements. This happens with: Formit Login SPForm For Wayfinder and Ditto, which don't put their elements in categories, everything works as it should and there are messages confirming the removal of the elements. It may also be because Wayfinder and Ditto each have only one element rather than multiple elements, but I suspect the categories are the culprit.

opengeek commented 14 years ago

opengeek submitted:

xPDOObjectVehicle::uninstall() does not currently attempt to uninstall any related objects that are installed as part of the vehicle. A category does not have a composite relationship to any of the Element classes you are packaging with it as related objects, and so those are not automatically removed when the vehicle is uninstalled. The problem here is that in a majority of cases, related objects installed in a single vehicle will be composites of the parent object and will automatically be removed if the parent object is. So we don't want the uninstall to try and remove objects that are already removed with the parent object, or we'll get false errors. However, it should be possible to detect aggregate related objects and remove those in the uninstall while ignoring the composite relations. I'll probably add an attribute that can make this aggregate related object removal functionality optional (on by default). You can wait for this functionality to be added, or you can build your projects with the Category in one vehicle and the Elements in their own separate vehicles. However, if you do the latter, you will need to use a php resolver to add the Elements to the Category (like you would register a Plugin with an Event), and make sure you package the Category into the Transport first.

splittingred commented 14 years ago

splittingred submitted:

Fixed in r6372

BobRay commented 14 years ago

bobray submitted:

Confirmed fixed.