diff --git a/src/Eccube/Service/PluginService.php b/src/Eccube/Service/PluginService.php index 9ec483a7fdf..62de3eeec87 100644 --- a/src/Eccube/Service/PluginService.php +++ b/src/Eccube/Service/PluginService.php @@ -16,6 +16,7 @@ use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\Persistence\Mapping\MappingException; use Eccube\Common\Constant; use Eccube\Common\EccubeConfig; use Eccube\Entity\Plugin; @@ -593,9 +594,6 @@ public function uninstall(Plugin $plugin, $force = true) } $this->unregisterPlugin($plugin); - // スキーマを更新する - $this->generateProxyAndUpdateSchema($plugin, $config, true); - // プラグインのネームスペースに含まれるEntityのテーブルを削除する $namespace = 'Plugin\\'.$plugin->getCode().'\\Entity'; $this->schemaService->dropTable($namespace); @@ -605,6 +603,13 @@ public function uninstall(Plugin $plugin, $force = true) $this->removeAssets($plugin->getCode()); } + // スキーマを更新する + try { + $this->generateProxyAndUpdateSchema($plugin, $config, true); + } catch (MappingException $e) { + // 削除された Bundle が MappingException をスローする場合があるが実害は無いので無視して進める + } + $this->pluginApiService->pluginUninstalled($plugin); return true;