summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-08-04 10:40:32 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-08-04 10:42:28 (GMT)
commit2e78c949fbb278019226be2883dd39aa2962315f (patch)
treef9247661addee8535f771f1d0287cd73fd06d629
parentc18ab7e302843fa2266dd684670d509b74d759ab (diff)
downloadroundcubemail-plugins-kolab-2e78c949fbb278019226be2883dd39aa2962315f.tar.gz
Fix missing parent folder in folder selector if the folder does not exist or is not accessible (#3237)
-rw-r--r--plugins/libkolab/lib/kolab_storage.php18
1 files changed, 11 insertions, 7 deletions
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);
}