MINOR Ensuring a valid Folder object is returned from AssetAdmin->currentPage() to avoid breaking AssetAdmin->getEditForm(), e.g. when a GridField search is conducted

This commit is contained in:
Ingo Schommer 2012-02-23 16:25:35 +01:00
parent c32595d1c8
commit c582f08ea3

View File

@ -301,9 +301,10 @@ JS
public function currentPage() {
$id = $this->currentPageID();
if($id && is_numeric($id)) {
return DataObject::get_by_id('File', $id);
} else if($id == 'root') {
return singleton('File');
return DataObject::get_by_id('Folder', $id);
} else {
// ID is either '0' or 'root'
return singleton('Folder');
}
}