mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Allowing 'root' as ID parameter in LeftAndMain->getEditForm() (necessary for AssetAdmin root folders etc.)
This commit is contained in:
parent
485ea3e41d
commit
40786cddd3
@ -459,6 +459,8 @@ class LeftAndMain extends Controller {
|
||||
$className = $this->stat('tree_class');
|
||||
if($className && $id instanceof $className) {
|
||||
return $id;
|
||||
} else if($id == 'root') {
|
||||
return singleton($className);
|
||||
} else if(is_numeric($id)) {
|
||||
return DataObject::get_by_id($className, $id);
|
||||
} else {
|
||||
@ -751,7 +753,7 @@ class LeftAndMain extends Controller {
|
||||
if(is_object($id)) {
|
||||
$record = $id;
|
||||
} else {
|
||||
$record = ($id && $id != "root") ? $this->getRecord($id) : null;
|
||||
$record = $this->getRecord($id);
|
||||
if($record && !$record->canView()) return Security::permissionFailure($this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user