Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

プラグイン無効化時にエラーになる #135

Closed
wesrivery opened this issue Jun 11, 2020 · 5 comments
Closed

プラグイン無効化時にエラーになる #135

wesrivery opened this issue Jun 11, 2020 · 5 comments
Labels
Milestone

Comments

@wesrivery
Copy link

クーポンプラグインを無効化しようとするとエラーになり、無効化することができません。

管理画面から無効化しようとすると、システムエラーになります。
コマンドから無効化しようとすると、以下のようなエラーが表示されます。

$ bin/console eccube:plugin:disable --code=Coupon4
09:26:10 ERROR     [console] Error thrown while running command "eccube:plugin:disable --code=Coupon4". Message: "EntityManager#remove() expects parameter 1 to be an entity object, NULL given." ["exception" => Doctrine\ORM\ORMInvalidArgumen
tException { …},"command" => "eccube:plugin:disable --code=Coupon4","message" => "EntityManager#remove() expects parameter 1 to be an entity object, NULL given."] ["file" => "/path/to/vendor/symfony/console/EventLis
tener/ErrorListener.php","line" => 46,"class" => "Symfony\Component\Console\EventListener\ErrorListener","function" => "onConsoleError","uid" => "e4e9639","user_id" => "N/A","session_id" => "N/A"]

In ORMInvalidArgumentException.php line 189:

  EntityManager#remove() expects parameter 1 to be an entity object, NULL given.  

システム情報

EC-CUBE version : 4.0.3
php version : 7.3.18
同時に使っているプラグイン : メールマガジンプラグイン、おすすめ商品管理プラグイン、商品並び替えプラグイン

@okazy
Copy link
Contributor

okazy commented Jun 11, 2020

@wesrivery
エラー発生前後のEC-CUBEのログとdtb_pluginの内容をいただけますか?

@okazy okazy added the bug label Jun 11, 2020
@okazy okazy added this to the 4.0.x milestone Jun 11, 2020
@wesrivery
Copy link
Author

@okazy
エラー発生時のログは流れてしまっていて、とれませんでした。
その後、app/Plugin/Coupon4/PluginManager.php の以下をコメントアウトすることで、
無効化できました。

    public function disable(array $meta, ContainerInterface $container)
    {
        $this->removeBlock($container);
        // pagelayoutの削除
        // $this->removePageLayout($container);
    }

@okazy
Copy link
Contributor

okazy commented Jun 12, 2020

コメントアウトされた処理はページ管理の「商品購入/クーポン利用」を削除する処理に当たるかと思います。
「商品購入/クーポン利用」が残ったままになっていないか一度ご確認ください。

@wesrivery
Copy link
Author

現在は上記の方法でプラグインを無効化 -> 削除 してから、
再度インストール ->有効化した状態ですが、クーポン管理 に1件クーポンが残っています。
すべてのクーポンを削除してからでないと、無効化できないということでしょうか?

@okazy
Copy link
Contributor

okazy commented Jun 22, 2020

無効化 -> 削除 してから、再度インストール ->有効化した状態ですが、クーポン管理 に1件クーポンが残っています。
すべてのクーポンを削除してからでないと、無効化できないということでしょうか?

通常プラグインの削除時にDBのテーブルの修正も行われます。
また登録クーポンの有無はプラグインの無効化、削除には影響ありません。

プラグインを完全に削除したにも関わらず、クーポンが残っている場合には削除が正常に行われなかった可能性があります。

ドキュメントのプラグインのインストール失敗時の対処法を試していただけますでしょうか。
https://doc4.ec-cube.net/plugin_error

エラーに関しては以下の記事も参考になるかと思います。
https://qiita.com/nanasess/items/791c9ec98f69ada93ea0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants