Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Posting a product


Go to End


1151 Views

Avatar
dgorges

Community Member, 1 Post

19 January 2010 at 5:04am

Hi,

I have a problem with my new installed ecommerce plugin. I tried to insert a new product, but got a failure:

[User Error] Bad class to singleton() - Product
GET /site/admin/products/

Line 261 in /web/1/000/048/259/188494/htdocs/site/sapphire/core/Core.php

Source

252  *
253  * @param string $className
254  * @return Object
255  */
256 function singleton($className) {
257 	global $_SINGLETONS;
258 	if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
259 	if(!is_string($className)) user_error("singleton() passed bad class_name: " . var_export($className,true), E_USER_ERROR);
260 	if(!isset($_SINGLETONS[$className])) {
261 	    if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
262 		$_SINGLETONS[$className] = Object::strong_create($className,null, true);
263 		if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
264 	}
265 	return $_SINGLETONS[$className];
266 }
267 
Trace

Bad class to singleton() - Product 
Line 261 of Core.php
singleton(Product) 
Line 317 of ModelAdmin.php
ModelAdmin_CollectionController->SearchForm() 
Line 194 of ModelAdmin.php
ModelAdmin->getModelForms() 
Line 107 of ViewableData.php
ViewableData->__get(ModelForms) 
Line 320 of ViewableData.php
ViewableData->obj(ModelForms) 
Line 23 of .cache.web.1.000.048.259.188494.htdocs.oscompamir.cms.templates.Includes.ModelAdmin_left.ss
include(/var/tmp/silverstripe-cache-web-1-000-048-259-188494-htdocs-oscompamir/.cache.web.1.000.048.259.188494.htdocs.oscompamir.cms.templates.Includes.ModelAdmin_left.ss) 
Line 357 of SSViewer.php
SSViewer->process(ProductsAndGroupsModelAdmin) 
Line 773 of ViewableData.php
ViewableData->renderWith(Array) 
Line 448 of LeftAndMain.php
LeftAndMain->Left() 
call_user_func_array(Array,Array) 
Line 408 of ViewableData.php
ViewableData->XML_val(Left,,1) 
Line 59 of .cache.web.1.000.048.259.188494.htdocs.oscompamir.cms.templates.LeftAndMain.ss
include(/var/tmp/silverstripe-cache-web-1-000-048-259-188494-htdocs-oscompamir/.cache.web.1.000.048.259.188494.htdocs.oscompamir.cms.templates.LeftAndMain.ss) 
Line 357 of SSViewer.php
SSViewer->process(ProductsAndGroupsModelAdmin) 
Line 172 of Controller.php
Controller->handleAction(HTTPRequest) 
Line 129 of RequestHandler.php
RequestHandler->handleRequest(HTTPRequest) 
Line 119 of Controller.php
Controller->handleRequest(HTTPRequest) 
Line 277 of Director.php
Director::handleRequest(HTTPRequest,Session) 
Line 121 of Director.php
Director::direct(/admin/products/) 
Line 118 of main.php

I searched for the product folder, but I did not find one.

Does anyone has a clue?

Thanks and bye

Daniel