Merge pull request #58 from oddnoc/safe-sitetree

Make SiteTree reference conditional in InitProcessor
This commit is contained in:
Ingo Schommer 2014-08-02 17:54:20 +12:00
commit bf36edecad

View File

@ -197,6 +197,7 @@ class FeatureContext extends SilverStripeContext {
$factory->define('Member', $blueprint);
// Auto-publish pages
if (class_exists('SiteTree')) {
foreach(\ClassInfo::subclassesFor('SiteTree') as $id => $class) {
$blueprint = \Injector::inst()->create('FixtureBlueprint', $class);
$blueprint->addCallback('afterCreate', function($obj, $identifier, &$data, &$fixtures) {
@ -205,6 +206,7 @@ class FeatureContext extends SilverStripeContext {
$factory->define($class, $blueprint);
}
}
}
public function setMinkParameters(array $parameters) {
parent::setMinkParameters($parameters);