Branch 'roundcubemail-plugins-kolab-3.1' - plugins/libkolab

Aleksander Machniak machniak at kolabsys.com
Mon Aug 4 12:42:35 CEST 2014


 plugins/libkolab/lib/kolab_storage.php |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 2e78c949fbb278019226be2883dd39aa2962315f
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Mon Aug 4 06:40:32 2014 -0400

    Fix missing parent folder in folder selector if the folder does not exist or is not accessible (#3237)

diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index 3d1dccb..29479c4 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -563,8 +563,17 @@ class kolab_storage
             $name = $c_folder->name;
 
             // skip current folder and it's subfolders
-            if ($len && ($name == $current || strpos($name, $current.$delim) === 0)) {
-                continue;
+            if ($len) {
+                if ($name == $current) {
+                    // Make sure parent folder is listed (might be skipped e.g. if it's namespace root)
+                    if ($p_len && !isset($names[$parent])) {
+                        $names[$parent] = self::object_name($parent);
+                    }
+                    continue;
+                }
+                if (strpos($name, $current.$delim) === 0) {
+                    continue;
+                }
             }
 
             // always show the parent of current folder
@@ -578,11 +587,6 @@ class kolab_storage
                 }
             }
 
-            // Make sure parent folder is listed (might be skipped e.g. if it's namespace root)
-            if ($p_len && !isset($names[$parent]) && strpos($name, $parent.$delim) === 0) {
-                $names[$parent] = self::object_name($parent);
-            }
-
             $names[$name] = self::object_name($name);
         }
 




More information about the commits mailing list