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?

1 Answer 1

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!

2
  • 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
    Commented Oct 21, 2015 at 16:18
  • Yeah - agreed...
    – Brad Bell
    Commented Oct 21, 2015 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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