src/ErrorPage.php
public function requireDefaultRecords()
    {
        parent::requireDefaultRecords();

        // Only run on ErrorPage class directly, not subclasses
        if (static::class !== self::class || !SiteTree::config()->create_default_pages) {
            return;
        }

        $defaultPages = $this->getDefaultRecords();

        foreach ($defaultPages as $defaultData) {
            $this->requireDefaultRecordFixture($defaultData);
        }
    }
public function requireDefaultRecords()
    {
        parent::requireDefaultRecords();

        // Only run on ErrorPage class directly, not subclasses
        if (static::class !== self::class || !SiteTree::config()->create_default_pages) {
            return;
        }

        $defaultPages = $this->getDefaultRecords();

        foreach ($defaultPages as $defaultData) {
            $this->requireDefaultRecordFixture($defaultData);
        }
    }
public function requireDefaultRecords ( ) { parent :: requireDefaultRecords ( ) ; // Only run on ErrorPage class directly, not subclasses if ( static :: class !== self :: class || ! SiteTree :: config ( ) -> create_default_pages ) { return ; } $ defaultPages = $ this -> getDefaultRecords ( ) ; foreach ( $ defaultPages as $ defaultData ) { $ this -> requireDefaultRecordFixture ( $ defaultData ) ; } }
Ensures that there is always a 404 page by checking if there's an
instance of ErrorPage with a 404 and 500 error code. If there is not,
one is created when the DB is built.
Ensures that there is always a 404 page by checking if there s an instance of ErrorPage with a 404 and 500 error code . If there is not one is created when the DB is built .