0

Silverstripe 管理ページの問題を解決しようとしています。カートやサンプルの商品ページをクリックするたびに、「エラーが発生しました」というメッセージが表示され、ページが表示されません。添付画像をご覧ください。

ここに画像の説明を入力

ご覧のとおり、カートとサンプル製品のアイコンは他のものとは異なります。私は自分でコードを書いたわけではなく、これまで経験したことがないので、どこから問題に取り組み始めるべきかについての提案をいただければ幸いです。

どの部分か教えていただければ、ここにいくつかのコードをコピーできます。どうぞよろしくお願いいたします。

よろしくサム

カートページをクリックしたときの Firefox コンソールメッセージ。

ここに画像の説明を入力

コンソールの [応答] タブにある追加のエラー メッセージ:

ERROR [User Error]: Bad class to singleton() - ProductImageObject
IN POST /admin/getitem?ID=17&ajax=1
Line 334 in /home/xxx/subdomains/xxx/sapphire/core/Core.php

Source
======
  325:  *
  326:  * @param string $className
  327:  * @return Object
  328:  */
  329: function singleton($className) {
  330:  global $_SINGLETONS;
  331:  if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
  332:  if(!is_string($className)) user_error("singleton() passed bad class_name: " .
   var_export($className,true), E_USER_ERROR);
  333:  if(!isset($_SINGLETONS[$className])) {
* 334:      if(!class_exists($className)) user_error("Bad class to singleton() - $className",
   E_USER_ERROR);
  335:      $_SINGLETONS[$className] = Object::strong_create($className,null, true);
  336:      if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
  337:  }
  338:  return $_SINGLETONS[$className];
  339: }
  340: 

Trace
=====
<ul>user_error(Bad class to singleton() - ProductImageObject,256)
line 334 of Core.php

singleton(ProductImageObject)
line 96 of DataObjectManager.php

DataObjectManager->__construct(Product,ProductImages,ProductImageObject,Array,getCMSFields_forPopup,,Created DESC,)
line 48 of FileDataObjectManager.php

FileDataObjectManager->__construct(Product,ProductImages,ProductImageObject,ProductImage,Array,getCMSFields_forPopup)
line 125 of Product.php

Product->getCMSFields(CMSMain)
line 444 of CMSMain.php

CMSMain->getEditForm(17)
line 1021 of LeftAndMain.php

LeftAndMain->EditForm()
line 382 of LeftAndMain.php

LeftAndMain->getitem(SS_HTTPRequest)
line 193 of Controller.php

Controller->handleAction(SS_HTTPRequest)
line 137 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php

Controller->handleRequest(SS_HTTPRequest)
line 281 of Director.php

Director::handleRequest(SS_HTTPRequest,Session)
line 124 of Director.php

Director::direct(/admin/getitem)
line 127 of main.php

</ul>
4

2 に答える 2

1

これには多くの理由が考えられます。まず、次の 2 つのことを試してください。

1) サイトを開発モードにします (まだの場合): http://doc.silverstripe.org/sapphire/en/topics/debugging#dev-mode

2) ログエラー (サーバー側): http://doc.silverstripe.org/sapphire/en/topics/error-handling#filesystem-logs

これは、サーバー側のエラーに役立ちます (「エラーが発生しました/500」とよく似ています) - ログ ファイルで関連するエントリを見つける必要があります。それが単なるクライアント側/ JSの場合は、firebugをさらに深く掘り下げる必要があります...

ページ ツリーのアイコンについて心配する必要はありません。これは機能です (簡単な説明については、http://www.ssbits.com/snippets/2009/spice-up-your-cms-sitetree/を参照してください)。

于 2011-09-27T11:03:45.827 に答える
0

私が見たところ、カート ページを定義する PHP クラスを確認する必要があります。ほとんどの場合、スペルを間違えたり、何かをタイプミスしたりしています。

singleton() への不適切なクラス - ProductImageObject

これが私たちの手がかりです。Product.php の 125 行目を確認してみてください。

于 2012-03-07T05:33:29.610 に答える