Permalink
Browse files

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...
1 parent f2f45d6 commit 10f030de677b6f815b000bc9f53e0e4221b47ec6 @halkyon halkyon committed Mar 26, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 code/controllers/AssetAdmin.php
View
6 code/controllers/AssetAdmin.php
@@ -407,7 +407,11 @@ public function doAdd($data, $form) {
mkdir($record->FullPath);
chmod($record->FullPath, Filesystem::$file_create_mask);
- return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID));
+ if($parentRecord) {
+ return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID));
+ } else {
+ return $this->redirect($this->Link());
+ }
}
/**

0 comments on commit 10f030d

Please sign in to comment.