Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » SS auto changing 'home' to 'home-2'

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: 1653 Views
  • Phill
    Avatar
    Community Member
    75 Posts

    SS auto changing 'home' to 'home-2' Link to this post

    Hey guys

    i have a problem with SS i have a page with the url 'home-2' but when i try to change it to 'home' SS changes it back to 'home-2'.

    Iv been talking on irc and checked through the cp and in the db siteTree and siteTreeLive table and there is no page with the url 'home'

    Iv tried changing the url manualy in the db in both the siteTree and siteTreeLive table which fixes the problem intill the page is updated though the cms where its url gets changed back to 'home-2'

    Any ideas on whats causing the problem and how i could fix it?

    Thanks

  • Blackdog
    Avatar
    Community Member
    156 Posts

    Re: SS auto changing 'home' to 'home-2' Link to this post

    I had the same problem with 2.2.2 running locally on WAMP.

    In the end I just did a fresh install.

  • Phill
    Avatar
    Community Member
    75 Posts

    Re: SS auto changing 'home' to 'home-2' Link to this post

    Ok thanks

    That is interesting because i am also running it local on wamp

    But I would prefer not to do a complete re-install because iv made a custome template and put most of the content in for a faily big site.

  • KendallB
    Avatar
    Community Member
    5 Posts

    Re: SS auto changing 'home' to 'home-2' Link to this post

    Custom templates won't be deleted upon reinstall. Just for sure, make a backup of the file, but I've reinstalled a number of times and never lost any templates from my custom themes.

  • Krato
    Avatar
    Community Member
    7 Posts

    Re: SS auto changing 'home' to 'home-2' Link to this post

    This appears to be a bug since I had the same problem and even deleting all records from db tables SiteTree, SiteTree_Live and SiteTree_versions didn´t help, the CMS continued renaming my home page URL to home-2 (and I was pretty sure there was no "home" URL in database).
    I managed to solve the issue this way:

    - Open the file sapphire/core/model/SiteTree.php
    - Go to line 782 and substitute this code:

    while(class_exists($this->URLSegment) || DataObject::get_one("SiteTree", "URLSegment = '$this->URLSegment' $idFilter")) {


    by this one:

    while(DataObject::get_one("SiteTree", "URLSegment = '$this->URLSegment' $idFilter")) {

    This change will stop the CMS from renaming the home URL to home-2 and apparently has no side effect to other functionality within the CMS.

    Regards,
    Daniel K.

  • Rube_25
    Avatar
    Community Member
    36 Posts

    Re: SS auto changing 'home' to 'home-2' Link to this post

    thanks Krato...
    I was with this problem 3 days...

    Nuevamente Gracias, el problema solo lo solucionaba por la base de datos. pero no era la mejor solución.

    Rube

    1653 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.