mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
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:
parent
c32595d1c8
commit
c582f08ea3
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user