mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
fix the bug when there is no subsite created yet, the assets admin is broken.
This commit is contained in:
parent
1498427430
commit
e70fa8f2e7
@ -30,7 +30,7 @@ class FileSubsites extends DataObjectDecorator {
|
|||||||
function updateCMSFields(FieldSet &$fields) {
|
function updateCMSFields(FieldSet &$fields) {
|
||||||
if($this->owner instanceof Folder) {
|
if($this->owner instanceof Folder) {
|
||||||
$sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
|
$sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
|
||||||
$fields->addFieldToTab('Root.Details', new DropdownField("SubsiteID", "Subsite", $sites->toDropdownMap('ID', 'Title', "(Public)")));
|
if($sites)$fields->addFieldToTab('Root.Details', new DropdownField("SubsiteID", "Subsite", $sites->toDropdownMap('ID', 'Title', "(Public)")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user