Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
package does not uninstall cleanly #24
a former colleague installed collective.geo.bundle on a plonesite and we removed it later in the project.
it took me a few hours to fix the portal with the following upgrade steps.
<componentregistry> <utilities> <utility interface="collective.geo.mapwidget.interfaces.IDefaultMapLayers" factory="collective.geo.mapwidget.maplayers.DefaultMapLayers" remove="True"/> </utilities> </componentregistry>
i needed an upgrade step::
def remove_components(context): # http://blog.keul.it/2013/05/how-to-make-your-plone-add-on-products.html # http://docs.plone.org/4/en/manage/troubleshooting/manual-remove-utility.html # make sure to import colletive.geo.mapwidget:default profile before so the # utility is properly registered portal = api.portal.get() sm = portal.getSiteManager() from collective.geo.mapwidget.interfaces import IDefaultMapLayers # util = sm.getUtility(IDefaultMapLayers) # getUtility did not work on my portal - problem could be fixed w/o del in my case sm.unregisterUtility(provided=IDefaultMapLayers) # del util # del sm.utilities.__dict__['_provided'][IDefaultMapLayers] # del sm.utilities._subscribers[IDefaultMapLayers]
i could not remove all registry settings via GenericSetup:
<registry> <records interface="collective.geo.settings.interfaces.IGeoSettings" remove="True" /> <records interface="collective.geo.settings.interfaces.IGeoFeatureStyle" remove="True" /> </registry>
i got the following error when running the profile::
so i wrote an upgrade step that iterates over all fields of an interface and tries to delete the records for these files (if they exist)
def remove_registryrecords(context): # can't use registry.xml purge="True" because interface contains fields # that are not present in the registry registry = getUtility(IRegistry) interfaces = [ 'collective.geo.settings.interfaces.IGeoSettings', 'collective.geo.settings.interfaces.IGeoFeatureStyle'] for iface_name in interfaces: iface = resolve(iface_name) for field_name in getFieldNames(iface): name = "%s.%s" % (iface_name, field_name) if name in registry.records: del registry.records[name] else: logger.warn("skipping non existent record:" + name)
Plone/manage_components listed some local browserlayers that i removed like so:
Since days we try to migrate an instance from Plone 4 to Plone 5 on which the collective.geo.bundle was installed. Collective.geo.bundle is unable to uninstall. Now I have found your issue and hope this will fix the "problem".
The steps outlined above require a plone addon to run the generic setup steps (componentregistry.xml and registry.xml). so if you do not know how to create an addon you'll have to hire a developer.
I'd say it takes about 4 to 6 hours to add a uninstall profile to collective geo.mapwidget. this would solve your problems and also nerves of other users running into the same troubles.
hope that helps ;-)