mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Merge pull request #58 from oddnoc/safe-sitetree
Make SiteTree reference conditional in InitProcessor
This commit is contained in:
commit
bf36edecad
@ -197,12 +197,14 @@ class FeatureContext extends SilverStripeContext {
|
|||||||
$factory->define('Member', $blueprint);
|
$factory->define('Member', $blueprint);
|
||||||
|
|
||||||
// Auto-publish pages
|
// Auto-publish pages
|
||||||
foreach(\ClassInfo::subclassesFor('SiteTree') as $id => $class) {
|
if (class_exists('SiteTree')) {
|
||||||
$blueprint = \Injector::inst()->create('FixtureBlueprint', $class);
|
foreach(\ClassInfo::subclassesFor('SiteTree') as $id => $class) {
|
||||||
$blueprint->addCallback('afterCreate', function($obj, $identifier, &$data, &$fixtures) {
|
$blueprint = \Injector::inst()->create('FixtureBlueprint', $class);
|
||||||
$obj->publish('Stage', 'Live');
|
$blueprint->addCallback('afterCreate', function($obj, $identifier, &$data, &$fixtures) {
|
||||||
});
|
$obj->publish('Stage', 'Live');
|
||||||
$factory->define($class, $blueprint);
|
});
|
||||||
|
$factory->define($class, $blueprint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user