バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

プラグイン > バグ報告・利用に関する質問 > 【EC-CUBE 3.X系】関連商品プラグインにつきまして

バグ報告・利用に関する質問

新規スレッドを追加する

スレッド表示 | 古いものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
MPV
投稿日時: 2017/5/27 10:55
対応状況: 解決済
仙人
登録日: 2011/3/27
居住地:
投稿: 309
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
nyorai 様

ありがとうございます!!
古いバージョンでした。

当方テンプレートをいじっていたので、
プラグインインストール時に
独自プラグインの方でインストールしており
バージョンアップの通知を見ておらず、
かつプラグインのリリースノートを見ていたので
修正があったのを確認しておりませんでした・・・(T_T)

大変お恥ずかしい・・・。

おかげさまでシステムエラーの方は解消しまして
スタッフの方にもとりあえずこれでご納得頂きました。

こちらはこれで解決済みにさせて頂きます。
nyorai
投稿日時: 2017/5/26 15:02
対応状況: −−−
仙人
登録日: 2015/8/21
居住地:
投稿: 302
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
関連商品プラグインのGitHubを見てみると、バージョン1.0.0では修正されているように思われるのですが、お使いのプラグインのバージョンはわかりますか?

https://github.com/EC-CUBE/related-product-plugin/issues/34
MPV
投稿日時: 2017/5/26 10:23
対応状況: −−−
仙人
登録日: 2011/3/27
居住地:
投稿: 309
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
468 様

コメントありがとうございました。
また、返信が遅れまして申し訳ございませんでした。

その後、テスト環境で確認してみたりしていたのですが
やはりtwig側では判定できないようで、
どうやらphp側の修正が必要になりそうです。

引用:

本当はデータ上の不整合が起きないようにするべきかと思いますので、 今回の場合、商品削除時のフックポイントに 関連商品情報を削除する処理を入れるべきかと思いますが、


確かに理想では、こうなっていればいいですよね・・・。
468
投稿日時: 2017/5/25 12:31
対応状況: −−−
登録日: 2008/10/26
居住地:
投稿: 3217
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
私は別のプラグイン開発時に、このエラーが発生して、かなり悩んだのですが、
リレーション先のデータが削除済みだったり、存在していない場合、
twig内で回避する方法が見つかりませんでした。
(海外の掲示板などsymfony系の情報を探しましたが、どれも上手くいっていないようでした)

仕方ないので、PHP側で一度、ループさせて、
try~catchでEntityNotFoundExceptionを補足して、
ダミーのEntityをセットするようにして、twigで判定を入れて回避しました。

本当はデータ上の不整合が起きないようにするべきかと思いますので、
今回の場合、商品削除時のフックポイントに
関連商品情報を削除する処理を入れるべきかと思いますが、
既にインストールされているプラグインに対して、
フックポイントを追加する事が出来るのか、私は自信がありません。

EventディレクトリやControllerディレクトリ以下のPHPファイルに対して、
例外をキャッチして、ダミーのEntityをセットする処理を追加し、
twigのほうでは、ダミーのEntityは表示しないような判定処理を入れれば、
強引ですが、とりあえずエラーは回避できそうですが、
手を加える必要がある箇所は、多そうです。


----------------
株式会社シロハチ
■ECCUBE2系、3系構築カスタマイズご相談ください。
EC-CUBE3マニュアル
blog

MPV
投稿日時: 2017/5/25 0:24
対応状況: −−−
仙人
登録日: 2011/3/27
居住地:
投稿: 309
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
468 様

お世話になっております。

引用:

それとも関連商品の登録はそのままに、商品マスタの商品データを削除されているという事でしょうか?
例えば、商品A、商品B、商品Cが商品マスタに登録されていて、
商品Aの編集画面にて、関連商品項目で、商品B、商品Cを登録し、
その後、商品Bを削除したら、
商品Aが表示されなくなった。という事ですか?


こちらの記載の通りです。

ちなみにこの状態になってしまうと、
管理画面での商品編集もシステムエラーで
落ちてしまい、紐づけを修正することもできません。

ショップのスタッフからは、複数のスタッフで
商品登録をしているので、商品を削除する際に
関連商品への登録について全ては把握しておらず
確認するのが煩雑で困っていると言われております。

スタッフの方はDBのオペレーション等は
出来ませんので、可能であればEC-CUBEの
管理画面で対応できる方法を探しております。

何かよい方法などございましたら、
アドバイス頂ければ幸いです。

どうぞよろしくお願いいたします。
468
投稿日時: 2017/5/24 18:29
対応状況: −−−
登録日: 2008/10/26
居住地:
投稿: 3217
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
横から失礼します。
1点確認なのですが、ここでいう商品を削除というのは、関連商品の紐づけを削除という事でしょうか?

それとも関連商品の登録はそのままに、商品マスタの商品データを削除されているという事でしょうか?
例えば、商品A、商品B、商品Cが商品マスタに登録されていて、
商品Aの編集画面にて、関連商品項目で、商品B、商品Cを登録し、
その後、商品Bを削除したら、
商品Aが表示されなくなった。という事ですか?

エラーを見ていると、関連商品の紐づけは存在いるけど、紐づけ先の商品が無いのでは?と思いましたので。


----------------
株式会社シロハチ
■ECCUBE2系、3系構築カスタマイズご相談ください。
EC-CUBE3マニュアル
blog

MPV
投稿日時: 2017/5/24 17:41
対応状況: −−−
仙人
登録日: 2011/3/27
居住地:
投稿: 309
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
nyorai 様

遅くなりまして申し訳ございませんでした。
ログが取得できましたので、以下に添付します。

引用:


Whoops, looks like something went wrong.

2/2 Twig_Error_Runtime in related_product.twig line 16: An exception has been thrown during the rendering of a template ("Entity was not found.").

in related_product.twig line 16
at Twig_Template->displayWithErrorHandling(array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)), 'app' => object(Application), 'Holidays' => array(array('1', '14'), array('11'), array('21'), array('29'), array('3', '4', '5'), array('21'), array('15', '23'), array('13'), array('3', '23'), array('23')), 'HolidayWeek' => array(false, false, false, false, false, false, false), 'HolidayConfig' => array(array('config_data' => '2')), 'BaseInfo' => object(BaseInfo), 'PageLayout' => object(PageLayout), 'title' => '商品詳細ページ'), array()) in Template.php line 403
at Twig_Template->display(array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in Template.php line 411
at Twig_Template->render(array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in Environment.php line 362
at Twig_Environment->render('RelatedProduct/Resource/template/Front/related_product.twig', array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in ApplicationTrait.php line 273
at ApplicationTrait->renderView('RelatedProduct/Resource/template/Front/related_product.twig', array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in Event.php line 42
at Event->showRelatedProduct(object(FilterResponseEvent), 'eccube.event.render.product_detail.before', object(EventDispatcher))
at call_user_func(array(object(Event), 'showRelatedProduct'), object(FilterResponseEvent), 'eccube.event.render.product_detail.before', object(EventDispatcher)) in EventDispatcher.php line 161
at EventDispatcher->doDispatch(array(array(object(Maker), 'onRenderProductsDetailBefore'), array(object(Event), 'showRelatedProduct')), 'eccube.event.render.product_detail.before', object(FilterResponseEvent)) in EventDispatcher.php line 46
at EventDispatcher->dispatch('eccube.event.render.product_detail.before', object(FilterResponseEvent)) in Application.php line 703
at Application->Eccube\{closure}(object(FilterResponseEvent), 'kernel.response', object(TraceableEventDispatcher))
at call_user_func(object(Closure), object(FilterResponseEvent), 'kernel.response', object(TraceableEventDispatcher)) in WrappedListener.php line 61
at WrappedListener->__invoke(object(FilterResponseEvent), 'kernel.response', object(EventDispatcher))
at call_user_func(object(WrappedListener), object(FilterResponseEvent), 'kernel.response', object(EventDispatcher)) in EventDispatcher.php line 161
at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.response', object(FilterResponseEvent)) in EventDispatcher.php line 46
at EventDispatcher->dispatch('kernel.response', object(FilterResponseEvent)) in TraceableEventDispatcher.php line 128
at TraceableEventDispatcher->dispatch('kernel.response', object(FilterResponseEvent)) in HttpKernel.php line 184
at HttpKernel->filterResponse(object(Response), object(Request), '1') in HttpKernel.php line 166
at HttpKernel->handleRaw(object(Request), '1') in HttpKernel.php line 64
at HttpKernel->handle(object(Request), '1', true) in Application.php line 586
at Application->handle(object(Request)) in Application.php line 563
at Application->run() in index_dev.php line 103

1/2 EntityNotFoundException in ProxyFactory.php line 177: Entity was not found.

in ProxyFactory.php line 177
at ProxyFactory->Doctrine\ORM\Proxy\{closure}(object(Product), 'offsetExists', array('id')) in __CG__EccubeEntityProduct.php line 903
at Closure->__invoke(object(Product), 'offsetExists', array('id')) in __CG__EccubeEntityProduct.php line 903
at Product->offsetExists('id') in Template.php line 516
at Twig_Template->getAttribute(object(Product), 'id', array()) in 90b93dca6767103d9f585d42e96e1314370339e8f4513c0a4196b44e9852c01b.php line 35
at __TwigTemplate_4b38d822f2dff311147104b53a978ddabc8e6f55cf6e3f01057a0746ea210060->doDisplay(array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)), 'app' => object(Application), 'Holidays' => array(array('1', '14'), array('11'), array('21'), array('29'), array('3', '4', '5'), array('21'), array('15', '23'), array('13'), array('3', '23'), array('23')), 'HolidayWeek' => array(false, false, false, false, false, false, false), 'HolidayConfig' => array(array('config_data' => '2')), 'BaseInfo' => object(BaseInfo), 'PageLayout' => object(PageLayout), 'title' => '商品詳細ページ'), array()) in Template.php line 432
at Twig_Template->displayWithErrorHandling(array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)), 'app' => object(Application), 'Holidays' => array(array('1', '14'), array('11'), array('21'), array('29'), array('3', '4', '5'), array('21'), array('15', '23'), array('13'), array('3', '23'), array('23')), 'HolidayWeek' => array(false, false, false, false, false, false, false), 'HolidayConfig' => array(array('config_data' => '2')), 'BaseInfo' => object(BaseInfo), 'PageLayout' => object(PageLayout), 'title' => '商品詳細ページ'), array()) in Template.php line 403
at Twig_Template->display(array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in Template.php line 411
at Twig_Template->render(array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in Environment.php line 362
at Twig_Environment->render('RelatedProduct/Resource/template/Front/related_product.twig', array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in ApplicationTrait.php line 273
at ApplicationTrait->renderView('RelatedProduct/Resource/template/Front/related_product.twig', array('RelatedProducts' => array(object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct), object(RelatedProduct)))) in Event.php line 42
at Event->showRelatedProduct(object(FilterResponseEvent), 'eccube.event.render.product_detail.before', object(EventDispatcher))
at call_user_func(array(object(Event), 'showRelatedProduct'), object(FilterResponseEvent), 'eccube.event.render.product_detail.before', object(EventDispatcher)) in EventDispatcher.php line 161
at EventDispatcher->doDispatch(array(array(object(Maker), 'onRenderProductsDetailBefore'), array(object(Event), 'showRelatedProduct')), 'eccube.event.render.product_detail.before', object(FilterResponseEvent)) in EventDispatcher.php line 46
at EventDispatcher->dispatch('eccube.event.render.product_detail.before', object(FilterResponseEvent)) in Application.php line 703
at Application->Eccube\{closure}(object(FilterResponseEvent), 'kernel.response', object(TraceableEventDispatcher))
at call_user_func(object(Closure), object(FilterResponseEvent), 'kernel.response', object(TraceableEventDispatcher)) in WrappedListener.php line 61
at WrappedListener->__invoke(object(FilterResponseEvent), 'kernel.response', object(EventDispatcher))
at call_user_func(object(WrappedListener), object(FilterResponseEvent), 'kernel.response', object(EventDispatcher)) in EventDispatcher.php line 161
at EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.response', object(FilterResponseEvent)) in EventDispatcher.php line 46
at EventDispatcher->dispatch('kernel.response', object(FilterResponseEvent)) in TraceableEventDispatcher.php line 128
at TraceableEventDispatcher->dispatch('kernel.response', object(FilterResponseEvent)) in HttpKernel.php line 184
at HttpKernel->filterResponse(object(Response), object(Request), '1') in HttpKernel.php line 166
at HttpKernel->handleRaw(object(Request), '1') in HttpKernel.php line 64
at HttpKernel->handle(object(Request), '1', true) in Application.php line 586
at Application->handle(object(Request)) in Application.php line 563
at Application->run() in index_dev.php line 103


自分でも確認してみたのですが、
RelatedProduct\Resource\template\Front\related_product.twigの以下


    <li class="col-sm-2 col-xs-4">
        <a href="{{ url('product_detail', {id : RelatedProduct.ChildProduct.id}) }}" class="item_photo">
            <img src="{{ app.config.image_save_urlpath }}/{{ RelatedProduct.ChildProduct.main_list_image|no_image_product }}">
        </a>
        <p>{{ RelatedProduct.content }}</p>
    </li>


のRelatedProduct.ChildProduct.idで取得できずに
落ちているようです。

dump(RelatedProduct.ChildProduct)したところ、
以下の様にidは入っているようなのですが
落ちてしまいます。

引用:

Product {#7436 ▼
+__isInitialized__: false
-_calc: false
-stockFinds: []
-stocks: []
-stockUnlimiteds: []
-price01: []
-price02: []
-price01IncTaxs: []
-price02IncTaxs: []
-codes: []
-classCategories1: []
-classCategories2: []
-className1: null
-className2: null
-id: 10308
-name: null
-note: null
-description_list: null
-description_detail: null
-search_word: null
-free_area: null
-del_flg: null
-create_date: null
-update_date: null
-ProductCategories: null
-ProductClasses: null
-CustomerFavoriteProducts: null
-Creator: null
-Status: null
-ProductImage: null
-ProductTag: null
…2
}


大変恐縮ですがご確認頂ければ幸いです。
よろしくお願いいたします。
MPV
投稿日時: 2017/5/20 17:57
対応状況: −−−
仙人
登録日: 2011/3/27
居住地:
投稿: 309
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
nyorai 様

早々のコメントありがとうございます。

引用:
ec-cube 3.0.14(新規インストール/PostgreSQL)、関連商品プラグイン 1.0.0 で試してみたのですが、紐付いた商品を削除してもシステムエラーは発生しませんでした。


当方の稼働環境は3.0.13→3.0.14のアップデートで、
MYSQLなのですが、デバッグモードで確認したところ
RelatedProductでエラーが出ているようなのです・・・。

次回発生した際に、そのエラーを添付して再度投稿させて
頂きますので、大変勝手なお願いではございますが
ご覧頂ければ幸いです。
nyorai
投稿日時: 2017/5/19 16:01
対応状況: −−−
仙人
登録日: 2015/8/21
居住地:
投稿: 302
Re: 【EC-CUBE 3.X系】関連商品プラグインにつきまして
ec-cube 3.0.14(新規インストール/PostgreSQL)、関連商品プラグイン
1.0.0 で試してみたのですが、紐付いた商品を削除してもシステムエラーは発生しませんでした。

関連商品プラグインのテーブル定義を確認してみましたが、単純な構造なので、該当レコードを削除でも問題なさそうです。

https://github.com/EC-CUBE/related-product-plugin/blob/master/Resource/doctrine/Plugin.RelatedProduct.Entity.RelatedProduct.dcm.yml
MPV
投稿日時: 2017/5/19 15:22
対応状況: −−−
仙人
登録日: 2011/3/27
居住地:
投稿: 309
【EC-CUBE 3.X系】関連商品プラグインにつきまして
【稼働環境】
EC-CUBE 3.0.14(アップデート)
サーバーOS Linux 2.6.32-642.13.1.el6.x86_64 #1 SMP Wed Jan 11 20:56:24 UTC 2017 x86_64
DBサーバー MySQL 5.6.22
WEBサーバー Apache
PHP 5.6.30 (Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, SPL, iconv, session, json, mbstring, mcrypt, mysql, mysqli, standard, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, Reflection, imap, SimpleXML, snmp, soap, sockets, exif, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imagick, Zend OPcache)
HTTPユーザーエージェント Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0

お世話になります。
題記の件、質問がございます。

現在、関連商品プラグインを使用しているのですが、
関連商品として登録した商品を削除してしまうと、
その関連商品が登録された商品を表示しようとすると
システムエラーで表示できない状態(仕様?)に
なっていると思います。

これを回避する方法なのですが、プラグインを
使用されている皆様はどのように対応されて
いるのでしょうか?

〇運用対応で対処している(商品の再登録など)
〇直接DBから関連商品の該当レコードを削除している etc

当方も、現状は運用対応での対処なのですが、
件数が多く再登録等も煩雑で、直接関連商品のDBの
該当レコードを削除しても問題ないのであれば、
それで対応したいのですが、シーケンスが歯抜けに
なってしまって影響がないのかが不安でして・・・、
まだこの方法では行っていません。

もしこうすれば簡単ですぐ対応可能という方法が
ございましたら、ご教授頂ければ幸いです。

どうぞよろしくお願いいたします。<(_ _)>
スレッド表示 | 古いものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

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

投稿数ランキング

1
seasoft
7365
2
468
3217
3
AMUAMU
2712
4
nanasess
2303
5
umebius
2085
6
yuh
1818
7
h_tanaka
1610
8
red
1568
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.