Skip to content
This repository
Browse code

BUGFIX When adding a top level folder in AssetAdmin, ensure you are

taken back to the top level folder view. Currently there is a non-object
error adding a root level folder.
  • Loading branch information...
commit 10f030de677b6f815b000bc9f53e0e4221b47ec6 1 parent f2f45d6
Sean Harvey authored March 27, 2012

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  code/controllers/AssetAdmin.php
6  code/controllers/AssetAdmin.php
@@ -407,7 +407,11 @@ public function doAdd($data, $form) {
407 407
 		mkdir($record->FullPath);
408 408
 		chmod($record->FullPath, Filesystem::$file_create_mask);
409 409
 
410  
-		return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID));
  410
+		if($parentRecord) {
  411
+			return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID));
  412
+		} else {
  413
+			return $this->redirect($this->Link());
  414
+		}
411 415
 	}
412 416
 
413 417
 	/**

0 notes on commit 10f030d

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