IMPR: Legacy pages

This commit is contained in:
Tony Air 2023-12-13 02:24:51 +02:00
parent 2bbbb541c5
commit 34a0f71edc
1 changed files with 9 additions and 6 deletions

View File

@ -2,11 +2,11 @@
namespace A2nt\CMSNiceties\GraphQL; namespace A2nt\CMSNiceties\GraphQL;
use A2nt\CMSNiceties\Templates\DeferredRequirements; use SilverStripe\CMS\Model\RedirectorPage;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\GraphQL\Controller as GraphQLController; use SilverStripe\GraphQL\Controller as GraphQLController;
use SilverStripe\Core\Extension; use SilverStripe\Core\Extension;
use SilverStripe\View\Requirements; use SilverStripe\ErrorPage\ErrorPage;
/** /**
* Class \A2nt\CMSNiceties\GraphQL\ObjectGraphQlEx * Class \A2nt\CMSNiceties\GraphQL\ObjectGraphQlEx
@ -70,9 +70,12 @@ class ObjectGraphQlEx extends Extension
{ {
$object = $this->owner; $object = $this->owner;
return $object->config()->get('legacy') || in_array($object->ClassName, [ return $object->config()->get('legacy') || in_array(
RedirectorPage::class, $object->ClassName,
ErrorPage::class, [
]); RedirectorPage::class,
ErrorPage::class,
]
);
} }
} }