From f305cdf4cb3d647d0d3c26441e86473c14b4ea64 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 1 Jan 2011 21:55:55 +1300 Subject: [PATCH] A few more places we need to ensure the collection is uncached. Signed-off-by: Andrew McMillan --- inc/caldav-PUT-default.php | 4 ++++ inc/caldav-PUT-vcard.php | 4 ++++ inc/ui/collection-edit.php | 3 +++ testing/tests/carddav/2010-PROPFIND.result | 4 ++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/inc/caldav-PUT-default.php b/inc/caldav-PUT-default.php index 4de93170..612f6a4c 100644 --- a/inc/caldav-PUT-default.php +++ b/inc/caldav-PUT-default.php @@ -91,6 +91,10 @@ $qry->QDo("SELECT write_sync_change( $collection_id, $response_code, :dav_name)" $qry = new AwlQuery('COMMIT'); if ( !$qry->Exec('move') ) rollback(500); +// Uncache anything to do with the collection +$cache = getCacheInstance(); +$cache->delete( 'collection-'.$container->dav_name(), null ); + header('ETag: "'. $etag . '"' ); if ( $response_code == 200 ) $response_code = 204; $request->DoResponse( $response_code ); diff --git a/inc/caldav-PUT-vcard.php b/inc/caldav-PUT-vcard.php index 5ce77113..896c10a2 100644 --- a/inc/caldav-PUT-vcard.php +++ b/inc/caldav-PUT-vcard.php @@ -96,6 +96,10 @@ if ( !$qry->Commit() ) { $request->DoResponse( 500, "A database error occurred" ); } +// Uncache anything to do with the collection +$cache = getCacheInstance(); +$cache->delete( 'collection-'.$container->dav_name(), null ); + header('ETag: "'. $etag . '"' ); if ( $response_code == 200 ) $response_code = 204; $request->DoResponse( $response_code ); diff --git a/inc/ui/collection-edit.php b/inc/ui/collection-edit.php index 369e9b59..6c66db4a 100644 --- a/inc/ui/collection-edit.php +++ b/inc/ui/collection-edit.php @@ -117,6 +117,9 @@ if ( $can_write_collection && $editor->IsSubmit() ) { $c->messages[] = i18n('The file is not UTF-8 encoded, please check the error for more details.'); } } + // Uncache anything to do with the collection + $cache = getCacheInstance(); + $cache->delete( 'collection-'.$editor->Value('dav_name'), null ); } else { if ( $id > 0 ) $editor->GetRecord(); diff --git a/testing/tests/carddav/2010-PROPFIND.result b/testing/tests/carddav/2010-PROPFIND.result index 57f5b51a..4b43e46c 100644 --- a/testing/tests/carddav/2010-PROPFIND.result +++ b/testing/tests/carddav/2010-PROPFIND.result @@ -2,7 +2,7 @@ HTTP/1.1 207 Multi-Status Date: Dow, 01 Jan 2000 00:00:00 GMT DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule DAV: extended-mkcol, calendar-proxy, bind, addressbook -ETag: "0f450e6f8b3be4245401f6cc1982fd0b" +ETag: "e722f053aaa9eef890641a0ba88837e5" Content-Length: 339 Content-Type: text/xml; charset="utf-8" @@ -12,7 +12,7 @@ Content-Type: text/xml; charset="utf-8" /caldav.php/user1/addressbook/ - "ed3adbac9a1901c4d9775d7b553d1aef" + "80a8bc51f0e0b0fdd2037f1e12f5ad47" HTTP/1.1 200 OK