mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Allowing translations of VirtualPage by not copying over original Locale property (see #5000) (from r97912)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102554 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
48bd1ffa24
commit
6c0efa68de
@ -30,7 +30,8 @@ class VirtualPage extends Page {
|
|||||||
"Sort",
|
"Sort",
|
||||||
"Status",
|
"Status",
|
||||||
'ShowInMenus',
|
'ShowInMenus',
|
||||||
'ShowInSearch'
|
'ShowInSearch',
|
||||||
|
'Locale'
|
||||||
);
|
);
|
||||||
|
|
||||||
$allFields = $this->db();
|
$allFields = $this->db();
|
||||||
|
@ -681,6 +681,21 @@ class TranslatableTest extends FunctionalTest {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testLocalePersistsInAllPageTypes() {
|
||||||
|
$types = ClassInfo::subclassesFor('SiteTree');
|
||||||
|
foreach($types as $type) {
|
||||||
|
if(singleton($type) instanceof TestOnly) continue;
|
||||||
|
|
||||||
|
$enPage = new $type();
|
||||||
|
$enPage->Locale = 'en_US';
|
||||||
|
$enPage->write();
|
||||||
|
|
||||||
|
$dePage = $enPage->createTranslation('de_DE');
|
||||||
|
$dePage->write();
|
||||||
|
$this->assertEquals('de_DE', $dePage->Locale, "Page type $type retains Locale property");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function testGetTranslationByStage() {
|
function testGetTranslationByStage() {
|
||||||
$publishedPage = new SiteTree();
|
$publishedPage = new SiteTree();
|
||||||
$publishedPage->Locale = 'en_US';
|
$publishedPage->Locale = 'en_US';
|
||||||
|
Loading…
Reference in New Issue
Block a user