Commit 0f10824f authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-871 Delete the pingable flag only if it is set, SyncCollections

iterator: exclude 'false' as valid collection key (hierarchy state),
explicitely implement SyncParameters->GetBackendFolderId() as it will
return false in case of an upgraded profile.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 89bc1043
...@@ -86,8 +86,7 @@ class SyncCollections implements Iterator { ...@@ -86,8 +86,7 @@ class SyncCollections implements Iterator {
$sc = new SyncCollections(); $sc = new SyncCollections();
$sc->LoadAllCollections(); $sc->LoadAllCollections();
foreach ($sc as $folderid => $spa) { foreach ($sc as $folderid => $spa) {
$spa->DelPingableFlag(); $sc->invalidateFolderStat($spa);
$sc->SaveCollection($spa);
} }
return true; return true;
} }
...@@ -853,7 +852,7 @@ class SyncCollections implements Iterator { ...@@ -853,7 +852,7 @@ class SyncCollections implements Iterator {
* @return boolean * @return boolean
*/ */
public function valid() { public function valid() {
return (key($this->collections) !== null); return (key($this->collections) !== null && key($this->collections) !== false);
} }
/** /**
......
...@@ -220,6 +220,20 @@ class SyncParameters extends StateObject { ...@@ -220,6 +220,20 @@ class SyncParameters extends StateObject {
return true; return true;
} }
/**
* Overwrite GetBackendFolderId() because on old profiles, this will not be set.
*
* @access public
* @return string
*/
public function GetBackendFolderId() {
if ($this->backendfolderid) {
return $this->backendfolderid;
}
else {
return $this->GetFolderId();
}
}
/** /**
* CPO methods * CPO methods
......
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