21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1300 Views |
-
[User Error] Bad class to singleton() - HomePage

28 April 2009 at 11:07pm
Hi, just playing with silverstripe for the first time, hoping that this is a typical newbie problem, but am struggling to find resources for specific errors. Hope someone can help thanks for your time.
Dan.
Problem occurs when flushing the database after creating the homepage.php in tutorial 1.
Building Database
Creating database tables
# PageComment
# SiteTree
# Field SiteTree.ClassName: changed to enum('SiteTree','Page','GhostPage','HomePage','ErrorPage','RedirectorPage','VirtualPage') character set utf8 collate utf8_general_ci default 'SiteTree' (from enum('SiteTree','Page','GhostPage','ErrorPage','RedirectorPage','VirtualPage') character set utf8 collate utf8_general_ci default 'SiteTree')
# Field SiteTree_Live.ClassName: changed to enum('SiteTree','Page','GhostPage','HomePage','ErrorPage','RedirectorPage','VirtualPage') character set utf8 collate utf8_general_ci default 'SiteTree' (from enum('SiteTree','Page','GhostPage','ErrorPage','RedirectorPage','VirtualPage') character set utf8 collate utf8_general_ci default 'SiteTree')
# Field SiteTree_versions.ClassName: changed to enum('SiteTree','Page','GhostPage','HomePage','ErrorPage','RedirectorPage','VirtualPage') character set utf8 collate utf8_general_ci default 'SiteTree' (from enum('SiteTree','Page','GhostPage','ErrorPage','RedirectorPage','VirtualPage') character set utf8 collate utf8_general_ci default 'SiteTree')
# Email_BounceRecord
# QueuedEmail
# File
# Group
# LoginAttempt
# Member
# MemberPassword
# Permission
# Widget
# WidgetArea
# Page
# GhostPage
# ErrorPage
# RedirectorPage
# VirtualPage
# Image
# Folder
# Image_CachedCreating database records
# PageComment
# SiteTree
[User Error] Bad class to singleton() - HomePage
GET /silver/SilverStripe/dev/build?flush=1Line 263 in /home/digitalp/public_html/silver/SilverStripe/sapphire/core/Core.php
Source254 if(($pos = strpos($className,'_')) !== false) $className = substr($className,0,$pos);
255 if($_CLASS_MANIFEST[$className]) return $_CLASS_MANIFEST[$className];
256 }
257
258 function singleton($className) {
259 static $_SINGLETONS;
260 if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
261 if(!is_string($className)) user_error("singleton() passed bad class_name: " . var_export($className,true), E_USER_ERROR);
262 if(!isset($_SINGLETONS[$className])) {
263 if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
264 $_SINGLETONS[$className] = Object::strong_create($className,null, true);
265 if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
266 }
267 return $_SINGLETONS[$className];
268 }
269Trace
* Bad class to singleton() - HomePage
Line 263 of Core.php
* singleton(HomePage)
Line 1867 of DataObject.php
* DataObject::has_own_table(HomePage)
Line 89 of ClassInfo.php
* ClassInfo::dataClassesFor(SiteTree)
Line 2109 of DataObject.php
* DataObject->buildSQL(URLSegment = 'home')
Line 2366 of DataObject.php
* DataObject->instance_get_one(URLSegment = 'home',)
Line 2320 of DataObject.php
* DataObject::get_one(SiteTree,URLSegment = 'home')
Line 925 of SiteTree.php
* SiteTree->requireDefaultRecords()
Line 210 of DatabaseAdmin.php
* DatabaseAdmin->doBuild(,1)
Line 100 of DatabaseAdmin.php
* DatabaseAdmin->build()
Line 130 of DevelopmentAdmin.php
* DevelopmentAdmin->build(HTTPRequest)
Line 107 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(/dev/build)
Line 115 of main.php -
Re: [User Error] Bad class to singleton() - HomePage

29 April 2009 at 12:29am
Can you post the code you have in HomePage.php?
-
Re: [User Error] Bad class to singleton() - HomePage

29 April 2009 at 12:42am
hey thanks for the reply,
I figured out it was just camelcasing on the filename, i come from a .NET background where casing isn't important, trying to mend my evil ways. mod can mark as solved now.
thanks again
| 1300 Views | ||
|
Page:
1
|
Go to Top |


