mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Always including "Locale" field in Translatable->getCMSFields() regardless of "excluded" page types. Necessary to enable form state serialization for fields like TreeSelectorField on a VirtualPage (fixes #5269) (from r101747)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112031 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fd8e0044c4
commit
9087f79723
@ -893,6 +893,9 @@ 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;
|
||||
|
||||
// used in CMSMain->init() to set language state when reading/writing record
|
||||
$fields->push(new HiddenField("Locale", "Locale", $this->owner->Locale) );
|
||||
|
||||
// Don't allow translation of virtual pages because of data inconsistencies (see #5000)
|
||||
$excludedPageTypes = array('VirtualPage');
|
||||
foreach($excludedPageTypes as $excludedPageType) {
|
||||
@ -906,9 +909,6 @@ class Translatable extends DataObjectDecorator implements PermissionProvider {
|
||||
'CanEditType'
|
||||
);
|
||||
|
||||
// used in CMSMain->init() to set language state when reading/writing record
|
||||
$fields->push(new HiddenField("Locale", "Locale", $this->owner->Locale) );
|
||||
|
||||
// if a language other than default language is used, we're in "translation mode",
|
||||
// hence have to modify the original fields
|
||||
$creating = false;
|
||||
|
Loading…
Reference in New Issue
Block a user