[sync-collection report] Fix to work with bound collections.

The sync-collection report was looking for $request->CollectionID()
but this is not set for bound collections and we have to use
DAVResource methods to retrieve it.
This commit is contained in:
Andrew McMillan 2010-09-11 22:48:36 +12:00
parent 52695d86ec
commit 19de9d3b01

View File

@ -33,7 +33,9 @@ function display_status( $status_code ) {
return sprintf( 'HTTP/1.1 %03d %s', intval($status_code), getStatusMessage($status_code) );
}
$params = array( ':collection_id' => $request->CollectionId(), ':sync_token' => $sync_token );
$collection = new DAVResource( $request->path );
$params = array( ':collection_id' => $collection->GetProperty('collection_id'), ':sync_token' => $sync_token );
$sql = "SELECT new_sync_token( :sync_token, :collection_id)";
$qry = new AwlQuery($sql, $params);
if ( !$qry->Exec("REPORT",__LINE__,__FILE__) || $qry->rows() <= 0 ) {