Open kinglozzer opened 5 years ago
What do you think the expected behaviour should be instead?
That’s a tough one, I was thinking if (!class_exists($parentClass)) continue;
but that could mean that the user isn’t notified about a dependent page. Although that is better than seeing an internal server error... :P
Still affects v5, is it possible to add the label affects/v5? Could there be a way to resolve these dependencies somehow, when removing page types?
If a page type is removed, records left in the
SiteTreeLink
table may still point to it withParentClass='App\Model\RemovedPageClass'
. This can result in aInjectorNotFound
exception in the CMS (from the dependent pages logic), caused by this line:https://github.com/silverstripe/silverstripe-cms/blob/a083fc5d5b625890f91098719aadbdf025f5a7c7/code/Model/SiteTree.php#L1822
$parentClass
doesn’t exist any more once the page type has been removed