From 9fdc7cb2ff5f04583e5c09eedaee9f9641575673 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 13 Apr 2010 02:28:34 +0000 Subject: [PATCH] BUGFIX Don't allow translations of VirtualPage (until we can reliably copy data between locales) (see #5000) (from r98217) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102626 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Translatable.php | 6 ++++++ core/model/VirtualPage.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/model/Translatable.php b/core/model/Translatable.php index 156ef01c6..abc4c8cb5 100755 --- a/core/model/Translatable.php +++ b/core/model/Translatable.php @@ -890,6 +890,12 @@ class Translatable extends DataObjectDecorator implements PermissionProvider { // Don't apply these modifications for normal DataObjects - they rely on CMSMain logic if(!($this->owner instanceof SiteTree)) return; + // Don't allow translation of virtual pages because of data inconsistencies (see #5000) + $excludedPageTypes = array('VirtualPage'); + foreach($excludedPageTypes as $excludedPageType) { + if(is_a($this->owner, $excludedPageType)) return; + } + $excludeFields = array( 'ViewerGroups', 'EditorGroups', diff --git a/core/model/VirtualPage.php b/core/model/VirtualPage.php index 7f14f9dd9..d7201ec2a 100755 --- a/core/model/VirtualPage.php +++ b/core/model/VirtualPage.php @@ -31,7 +31,7 @@ class VirtualPage extends Page { "Status", 'ShowInMenus', 'ShowInSearch', - 'Locale' + // 'Locale' ); $allFields = $this->db();