From 4f3d3fdbaba017db19d2fee68f4d82395af84a5c Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 5 May 2017 11:20:53 +1200 Subject: [PATCH] FIX: Soften coupling to SiteTree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SiteTree link still exists but the module will work if SiteTree isn’t installed. --- src/Context/SilverStripeContext.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Context/SilverStripeContext.php b/src/Context/SilverStripeContext.php index 84a7bca..50b3033 100644 --- a/src/Context/SilverStripeContext.php +++ b/src/Context/SilverStripeContext.php @@ -268,7 +268,9 @@ abstract class SilverStripeContext extends MinkContext implements SilverStripeAw } DataObject::flush_and_destroy_cache(); DataObject::reset(); - SiteTree::reset(); + if (class_exists(SiteTree::class)) { + SiteTree::reset(); + } } /**