Skip to content

Commit

Permalink
Checking for existence of 'Locale' data in CMS controllers
Browse files Browse the repository at this point in the history
Only applies for Translatable extension installed
  • Loading branch information
chillu committed Jun 29, 2012
1 parent db47dcf commit 89079c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/controllers/CMSPageAddController.php
Expand Up @@ -122,7 +122,9 @@ public function doAdd($data, $form) {
}

$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();
Expand Down

0 comments on commit 89079c4

Please sign in to comment.