fix the bug when there is no subsite created yet, the assets admin is broken.

This commit is contained in:
Normann Lou 2008-04-28 06:41:22 +00:00
parent 1498427430
commit e70fa8f2e7

View File

@ -30,7 +30,7 @@ class FileSubsites extends DataObjectDecorator {
function updateCMSFields(FieldSet &$fields) {
if($this->owner instanceof Folder) {
$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)")));
}
}