我正在尝试解决一些 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>