From 81318288c583c66ca760c387f61ddf8bc8897d14 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 4 Oct 2010 06:16:17 +0000 Subject: [PATCH] ENHANCEMENT: to make the FileIFrameField and TreeSelectionField easy to use in CMS with Translatable on. (from r103465) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111665 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index 443f1b67..8a3bc7a0 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -291,9 +291,13 @@ JS; } // Don't open a page from a different locale - if($record && Object::has_extension('SiteTree', 'Translatable') && $record->Locale && $record->Locale != Translatable::get_current_locale()) { + /** The record's Locale is saved in database in 2.4, and not related with Session, we should check their locale matches the Translatable::get_current_locale, + * as long as we all the HTTPRequest is init with right locale. + * This bit breaks the all FileIFrameField functions if the field is used in CMS and its relevent ajax calles, like loading the tree dropdown for TreeSelectorField. + */ + /* if($record && Object::has_extension('SiteTree', 'Translatable') && $record->Locale && $record->Locale != Translatable::get_current_locale()) { $record = null; - } + }*/ return $record;