Merge remote-tracking branch 'origin/3.1'

This commit is contained in:
Ingo Schommer 2013-03-27 12:12:21 +01:00
commit 51c00e33e6
2 changed files with 14 additions and 4 deletions

View File

@ -70,7 +70,7 @@ class ErrorPage extends Page {
public function requireDefaultRecords() {
parent::requireDefaultRecords();
if ($this->class == 'ErrorPage' && SiteTree::get_create_default_pages()) {
if ($this->class == 'ErrorPage' && SiteTree::config()->create_default_pages) {
// Ensure that an assets path exists before we do any error page creation
if(!file_exists(ASSETS_PATH)) {
mkdir(ASSETS_PATH);

View File

@ -17,15 +17,25 @@ class VirtualPageTest extends SapphireTest {
parent::setUp();
$this->origInitiallyCopiedFields = VirtualPage::config()->initially_copied_fields;
VirtualPage::config()->initially_copied_fields = array('MyInitiallyCopiedField');
Config::inst()->remove('VirtualPage', 'initially_copied_fields');
VirtualPage::config()->initially_copied_fields = array_merge(
$this->origInitiallyCopiedFields,
array('MyInitiallyCopiedField')
);
$this->origNonVirtualField = VirtualPage::config()->non_virtual_fields;
$nonVirtual = VirtualPage::config()->non_virtual_fields;
VirtualPage::config()->non_virtual_fields = array('MyNonVirtualField', 'MySharedNonVirtualField');
Config::inst()->remove('VirtualPage', 'non_virtual_fields');
VirtualPage::config()->non_virtual_fields = array_merge(
$this->origNonVirtualField,
array('MyNonVirtualField', 'MySharedNonVirtualField')
);
}
public function tearDown() {
parent::tearDown();
Config::inst()->remove('VirtualPage', 'initially_copied_fields');
Config::inst()->remove('VirtualPage', 'non_virtual_fields');
VirtualPage::config()->initially_copied_fields = $this->origInitiallyCopiedFields;
VirtualPage::config()->non_virtual_fields = $this->origNonVirtualField;
}