Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem

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

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

Page: 1
Go to End
Author Topic: 2539 Views
  • Tkop
    Avatar
    28 Posts

    Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem Link to this post

    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/HomePage.ss and mysite/code/HomePage.php
    are not the problem because I can copy the Page.ss and Page.php
    to HomePage.ss 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;

  • Tkop
    Avatar
    28 Posts

    Re: Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem Link to this post

    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.

  • Tkop
    Avatar
    28 Posts

    Re: Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem Link to this post

    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";

  • trevor
    Avatar
    53 Posts

    Re: Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem Link to this post

    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.

    HTH

    Trevor

  • Tkop
    Avatar
    28 Posts

    Re: Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem Link to this post

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

  • Tkop
    Avatar
    28 Posts

    Re: Re: SilverStripe 2.1.0-rc1 - CMS upgrading problem Link to this post

    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

    2539 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.