Jump to content

Recommended Posts

Posted

Hi, simple (?) question - how to cancel module uninstall in ___uninstall method? Return false doesn't work, should I throw some kind of Exception?

Posted

___uninstall is hookable. You could write a before hook that will replace the uninstall

This example is for $this->pages but you can change that to your needs

public function init() {
    $this->pages->addHookBefore('uninstall', $this, 'myUninstall');
}

public function myUninstall(HookEvent $event) {
    // replace original method
    $event->replace = true;
}
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...