Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Checking for existence of 'Locale' data in CMS controllers

Only applies for Translatable extension installed
  • Loading branch information...
commit 89079c4ca0bfca0c5ecadd0f5e939143148724c1 1 parent db47dcf
@chillu chillu authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 code/controllers/CMSPageAddController.php
View
4 code/controllers/CMSPageAddController.php
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.