バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > フロント機能 > カテゴリリンクをクリックするとエラーになる

フロント機能

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
kuroryu
投稿日時: 2019/11/20 16:02
対応状況: 解決済
新米
登録日: 2019/11/20
居住地:
投稿: 10
カテゴリリンクをクリックするとエラーになる
[EC-CUBE] EC-CUBE3.0.17 新規インストール(簡単インストール)
[レンタルサーバ] X server Business
[OS] Windows10
[PHP] 7.3.8
[データベース] MySQL5.7
[WEBサーバ] 使用しているWEBサーバ名、バージョン
[ブラウザ] Firefox70.0.1
[導入プラグインの有無]
・メンテナンスプラグイン
・定休日プラグイン
・PayPalExress
・新着商品ブロックプラグイン
・Wordpressとの提携プラグイン
[カスタマイズの有無]
基本はEC CUBE3の管理画面でブロック編集を行い、CSSファイルをDreamweaverCS4を使って編集していますが、初期の頃、ymlファイルをメモ帳で開いて編集しました。そのときにもしかしたら、phpファイルもいくつかメモ帳で保存してしまったかもしれません。
[現象]
トップページからカテゴリメニューのリンクをクリックすると「システムエラー」というページになってしまいます。
カテゴリメニューのすべてのリンクについて同様の現象です。
デバッグ機能を作動したところ、以下のようなメッセージが出ています。
「Parser.php」というファイルにエラーがあるというメッセージだと思うのですが、このファイル自体は一切編集しておりません。
よろしくお願いいたします。

引用:
Whoops, looks like something went wrong. 1/1 Twig_Error_Syntax in Parser.php line 386: A template that extends another one cannot start with a byte order mark (BOM); it must be removed in "__string_template__b272d5fde0575bedf4c34f9d85f22de0f91146b5540823d3ff81651b86104f19" at line 1. in Parser.php line 386 at Twig_Parser->filterBodyNodes(object(Twig_Node_Text)) in Parser.php line 402 at Twig_Parser->filterBodyNodes(object(Twig_Node)) in Parser.php line 108 at Twig_Parser->parse(object(Twig_TokenStream)) in Environment.php line 692 at Twig_Environment->parse(object(Twig_TokenStream)) in Environment.php line 750 at Twig_Environment->compileSource(object(Twig_Source)) in Environment.php line 447 at Twig_Environment->loadTemplate('__string_template__b272d5fde0575bedf4c34f9d85f22de0f91146b5540823d3ff81651b86104f19') in Environment.php line 501 at Twig_Environment->createTemplate('{# This file is part of EC-CUBE Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved. http://www.lockon.co.jp/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #} {% extends 'default_frame.twig' %} {% set body_class = 'product_page' %} {% block javascript %} <script> // 並び順を変更 function fnChangeOrderBy(orderby) { eccube.setValue('orderby', orderby); eccube.setValue('pageno', 1); eccube.submitForm(); } // 表示件数を変更 function fnChangeDispNumber(dispNumber) { eccube.setValue('disp_number', dispNumber); eccube.setValue('pageno', 1); eccube.submitForm(); } // 商品表示BOXの高さを揃える $(window).load(function() { $('.product_item').matchHeight(); }); </script> {% endblock %} {% block main %} {% if search_form.category_id.vars.errors|length == 0 %} <form name="form1" id="form1" method="get" action="?"> {{ form_widget(search_form) }} </form> <!-- ▼topicpath▼ --> <div id="topicpath" class="row"> <ol id="list_header_menu"> <li><a href="{{ url('product_list') }}">全商品</a></li> {% if Category is not null %} {% for Path in Category.path %} <li><a href="{{ url('product_list') }}?category_id={{ Path.id }}">{{ Path.name }}</a></li> {% endfor %} {% endif %} {% if search_form.vars.value.name %} <li>「{{ search_form.vars.value.name }}」の検索結果</li> {% endif %} </ol> </div> <!-- ▲topicpath▲ --> <div id="result_info_box" class="row"> <form name="page_navi_top" id="page_navi_top" action="?"> {% if pagination.totalItemCount > 0 %} <p id="result_info_box__item_count" class="intro col-sm-6"><strong><span id="productscount">{{ pagination.totalItemCount }}</span>件</strong>の商品がみつかりました。 </p> <div id="result_info_box__menu_box" class="col-sm-6 no-padding"> <ul id="result_info_box__menu" class="pagenumberarea clearfix"> <li id="result_info_box__disp_menu"> {{ form_widget(disp_number_form, {'id': '', 'attr': {'onchange': "java script:fnChangeDispNumber(this.value);"}}) }} </li> <li id="result_info_box__order_menu"> {{ form_widget(order_by_form, {'id': '', 'attr': {'onchange': "java script:fnChangeOrderBy(this.value);"}}) }} </li> </ul> </div> {% for f in disp_number_form.getIterator %} {% if f.vars.name matches '[^plg*]' %} {{ form_label(f) }} {{ form_widget(f) }} {{ form_errors(f) }} {% endif %} {% endfor %} {% for f in order_by_form.getIterator %} {% if f.vars.name matches '[^plg*]' %} {{ form_label(f) }} {{ form_widget(f) }} {{ form_errors(f) }} {% endif %} {% endfor %} {% else %} <p id="result_info_box__item_count" class="intro col-sm-6"><strong style="display: none;"><span id="productscount">{{ pagination.totalItemCount }}</span>件</strong>お探しの商品は見つかりませんでした。</p> {% endif %} </form> </div> <!-- ▼item_list▼ --> <div id="item_list"> <div class="row no-padding"> {% for Product in pagination %} <div id="result_list_box--{{ Product.id }}" class="col-sm-3 col-xs-6"> <div id="result_list__item--{{ Product.id }}" class="product_item"> <a href="{{ url('product_detail', {'id': Product.id}) }}"> <div id="result_list__image--{{ Product.id }}" class="item_photo"> <img src="{{ app.config.image_save_urlpath }}/{{ Product.main_list_image|no_image_product }}"> </div> <dl id="result_list__detail--{{ Product.id }}"> <dt id="result_list__name--{{ Product.id }}" class="item_name">{{ Product.name }}</dt> {% if Product.description_list %} <dd id="result_list__description_list--{{ Product.id }}" class="item_comment">{{ Product.description_list|raw|nl2br }}</dd> {% endif %} {% if Product.hasProductClass %} {% if Product.getPrice02Min == Product.getPrice02Max %} <dd id="result_list__price02_inc_tax--{{ Product.id }}" class="item_price"> {{ Product.getPrice02IncTaxMin|price }} </dd> {% else %} <dd id="result_list__price02_inc_tax--{{ Product.id }}" class="item_price"> {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }} </dd> {% endif %} {% else %} <dd id="result_list__price02_inc_tax--{{ Product.id }}" class="item_price">{{ Product.getPrice02IncTaxMin|price }}</dd> {% endif %} </dl> </a> </div> {% if Product.stock_find %} <!--▼買い物かご--> {% set form = forms[Product.id] %} <form name="form{{ Product.id }}" id="productForm{{ Product.id }}" action="{{ url('product_detail', {'id': Product.id}) }}" method="post"> <dl> {% if form.classcategory_id1 is defined %} {# 規格1 #} <dt> {{ form_label(form.classcategory_id1) }}: </dt> <dd> {{ form_widget(form.classcategory_id1) }} {{ form_errors(form.classcategory_id1) }} </dd> {# 規格2 #} {% if form.classcategory_id2 is defined %} <dt> {{ form_label(form.classcategory_id2) }}: </dt> <dd> {{ form_widget(form.classcategory_id2) }} {{ form_errors(form.classcategory_id2) }} </dd> {% endif %} {% endif %} <dt>個数:</dt> <dd> {{ form_widget(form.quantity) }} {{ form_errors(form.quantity) }} </dd> {{ form_rest(form) }} </dl> <div> <button type="submit" class="add-cart btn btn-primary btn-block prevention-btn prevention-mask" data-cartid="{{ Product.id }}">カートに入れる</button> </div> </form> <!--▲買い物かご--> {% else %} <div>ただいま品切れ中です</div> {% endif %} </div> {% endfor %} </div> </div> <!-- ▲item_list▲ --> {% if pagination.totalItemCount > 0 %} {% include "pagination.twig" with { 'pages' : pagination.paginationData } %} {% endif %} {% else %} <p class="errormsg text-danger">ご指定のカテゴリは存在しません。</p> {% endif %} {% endblock %}') in ApplicationTrait.php line 253 at ApplicationTrait->render('Product/list.twig', array('subtitle' => 'カテゴリA', 'pagination' => object(SlidingPagination), 'search_form' => object(FormView), 'disp_number_form' => object(FormView), 'order_by_form' => object(FormView), 'forms' => array(object(FormView), object(FormView), object(FormView), object(FormView), object(FormView), object(FormView), object(FormView), object(FormView), object(FormView), object(FormView), object(FormView), object(FormView)), 'Category' => object(Category))) in ProductController.php line 198 at ProductController->index(object(Application), object(Request)) at call_user_func_array(array(object(ProductController), 'index'), array(object(Application), object(Request))) in HttpKernel.php line 144 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 111
red
投稿日時: 2019/11/20 19:10
対応状況: −−−
登録日: 2010/2/15
居住地: 東京都
投稿: 1567
Re: カテゴリリンクをクリックするとエラーになる
Twig_Error_Syntax in Parser.php line 386: A template that extends another one cannot start with a byte order mark (BOM)

と書いてあります。
BOMを消しましょう


----------------
EC-CUBEのカスタマイズ、トラブル解決承ります
お気軽にお問い合わせ下さい
https://www.ec-cube.net/integrate/partner/partner.php?partner_id=690

kuroryu
投稿日時: 2019/11/20 19:15
対応状況: −−−
新米
登録日: 2019/11/20
居住地:
投稿: 10
Re: カテゴリリンクをクリックするとエラーになる
ありがとうございます。
Parser.phpをBOMなしで保存しましたが解決しませんでした。
このファイルの該当の行付近を見ますと、
引用:
if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) { throw new Twig_Error_Syntax('A template that extends another one cannot start with a byte order mark (BOM); it must be removed.', $node->getTemplateLine(), $this->stream->getSourceContext()); }

とあって、エラーメッセージを表示するコードが書かれています。
BOMが付いているのはParser.phpではなく、他のファイルということでしょうか?

また、
引用:
Twig_Error_Syntax in Parser.php line 386: A template that extends another one cannot start with a byte order mark (BOM); it must be removed in "__string_template__b272d5fde0575bedf4c34f9d85f22de0f91146b5540823d3ff81651b86104f19" at line 1.

とも書かれていますが、この"__string_template__b272d5fde0575bedf4c34f9d85f22de0f91146b5540823d3ff81651b86104f19"というファイルはどこに保存されているのでしょうか?ここにBOMがあるようなメッセージに見えるのですがそういうことではないのでしょうか?
red
投稿日時: 2019/11/20 19:26
対応状況: −−−
登録日: 2010/2/15
居住地: 東京都
投稿: 1567
Re: カテゴリリンクをクリックするとエラーになる
Twig_Error_Syntax なのでテンプレートです
たぶん商品一覧


----------------
EC-CUBEのカスタマイズ、トラブル解決承ります
お気軽にお問い合わせ下さい
https://www.ec-cube.net/integrate/partner/partner.php?partner_id=690

kuroryu
投稿日時: 2019/11/20 21:21
対応状況: −−−
新米
登録日: 2019/11/20
居住地:
投稿: 10
Re: カテゴリリンクをクリックするとエラーになる
インストール後に作ったテンプレートフォルダ(defaultの他)の中のlist.twigファイルを削除したところ、カテゴリが表示されました!
ヒントをくださってありがとうございました。
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

総メンバー数は88,286名です
総投稿数は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.