SilverStripe\CMS\Tasks\RemoveOrphanedPagesTask
Identify "orphaned" pages which point to a parent that no longer exists in a specific stage.
Shows the pages to an administrator, who can then
decide which pages to remove by ticking a checkbox
and manually executing the removal.
Caution: Pages also count as orphans if they don't
have parents in this stage, even if the parent has a representation
in the other stage:
- A live child is orphaned if its parent was deleted from live, but still exists on stage
- A stage child is orphaned if its parent was deleted from stage, but still exists on live
See for an example sitetree
before and after orphan removal.
- Author: Ingo Schommer (<firstname>@silverstripe.com), SilverStripe Ltd.
Synopsis
class RemoveOrphanedPagesTask
extends Controller
{
- // members
- private static array $allowed_actions = ;
- protected string $title = 'Removed orphaned pages without existing parents from both stage and live';
- protected string $description = " <p> Identify 'orphaned' pages which point to a parent that no longer exists in a specific stage. </p> <p> Caution: Pages also count as orphans if they don't have parents in this stage, even if the parent has a representation in the other stage:<br /> - A live child is orphaned if its parent was deleted from live, but still exists on stage<br /> - A stage child is orphaned if its parent was deleted from stage, but still exists on live </p> ";
- protected $orphanedSearchClass = SiteTree::class;
- // methods
- protected void init()
- public void Link()
- public void index()
- public void Form()
- public void run()
- public void doSubmit()
- protected void removeOrphans()
- protected void rebaseHolderTitle()
- protected void rebaseOrphans()
- public SS_List getOrphanedPages()
Hierarchy
Extends
- SilverStripe\Control\Controller
Tasks
Line | Task |
---|---|
200 | Merge with BuildTask functionality |
Members
private
- $allowed_actions
protected
- $description
- $orphanedSearchClass
- $title
Methods
protected
public
- Form()
- Link()
- doSubmit()
- getOrphanedPages() — Gets all orphans from "Stage" and "Live" stages.
- index()
- run()