Code

Added additional checks to prevent invalid folder widget initialization.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Oct 2010 13:58:50 +0000 (13:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Oct 2010 13:58:50 +0000 (13:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20035 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc

index 1fde7b8f3d222a49853a7a8eb35c820ebe1ff7e0..fc409dd867ef013bbbf7f9eedb4ef5cbd709b842 100644 (file)
@@ -116,6 +116,14 @@ class FolderWidget extends plugin
     function setFolderList($arr)
     {
         $this->buildRecursiveList($arr, $this->pathSeparator);
+
+        // Ensure that we've at least the base folder set
+        if(!isset($this->folderList[$this->accountPrefix])){
+            $this->addPath($this->accountPrefix, preg_replace("/^.*\//","", $this->accountPrefix));
+
+            trigger_error(sprintf("You reuquire at least a folder named '%s'! This time it was added automatically.", 
+                $this->accountPrefix));
+        }
     }