Don't try and produce a sync_token for the root collection.

This commit is contained in:
Andrew McMillan 2012-03-19 12:31:54 +13:00
parent 2c40db7d7e
commit f32ec4b704

View File

@ -1264,6 +1264,7 @@ EOQRY;
*/
function sync_token() {
if ( $this->IsPrincipal() ) return null;
if ( $this->collection_id() == 0 ) return null;
if ( !isset($this->sync_token) ) {
$sql = 'SELECT sync_token FROM sync_tokens WHERE collection_id = :collection_id ORDER BY sync_token DESC LIMIT 1';
$params = array( ':collection_id' => $this->collection_id());