public function onAfterRevertToLive()
    {
        // Use an alias to get the updates made by $this->publish
        /** @var SiteTree $stageSelf */
        $stageSelf = Versioned::get_by_stage(self::class, Versioned::DRAFT)->byID($this->ID);
        $stageSelf->writeWithoutVersion();

        // Need to update pages linking to this one as no longer broken
        foreach ($stageSelf->DependentPages() as $page) {
            /** @var SiteTree $page */
            $page->writeWithoutVersion();
        }
    }
public function onAfterRevertToLive()
    {
        // Use an alias to get the updates made by $this->publish
        /** @var SiteTree $stageSelf */
        $stageSelf = Versioned::get_by_stage(self::class, Versioned::DRAFT)->byID($this->ID);
        $stageSelf->writeWithoutVersion();

        // Need to update pages linking to this one as no longer broken
        foreach ($stageSelf->DependentPages() as $page) {
            /** @var SiteTree $page */
            $page->writeWithoutVersion();
        }
    }
public function onAfterRevertToLive ( ) { // Use an alias to get the updates made by $this->publish /** @var SiteTree $stageSelf */ $ stageSelf = Versioned :: get_by_stage ( self :: class , Versioned :: DRAFT ) -> byID ( $ this -> ID ) ; $ stageSelf -> writeWithoutVersion ( ) ; // Need to update pages linking to this one as no longer broken foreach ( $ stageSelf -> DependentPages ( ) as $ page ) { /** @var SiteTree $page */ $ page -> writeWithoutVersion ( ) ; } }
Update draft dependant pages
Update draft dependant pages