plugins/libkolab

Aleksander Machniak machniak at kolabsys.com
Mon Aug 4 12:41:50 CEST 2014


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

New commits:
commit 28b6872b566da870865f5f6cda087967acc98559
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 d2412af..7bae562 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -672,8 +672,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
@@ -687,11 +696,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