From e70fa8f2e73f837bf44781e0966405c8132e0fe0 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Mon, 28 Apr 2008 06:41:22 +0000 Subject: [PATCH] fix the bug when there is no subsite created yet, the assets admin is broken. --- code/FileSubsites.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/FileSubsites.php b/code/FileSubsites.php index 4f2d415..d9ddc96 100755 --- a/code/FileSubsites.php +++ b/code/FileSubsites.php @@ -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)"))); } }