silverstripe / silverstripe-subsites

Subsites module for Silverstripe CMS
http://addons.silverstripe.org/add-ons/silverstripe/subsites
BSD 3-Clause "New" or "Revised" License
65 stars 106 forks source link

Cannot view dependent pages when the link exists on content outside of `SiteTree` #436

Open ScopeyNZ opened 5 years ago

ScopeyNZ commented 5 years ago

Description

When viewing dependent pages (added by CMS) with Subsites installed the page will crash when the link to the page exists on a DBField that does not belong to the SiteTree (or a subclass of it).

Versions tested

CMS 4.4.x-dev Subsites 2.3.x-dev (Elemental 4.1.x-dev)

Steps to reproduce

Running composer remove silverstripe/subsites, dev/build, and then reloading the page resolves the issue.

Notes

From a very brief look, it seems as though there's some code somewhere assuming the existence of a Subsite attribute on whatever the end (Parent) relation is on a SiteTreeLink (I think). This is an invalid assumption.

michalkleiner commented 2 years ago

Still an issue at the end of 2021.

mikey-harveycameron commented 1 year ago

Still an issue. If stuck, write an extension to sitetree and use updateCMSFields to unset 'Subsite.Title' from the gridfield's setDisplayFields.