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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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
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
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
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.
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
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
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?
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