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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Can't login or view site


Go to End


9 Posts   3614 Views

Avatar
Gemmelai

Community Member, 3 Posts

2 March 2012 at 12:29am

All i did was move a folder the silverstripe interface crashed and i haven't been able to get in since the site doesn't show up either.
Please Help! I tried a devbuild and cgot the following:
Creating database records
PageComment
SiteTree
[Warning] Unknown class passed as parameter
GET /newdemosite/dev/build/?flush=1

Line 445 in /kolab/bacula-restores/var/www/vhosts/beta.gcd.ie/httpdocs/newdemosite/sapphire/core/Object.php
Source

436 * Prepare static variables before processing a {@link get_static} or {@link set_static}
437 * call.
438 */
439 private static function prepare_statics($class) {
440 // _cache_statics_prepared setting must come first to prevent infinite loops when we call
441 // get_static below
442 self::$_cache_statics_prepared[$class] = true;
443
444 // load statics now for DataObject classes
445 if(is_subclass_of($class, 'DataObject')) {
446 $extensions = Object::uninherited_static($class, 'extensions');
447 if($extensions) foreach($extensions as $extension) {
448 if(preg_match('/^([^(]*)/', $extension, $matches)) {
449 $extensionClass = $matches[1];
450 DataObjectDecorator::load_extra_statics($class, $extensionClass);
451 }

Trace

is_subclass_of(postgraduateCoursePage,DataObject)
Line 445 of Object.php
Object::prepare_statics(postgraduateCoursePage)
Line 269 of Object.php
Object::uninherited_static(postgraduateCoursePage,db)
Line 2020 of DataObject.php
DataObject::has_own_table(postgraduateCoursePage)
Line 89 of ClassInfo.php
ClassInfo::dataClassesFor(SiteTree)
Line 2258 of DataObject.php
DataObject->buildSQL(URLSegment = 'home')
Line 2523 of DataObject.php
DataObject->instance_get_one(URLSegment = 'home',)
Line 2468 of DataObject.php
DataObject::get_one(SiteTree,URLSegment = 'home')
Line 927 of SiteTree.php
SiteTree->requireDefaultRecords()
Line 212 of DatabaseAdmin.php
DatabaseAdmin->doBuild(,1)
Line 98 of DatabaseAdmin.php
DatabaseAdmin->build()
Line 136 of DevelopmentAdmin.php
DevelopmentAdmin->build(HTTPRequest)
Line 129 of RequestHandler.php
RequestHandler->handleRequest(HTTPRequest)
Line 119 of Controller.php
Controller->handleRequest(HTTPRequest)
Line 278 of Director.php
Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
Director::direct(/dev/build/)
Line 119 of main.php

Thanks in Advance

Gem

Avatar
martimiz

Forum Moderator, 1391 Posts

2 March 2012 at 6:47am

Edited: 02/03/2012 6:48am

>> All i did was move a folder

What folder did you move? If an assets folder - did you move it from within the silverstripe cms? If a module folder - did you try moving it back?

What error did you get when trying to visit the homepage? If no error: did you enable dev mode?

Possible reason: you moved the code for a pagetype for which pages existed in the CMS - that would effectively remove the classname for these pages from the database, resulting in errors - could that be the case here?

Avatar
debtfreeslave

Community Member, 13 Posts

2 March 2012 at 10:20pm

First thanks so much for getting back to me so soon.

Sorry I wasn't clearer here's what happened:
PROBLEM:
# I was using the SilverStripe interface, the site tree. We have a top level page which has other sub-pages underneath it
# I right clicked the page and used Duplicate page and children [That worked fine]
#I then changed the name of the page [That worked fine]
# I then went to move the page and it's children by dragging and dropping them
# The interface timed out
# Now I can't login to admin
# I can't see the site
# Here's the error's i'm getting http://www.gcd.ie/newdemosite/
TRIED:
I tried to clear the cache using the following
# http://mysite/?flush=1
# http://mysite/?flush=all
# http://mysite/dev/buildcache/?flush=1
# http://mysite/dev/buildcache/?flush=all

None of these seem to be working

I didn't move any of the back-end template files

Really Bizarre

Thanks in advance for your help

Gem

Avatar
martimiz

Forum Moderator, 1391 Posts

2 March 2012 at 11:57pm

I can think of this as a possible cause of this error:

you have a file postgraduateCoursePage.php somewhere, but a classname within that file doesn't correspond with the filename?

Avatar
debtfreeslave

Community Member, 13 Posts

5 March 2012 at 10:06pm

Thanks I removed the postgraduate pages and I can now see the site
http://www.gcd.ie/newdemosite/

But when I tried to log in I got the following error:
[User Error] Bad class to singleton() - postgraduateCoursePage
GET /newdemosite/admin

Line 261 in /kolab/bacula-restores/var/www/vhosts/beta.gcd.ie/httpdocs/newdemosite/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() - postgraduateCoursePage
Line 261 of Core.php
singleton(postgraduateCoursePage)
Line 206 of SiteTree.php
SiteTree::page_type_classes()
Line 302 of CMSMain.php
CMSMain->PageTypes()
Line 966 of CMSMain.php
CMSMain->AddPageOptionsForm()
call_user_func_array(Array,Array)
Line 318 of ViewableData.php
ViewableData->obj(AddPageOptionsForm)
Line 45 of .cache.kolab.bacula-restores.var.www.vhosts.beta.gcd.ie.httpdocs.newdemosite.cms.templates.Includes.CMSMain_left.ss
include(/kolab/bacula-restores/var/www/vhosts/beta.gcd.ie/httpdocs/newdemosite/silverstripe-cache/.cache.kolab.bacula-restores.var.www.vhosts.beta.gcd.ie.httpdocs.newdemosite.cms.templates.Includes.CMSMain_left.ss)
Line 357 of SSViewer.php
SSViewer->process(CMSMain)
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.kolab.bacula-restores.var.www.vhosts.beta.gcd.ie.httpdocs.newdemosite.cms.templates.LeftAndMain.ss
include(/kolab/bacula-restores/var/www/vhosts/beta.gcd.ie/httpdocs/newdemosite/silverstripe-cache/.cache.kolab.bacula-restores.var.www.vhosts.beta.gcd.ie.httpdocs.newdemosite.cms.templates.LeftAndMain.ss)
Line 357 of SSViewer.php
SSViewer->process(CMSMain)
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 278 of Director.php
Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
Director::direct(/admin)
Line 119 of main.php

Not sure but think this is because the postgraduate page is still in the db so i tried to do a http://www.gcd.ie/newdemosite/dev/buildcache/?flush=1 and got the following error:

* Publishing page 1122/1127: us2-photography
* Publishing page 1123/1127: debating-news
* Publishing page 1124/1127: ebrochure-2
* Publishing page 1125/1127: online-courses-being-delivered-at-griffith-college
* Publishing page 1126/1127: fees-slashed
* Publishing page 1127/1127: griffith-digital-launched
[Warning] mkdir() [function.mkdir]: File exists
GET /newdemosite/dev/buildcache/?flush=all

Line 20 in /kolab/bacula-restores/var/www/vhosts/beta.gcd.ie/httpdocs/newdemosite/sapphire/filesystem/Filesystem.php
Source

11 public static $folder_create_mask = 02775;
12
13 protected static $cache_folderModTime;
14
15 /**
16 * Create a folder, recursively
17 */
18 static function makeFolder($folder) {
19 if(!file_exists($base = dirname($folder))) self::makeFolder($base);
20 if(!file_exists($folder)) mkdir($folder, Filesystem::$folder_create_mask);
21 }
22
23 /**
24 * Remove a directory and all subdirectories and files
25 * @param $contentsOnly If this is true then the contents of the folder will be removed but not the folder itself
26 */

Trace

mkdir(../cache/http://www.gcd.ie/,1533)
Line 20 of Filesystem.php
Filesystem::makeFolder(../cache/http://www.gcd.ie/)
Line 108 of FilesystemPublisher.php
FilesystemPublisher->publishPages(Array)
call_user_func_array(Array,Array)
Line 550 of Object.php
Object->__call(publishPages,Array)
Page->publishPages(Array)
Line 57 of RebuildStaticCacheTask.php
RebuildStaticCacheTask->rebuildCache(Array,1)
Line 27 of RebuildStaticCacheTask.php
RebuildStaticCacheTask->index(HTTPRequest)
Line 159 of Controller.php
Controller->handleAction(HTTPRequest)
Line 129 of RequestHandler.php
RequestHandler->handleRequest(HTTPRequest)
Line 119 of Controller.php
Controller->handleRequest(HTTPRequest)
Line 278 of Director.php
Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
Director::direct(/dev/buildcache/)
Line 119 of main.php

Any help greatly appreciated Thnaks in advance

Gemma

Avatar
martimiz

Forum Moderator, 1391 Posts

5 March 2012 at 11:05pm

Did you check the file itself for discrepancies in the classnames? Classnames should be equal to the filename - case sensitive!! - optionally followed by an underscrore and some other string of ccharacters.

It might just be a case of repairing this and doing a dev/build....

Avatar
debtfreeslave

Community Member, 13 Posts

5 March 2012 at 11:56pm

Hi Martimiz

Yes I tried that but it fixed only part of the problem you were right the name was spelt wrong now I have eliminated/deleted both files PostgraduateCoursePage.ss and PostgraduateCoursePage.php done a dev build and get this error but I can now see the front end of the site still can't get into admin area.

Thanks Gemma

Avatar
martimiz

Forum Moderator, 1391 Posts

6 March 2012 at 7:25am

Edited: 06/03/2012 7:26am

Hi Gemma,

Fixing the classname/filename issue might still have worked, but ok - now the problem might be that you already created one or more pages of that pagetype, that does now no longer exist. One quick way to fix this would be straight in the Database (please create a database backup before changing anything):

In tables Sitetree and Sitetree_Live both(!), look for pages that have an empty value for the ClassName field, or a ClassName still called 'postgraduateCoursePage' and change those to 'Page'. Then you should be able to open the admin area.

If so, reinstall the (fixed!) pagetype and set the pages back to he desired pagetype. Hope this works :-)

Martine

Go to Top