akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Joomla not calling library script file on uninstall #568

Closed tampe125 closed 8 years ago

tampe125 commented 8 years ago

Sadly, Joomla is not invoking the script file while uninstalling a library. This means that all our dependencies checks are ignored and the files are blindly deleted.

To be honest, I don't know what could be a possible workaround: maybe hooking to the onExtensionBeforeUninstall, but it seems the only way to stop the execution is to throw an exception (and AFAIK there is no try-catch bock).

Maybe we can try to add such code inside the next version of Joomla, but that would cut all the users using older versions of Joomla.

nikosdion commented 8 years ago

Um, but Joomla! 3.4 does run the script? I agree that Joomla! 3.3 and earlier didn't – 3.1 and earlier didn't even allow the script to run on installation.

tampe125 commented 8 years ago

No. Joomla 3.4 runs the script during the installation, not during the uninstall. Take a look at the source code: https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/installer/adapter/library.php#L356

tampe125 commented 8 years ago

Added workaround inside uninstallFOF method of each package using FOF30