Checking for existence of 'Locale' data in CMS controllers

Only applies for Translatable extension installed
This commit is contained in:
Ingo Schommer 2012-06-29 14:22:24 +02:00
parent db47dcff47
commit 89079c4ca0

View File

@ -122,7 +122,9 @@ class CMSPageAddController extends CMSPageEditController {
}
$record = $this->getNewItem("new-$className-$parentID".$suffix, false);
if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale'];
if(class_exists('Translatable') && $record->hasExtension('Translatable') && isset($data['Locale'])) {
$record->Locale = $data['Locale'];
}
try {
$record->write();