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.

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;
}

Hierarchy

Extends

  • SilverStripe\Control\Controller

Tasks

Line Task
200 Merge with BuildTask functionality

Members

private

  • $allowed_actions

protected

  • $description
  • $orphanedSearchClass
  • $title

Methods

protected

public