From 9612e1161977654a190db6aa11b5a4bbc84ef56d Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 5 Jul 2022 15:57:52 +0900 Subject: [PATCH] =?UTF-8?q?WebAPI=20=E3=83=97=E3=83=A9=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=AE=E5=89=8A=E9=99=A4=E3=81=AB=E5=A4=B1=E6=95=97?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=95=8F=E9=A1=8C=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WebAPI プラグインを削除する際, 以下のようなエラーが発生するのを修正 > MappingException.php line 63: > File mapping drivers must have a valid directory path, however the given path [/path/to/ec-cube/vendor/league/oauth2-server-bundle/src/Entity] seems to be incorrect! MappingDriver が既に削除された Bundle のパスを参照してしまうが, 関連テーブルは既に削除されているため無視しても問題ないと思われる --- src/Eccube/Service/PluginService.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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;