Jump to:

1160 Posts in 2621 Topics by 409 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » Redundant PageID introduced into Page in 2.4.2?

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1
Go to End
Author Topic: 1130 Views
  • pter
    Avatar
    Community Member
    38 Posts

    Redundant PageID introduced into Page in 2.4.2? Link to this post

    As mentioned in http://www.silverstripe.org/general-questions/show/293504?start=8#post293637

    There seems to be some sort of forced addition of a ParentID field to the Page/Page_live tables. IMO this isn't needed, but where isis coming from?

    Pter

  • Willr
    Avatar
    Forum Moderator
    5503 Posts

    Re: Redundant PageID introduced into Page in 2.4.2? Link to this post

    pter have you installed any modules or applied any extra decorators? I could not reproduce this extra parent ID in my default installation of branches/2.4

  • pter
    Avatar
    Community Member
    38 Posts

    Re: Redundant PageID introduced into Page in 2.4.2? Link to this post

    No and don't use modules like blog, forums, etc.

    Just wiped out and replaced the 3 main dirs CMS, googlesitemaps and sapphire then did a dev/rebuild. It is most odd though - cannot find anywhere it might be getting it from so will have a closer look and have an umpteenth pass at the upgrade.

    Pter

  • Willr
    Avatar
    Forum Moderator
    5503 Posts

    Re: Redundant PageID introduced into Page in 2.4.2? Link to this post

    If you can't see it in the $db array then I'm guessing its coming from an extension. If you can reproduce the field then debug all the extensions enabled on that class, could be one thats on Page rather than SiteTree.

  • pter
    Avatar
    Community Member
    38 Posts

    Re: Redundant PageID introduced into Page in 2.4.2? Link to this post

    Correct and thanks Willr (for help and patience).

    I have one module of mine that has in the _config.php (with the brackets indicating it does not matter if Object or DataObject):

    (Data)Object::add_extension('Page', 'HidePages');

    Where HidePages is an extension of Hierarchy (in hidepages.php). Find code attached if you can help... at least it isn't a critical module but was in my dev site so triggered this. Nice to find out before too late. Wondering if SS is adding something as a result? Or still me and my module... I'll rip the extension to pieces to see if that can show anything.

    Update on ripping to bits: it does it even on an empty class.

    class HidePages extends Hierarchy {
    }

    It seems to be the extension to Hierarchy (which does not happen anywhere else). Am I missing something?

    Pter

    Attached Files
  • Willr
    Avatar
    Forum Moderator
    5503 Posts

    Re: Redundant PageID introduced into Page in 2.4.2? Link to this post

    Well you shouldn't extend Hierarchy from hidepages. Pages will already have Hierarchy applied to them (well SiteTrees) so you're applying Hierarchy to both the SiteTree and the Page which is giving you the multiple IDs

  • pter
    Avatar
    Community Member
    38 Posts

    Re: Redundant PageID introduced into Page in 2.4.2? Link to this post

    Ahhh and thanks.

    FYI based on some code that did work with up to and including 2.4.0 (never tried 2.4.1) so something has certainly changed, or more likely fixed, so this sort of method now becomes obviously wrong. So... while I go off and look for how to do it in this new environment, if you know and if it is a quick answer; how would I decorate/override the Hierarchy class to replace the stageChildren as desired?

  • pter
    Avatar
    Community Member
    38 Posts

    Re: Redundant PageID introduced into Page in 2.4.2? Link to this post

    Thanks heaps Willr. Consider this closed and if I have any other probs they'll be in the other thread for the module itself.

    http://www.silverstripe.org/customising-the-cms/show/280398?start=24#post293738

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