From 1f190eb6989a2ab3b82d01908c26984b8101b80c Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Tue, 10 Jan 2012 14:01:25 +1300 Subject: [PATCH] BUGFIX: Return a RootForm for AssetAdmin so Form get the correct Fields on POST Solves issues with GridField and uploading on the root folder (/assets/) --- code/controllers/AssetAdmin.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/controllers/AssetAdmin.php b/code/controllers/AssetAdmin.php index 6bfbc76c..e1e0de63 100644 --- a/code/controllers/AssetAdmin.php +++ b/code/controllers/AssetAdmin.php @@ -85,6 +85,15 @@ JS CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder'); } + /** + * Return the root 'asset' folder CMSFields + * + * @return FieldList + */ + public function RootForm() { + return $this->getEditForm(singleton('Folder')); + } + /** * Show the content of the upload iframe. The form is specified by a template. */