Skip to content
This repository
Browse code

Checking for existence of 'Locale' data in CMS controllers

Only applies for Translatable extension installed
  • Loading branch information...
commit 89079c4ca0bfca0c5ecadd0f5e939143148724c1 1 parent db47dcf
Ingo Schommer authored June 29, 2012
4  code/controllers/CMSPageAddController.php
@@ -122,7 +122,9 @@ public function doAdd($data, $form) {
122 122
 		}
123 123
 
124 124
 		$record = $this->getNewItem("new-$className-$parentID".$suffix, false);
125  
-		if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale'];
  125
+		if(class_exists('Translatable') && $record->hasExtension('Translatable') && isset($data['Locale'])) {
  126
+			$record->Locale = $data['Locale'];
  127
+		}
126 128
 
127 129
 		try {
128 130
 			$record->write();

0 notes on commit 89079c4

Please sign in to comment.
Something went wrong with that request. Please try again.