From f380700ea67878dcb092f87a089e809d7e411011 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:16:21 +1200 Subject: [PATCH] FIX Only include extension if elemental is installed (#196) --- _config/extensions.yml | 5 ++++- code/elemental/MultiElementalBehatTestAdmin.php | 4 ---- code/elemental/MutliElementalBehatTestObject.php | 9 --------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/_config/extensions.yml b/_config/extensions.yml index f681410..ee8e25f 100644 --- a/_config/extensions.yml +++ b/_config/extensions.yml @@ -53,6 +53,10 @@ SilverStripe\FrameworkTest\Elemental\Model\ElementalBehatTestObject: - DNADesign\Elemental\Extensions\ElementalAreasExtension - SilverStripe\FrameworkTest\Elemental\Extension\ElementalBehatTestExtension +SilverStripe\FrameworkTest\Elemental\Model\MultiElementalBehatTestObject: + extensions: + - SilverStripe\FrameworkTest\Elemental\Extension\MultiElementalAreasExtension + BasicElementalPage: extensions: - DNADesign\Elemental\Extensions\ElementalPageExtension @@ -69,7 +73,6 @@ SilverStripe\FrameworkTest\Model\Company: extensions: - SilverStripe\FrameworkTest\LinkField\Extensions\CompanyExtension - --- Only: moduleexists: diff --git a/code/elemental/MultiElementalBehatTestAdmin.php b/code/elemental/MultiElementalBehatTestAdmin.php index 29241e1..663a084 100644 --- a/code/elemental/MultiElementalBehatTestAdmin.php +++ b/code/elemental/MultiElementalBehatTestAdmin.php @@ -5,10 +5,6 @@ namespace SilverStripe\FrameworkTest\Elemental\Admin; use SilverStripe\Admin\ModelAdmin; use SilverStripe\FrameworkTest\Elemental\Model\MultiElementalBehatTestObject; -if (!class_exists(MultiElementalBehatTestObject::class)) { - return; -} - class MutliElementalBehatTestAdmin extends ModelAdmin { private static $url_segment = 'multi-elemental-behat-test-admin'; diff --git a/code/elemental/MutliElementalBehatTestObject.php b/code/elemental/MutliElementalBehatTestObject.php index dd593d8..66a1536 100644 --- a/code/elemental/MutliElementalBehatTestObject.php +++ b/code/elemental/MutliElementalBehatTestObject.php @@ -3,11 +3,6 @@ namespace SilverStripe\FrameworkTest\Elemental\Model; use SilverStripe\ORM\DataObject; -use SilverStripe\FrameworkTest\Elemental\Extension\MultiElementalAreasExtension; - -if (!class_exists(MultiElementalAreasExtension::class)) { - return; -} class MultiElementalBehatTestObject extends DataObject { @@ -17,10 +12,6 @@ class MultiElementalBehatTestObject extends DataObject private static $table_name = 'ElementalMultiBehatTestObject'; - private static $extensions = [ - MultiElementalAreasExtension::class, - ]; - public function canView($member = null) { return true;