バージョン選択

フォーラム

メニュー

オンライン状況

53 人のユーザが現在オンラインです。 (40 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 53
もっと...

サイト内検索

質問 > その他 > Service拡張を試したらページが開けなくなった

その他

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
VKZ1286
投稿日時: 2022/3/12 19:06
対応状況: 確認中
半人前
登録日: 2022/2/2
居住地:
投稿: 29
Service拡張を試したらページが開けなくなった
[EC-CUBE] 4.1.2
[PHP] 7.4
[データベース] MySQL 10.5

受注ステータス変更時の処理をカスタマイズするため、下記のサイトを参考にServiceクラスの拡張を試みましたところ、サイトが開けなくなってしまいました。

▼EC-CUBE4のServiceクラスの拡張
https://kumahiyo.com/extend-service/

▼EC-CUBE4 Serviceクラスのカスタマイズ方法
https://takelg.com/ec_cube4_service_class_customize/


▼具体的に行った作業
/app/config/eccube/services.yaml 末尾に追記
Customize\Service\OrderStateMachine:
decorates: Eccube\Service\OrderStateMachine

/app/Customize/Service/にOrderStateMachine.phpを作成
<?php
namespace Customize\Service;

use Eccube\Service\OrderStateMachine as BaseOrderStateMachine;
use Eccube\Entity\Master\OrderStatus;
use Eccube\Entity\Order;
use Eccube\Repository\Master\OrderStatusRepository;
use Eccube\Service\PurchaseFlow\Processor\PointProcessor;
use Eccube\Service\PurchaseFlow\Processor\StockReduceProcessor;
use Eccube\Service\PurchaseFlow\PurchaseContext;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\Event\Event;
use Symfony\Component\Workflow\StateMachine;

class OrderStateMachine extends BaseOrderStateMachine
{

}


上記2ファイルをサーバーにアップし、サイトにアクセスしたところ以下のエラーが表示されました。

引用:
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "security.logout_listener.admin" has a dependency on a non-existent service "eccube.security.logout.success_handler". in /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:86 Stack trace: #0 /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(83): Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\Component\DependencyInjection\Reference), false) #1 /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(49): Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue(Array, false) #2 /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(92): Symfony\Com in /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 86


そのため「/app/Customize/Service/にOrderStateMachine.php」を削除、「/app/config/eccube/services.yaml」を元に戻しましたが同じエラーが表示されてしまい、サイトにアクセスできません。

引用:
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "security.logout_listener.admin" has a dependency on a non-existent service "eccube.security.logout.success_handler". in /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:86 Stack trace: #0 /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(83): Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue(Object(Symfony\Component\DependencyInjection\Reference), false) #1 /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(49): Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue(Array, false) #2 /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(92): Symfony\Com in /home/ xxx/xxx.com/public_html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 86


コマンド操作もできなくなってしまったので、「/var/cache/prod/」のキャッシュを削除しましたが状況は改善しません。

上記の作業で操作した以外のファイルが書き換えられたり壊れたりしてしまったのでしょうか?

解決法をお分かりの方いらっしゃいましたら、ヒントでも良いので助言いただけますと幸いです。

宜しくお願い致します。
VKZ1286
投稿日時: 2022/3/14 12:42
対応状況: −−−
半人前
登録日: 2022/2/2
居住地:
投稿: 29
Re: Service拡張を試したらページが開けなくなった
ローカルとサーバー上のファイルを比較したところ、エラー自体は
/app/config/eccube/packages/security.yamlの内容が書き換わっていたことが原因と分かり、ファイルを修正してページが開けない問題は解決いたしました。

ただ、ファイルが書き換わってしまった原因や理由がわからないので、ご存じの方がいらっしゃいましたら後学のために教えていただけると大変うれしいです。
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は88,288名です
総投稿数は109,688件です

投稿数ランキング

1
seasoft
7365
2
468
3217
3
AMUAMU
2712
4
nanasess
2303
5
umebius
2085
6
yuh
1818
7
h_tanaka
1610
8
red
1567
9
mcontact
1240
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
796
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.