Fixed Class extensions for uninstalling add-on still enabled during uninstall

Xon

Well-known member
Affected version
2.0 Beta 1
I'm adding a relationship to User entity to a new entity (and thus table), and on the last uninstall step of the add-on removing the tables.

This works fine in the CLI uninstaller, but the GUI blows up with the following:

An exception occurred: [XF\Db\Exception] MySQL statement prepare error [1146]: Table 'xf2.xf_sv_rating_cache_User' doesn't exist in /var/www/sites/xf2.sufficientvelocity.com/html/src/XF/Db/AbstractStatement.php on line 183
  1. XF\Db\AbstractStatement->getException() in /var/www/html/src/XF/Db/Mysqli/Statement.php at line 34
  2. XF\Db\Mysqli\Statement->prepare() in /var/www/sites/html/src/XF/Db/Mysqli/Statement.php at line 44
  3. XF\Db\Mysqli\Statement->execute() in /var/www/sites/html/src/XF/Db/AbstractAdapter.php at line 67
  4. XF\Db\AbstractAdapter->query() in /var/www/sites/html/src/XF/Mvc/Entity/Finder.php at line 1074
  5. XF\Mvc\Entity\Finder->fetchOne() in /var/www/sites/html/src/XF/Mvc/Entity/Manager.php at line 131
  6. XF\Mvc\Entity\Manager->find() in /var/www/sites/html/src/XF/Repository/User.php at line 25
  7. XF\Repository\User->getVisitor() in /var/www/sites/html/src/XF/App.php at line 1434
  8. XF\App->getVisitorFromSession() in /var/www/sites/html/src/XF/Admin/App.php at line 52
  9. XF\Admin\App->start() in /var/www/sites/html/src/XF/App.php at line 1767
  10. XF\App->run() in /var/www/sites/html/src/XF.php at line 319
  11. XF::runApp() in /var/www/sites/html/admin.php at line 13

I inject a getStructure() function via class extension, which is being called after the add-on uninstaller code has run, but \XF::app()->repository('XF:AddOn')->getEnabledAddOns() doesn't actually return the add-on!
 
Last edited:
This should be fixed for the next release. There was a logic flaw that effectively meant that some add-on data would get temporarily enabled when the add-on was uninstalled.
 
Top Bottom