Commit 8798cd58 authored by skummer's avatar skummer

ZP-95 related

- fixed: when updating a folder the type of the old object is used if it is not set

git-svn-id: https://z-push.org/svn/z-push/trunk@1303 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 9b1061c7
...@@ -111,6 +111,13 @@ class HierarchyCache { ...@@ -111,6 +111,13 @@ class HierarchyCache {
public function AddFolder($folder) { public function AddFolder($folder) {
ZLog::Write(LOGLEVEL_DEBUG, "HierarchyCache: AddFolder() serverid: {$folder->serverid} displayname: {$folder->displayname}"); ZLog::Write(LOGLEVEL_DEBUG, "HierarchyCache: AddFolder() serverid: {$folder->serverid} displayname: {$folder->displayname}");
// on update the $folder does most of the times not contain a type
// we copy the value in this case to the new $folder object
if (isset($this->cacheById[$folder->serverid]) && (!isset($folder->type) || $folder->type == false) && isset($this->cacheById[$folder->serverid]->type)) {
$folder->type = $this->cacheById[$folder->serverid]->type;
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HierarchyCache: AddFolder() is an update: used type '%s' from old object", $folder->type));
}
// add/update // add/update
$this->cacheById[$folder->serverid] = $folder; $this->cacheById[$folder->serverid] = $folder;
$this->changed = true; $this->changed = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment