I using the following code for changing Google Calendars Event’s location:
EventEntry eventEntry = this.GetGoogleEvent(evt, cal);
eventEntry.Title.Text = evt.Summary;
eventEntry.Locations.Clear();
if( NEWLOCATION != "" ) eventEntry.Locations.Add(new Where("", "", NEWLOCATION));
...
EventEntry newEvent = (EventEntry)eventEntry.Update();
It works fine, for changing the location, but nothing is updated when NEWLOCATION is an empty string: ""
Any workaround? It’s an API bug ?
Thanks for advices!
EDIT:
Also tried without if( NEWLOCATION != "" )
If you call Locations.Clear() and then Update(), you will be sending a PUT request without any gd:where elements. Update requests only update those fields that are specified in the request, so the gd:where elements of the event will be untouched.
If you want to clear the gd:where field of an event, you have to send an update request containing a single gd:where element whose value is an empty string. For instance, you may use the following code:
There was a bug in the library that was causing empty gd:where valueString elements to be ignored during update requests. This bug was fixed a few minutes ago in rev. 1113 of the library:
http://code.google.com/p/google-gdata/source/detail?r=1113