run migrations & build assets after updating status

This commit is contained in:
Boy132 2025-11-11 14:56:08 +01:00
parent 37f9e27ac4
commit 009f6443d3

View File

@ -260,10 +260,6 @@ class PluginService
try { try {
$this->manageComposerPackages(json_decode($plugin->composer_packages, true, 512)); $this->manageComposerPackages(json_decode($plugin->composer_packages, true, 512));
$this->runPluginMigrations($plugin);
$this->buildAssets();
if ($enable) { if ($enable) {
$this->enablePlugin($plugin); $this->enablePlugin($plugin);
} else { } else {
@ -271,6 +267,10 @@ class PluginService
$this->disablePlugin($plugin); $this->disablePlugin($plugin);
} }
} }
$this->buildAssets();
$this->runPluginMigrations($plugin);
} catch (Exception $exception) { } catch (Exception $exception) {
$this->handlePluginException($plugin, $exception); $this->handlePluginException($plugin, $exception);
} }
@ -296,14 +296,14 @@ class PluginService
$this->rollbackPluginMigrations($plugin); $this->rollbackPluginMigrations($plugin);
$this->buildAssets();
if ($deleteFiles) { if ($deleteFiles) {
$this->deletePlugin($plugin); $this->deletePlugin($plugin);
} else { } else {
$this->setStatus($plugin, PluginStatus::NotInstalled); $this->setStatus($plugin, PluginStatus::NotInstalled);
} }
$this->buildAssets();
$this->manageComposerPackages(oldPackages: $pluginPackages); $this->manageComposerPackages(oldPackages: $pluginPackages);
} catch (Exception $exception) { } catch (Exception $exception) {
$this->handlePluginException($plugin, $exception); $this->handlePluginException($plugin, $exception);