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.

Archive /

Our old forums are still available as a read-only archive.

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

Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem

Go to End

6 Posts   2864 Views


28 Posts

20 September 2007 at 6:58am

In upgrading to version 2.1.0-rc1 I'm getting the following error when attemting
to access the CMS:

Fatal error: Call to undefined method stdClass::allMethodNames() in /var/www/html/w/sapphire/core/Object.php on line 203

After many hours of playing with the upgrading, Upgrading one table at a
time. It seems to be a problem with the SiteTree table and the CMS.
the CMS does not like the first record of SiteTree to be of className="HomePage"

mysite/templates/ and mysite/code/HomePage.php
are not the problem because I can copy the and Page.php
to and HomePage.php and have the same problem.

The Record in SiteTree is record ID=1
If I change the first record to className="Page" it works
UPDATE SiteTree set className="Page" where ID=1;
If I change a non-first record to className="HomePage" it works
UPDATE SiteTree set className="HomePage" where ID=5;
However if I try to change the first record ID to another value
where it remains the first record it errors out again
UPDATE SiteTree set className="HomePage",ID=2 where ID=1;
I can change the className to another class (custom) and it works
UPDATE SiteTree set className="SectionHolder" where ID=1;
I can change the ID to a higher unused value (ID=6 where ID=3 and
ID=4) and it still errors
UPDATE SiteTree set className="HomePage",ID=6 where ID=1;


28 Posts

20 September 2007 at 8:05am

I did a clean install of 2.1.0-rc1 selecting the BlackCandy template and
then copied code/Page.php to code/HomePage.php. Editted
code/HomePage.php and changed references to Page to HomePage.

I then logged on to the CMS. Set the home page to Behavior->HomePage
did a Save and Publish. Logged out of the CMS.

When attemting to reenter the CMS - I had the same bug recieving.
Fatal error: Call to undefined method stdClass::allMethodNames() in /var/www/html/ss210rc1/sapphire/core/Object.php on line 203

So it definitely is something to do with 2.1.0-rc1 not my old installation.


28 Posts

20 September 2007 at 8:30am

Edited: 20/09/2007 9:08am

Playing with the differences the problem appears that
you need a getCMSFields function even if there are no
data fields.

Actually, that didn't work either. I was accidently going
back to a version that className was still set to "Page";


53 Posts

20 September 2007 at 9:57am

have you tried a db/build?flush=1

i have had problems making various changes to a database and so in the end I deleted the database tables using phpmysqladmin (make sure you delete the various versions of HomePage, HomePage-draft, HomePage-Live) and then ran a db/build again.

It maybe best to change your page type back to Page and then change again after you've rebuilt the page type.




28 Posts

20 September 2007 at 10:36am

I pretty much do a db/build?flush=1 whenever I change the code/*.php


28 Posts

21 September 2007 at 6:22am

Finally solved it in a way that makes sense.

the HomePage.php was extending SiteTree and ContentController
for some reason.
When I changed it to exten Page and Page_Controller it worked