Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » "Orphan" pages in SiteTree

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

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

Page: 1
Go to End
Author Topic: 1083 Views
  • Double-A-Ron
    Avatar
    Community Member
    603 Posts

    "Orphan" pages in SiteTree Link to this post

    Hi all,

    I had an issue where a page I was creating for a site was appending "-12" to the URL even if I removed it manually. I knew this meant there was a conflicting URL in the system.

    I checked it out in the SiteTree table and found the conflicting page. I got it's Parent number in an attempt to find out where it was and found that the Parent ID did not exist in either SiteTree or SiteTree_Live.

    So I wrote a little script to check this out by getting all the pages from SiteTree and check that their ParentID exists in turn (except for ParentID of 0). I found litteraly dozens of "Orphan" pages in the system.

    So a few questions:
    1. Anyone know how something like this happens?
    2. Is there a /dev/build function or the likes for cleaning this up?
    3. If no to 2., is there any reason why I shouldn't use this script to remove this orphans. e.g. Could their parents be in another table perhaps?

    Cheers
    Aaron

  • rbquirke
    Avatar
    Community Member
    70 Posts

    Re: "Orphan" pages in SiteTree Link to this post

    Hmm, I'm going to have to do an orphan pages report for a client soon, so I'm interested in the topic.

    It isn't anything to do with page histories/revisions is it?

  • Double-A-Ron
    Avatar
    Community Member
    603 Posts

    Re: "Orphan" pages in SiteTree Link to this post

    Don't think so.

    I find these pages in SiteTree, and they don't appear to have 'real' parents in SiteTree, SiteTree_Live or SiteTree_versions.

    I've attached the code I used to clean a test copy of the site in question. All seems well so far. Just basic Run of the mill PHP in there. Couldn't be knackered working Sapphire into this.

    Aaron

    Attached Files
  • rbquirke
    Avatar
    Community Member
    70 Posts

    Re: "Orphan" pages in SiteTree Link to this post

    Cheers.

    I will update this thread with my code if the client goes ahead with getting the report.....

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