4

When I try to initiate tasks on uninstall the tasks fail because the plugin completes uninstalling before the tasks. The task is referencing an uninstalled plugin at that point. Once the plugin is uninstalled I get this error:

Encountered an error running task 23 (xxxx): Could not find the task component type.

Which makes sense. However, uninstall takes a long time because there are many things needing clean up so is there any way I can have tasks continue to work after the plugin is uninstalled?

4

I can't think of an existing way to do this (other than something ugly like have a separate plugin whose sole job is to clean up the data from the first).

I think this would make the case for things like onBeforePluginUninstall, onPluginUninstall, onBeforePluginInstall, onPluginInstall, onBeforePluginDeactivate, etc. events to be added so that you could listen for these events and have time to do all of the cleanup necessary before uninstallation continues.

Probably worth adding as a feature request and linking to this thread!

| improve this answer | |
  • 1
    Solid answer. Even with this though, tasks would still be the wrong approach. The plugin would need to run all of its cleanup before the plugin has finished uninstalling... otherwise you'd bump into the same issue. – Lindsey D Oct 21 '15 at 16:18
  • Yeah - agreed... – Brad Bell Oct 21 '15 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.