Hi BigAL, Im glad everything is working well for you now!.
As a FYI, you can delete an event by calling $event->delete() directly. This is essentially what the deleteEventByUrl helper method in the Calendar.php demo script does, after first retrieving the event from the server. As long as you have an up-to-date copy of the event, calling delete() directly on the event will eliminate the additional trip to the server to retrieve the event before deleting it. Note: I believe that the additional step of retrieving the event at the URL provided is what's allowing you to use the id directly, instead of using the edit URL. The PHP code is actually retrieving the event using the ID, and then using the edit URL in the retrieved event to actually perform the delete. This eliminates the optimistic concurrency protection but gets closer to guaranteeing that the event will be deleted. If you're curious, you can see the following link for more information about optimistic concurrency: http://code.google.com/apis/gdata/reference.html#Optimistic-concurrency Cheers, -Ryan On 6/26/07, BigAL <[EMAIL PROTECTED]> wrote: > > > Greetings Trevor, > > Thanks for responding to my problem. > > I changed the code according to your fix on the deleteEntryByUrl, the > event in question were deleted but the same thing has occurred, Google > Calendar automatically created a (Test) event record on my ('Default') > user calendar with event Date exactly the Date and Time of the Delete > transaction, {(I noticed a display of a lock icon after the word > (Test) showing on the event calendar}. Weird !!! > > I do not know what to think anymore. {:( > > BigAL > > On Jun 25, 8:41 pm, Trevor Johns <[EMAIL PROTECTED]> wrote: > > On Jun 25, 1:04 pm, BigAL <[EMAIL PROTECTED]> wrote: > > > > > [...snip...] > > > The above code will delete the Events but will also create > > > automatically a (Test) event by Google Calendar at the 'Default' user, > > > regardless if events where there to delete or not there to delete > > > (Test) event is created with Start Date and Time of the Delete > > > transaction. Why? > > > > > Ryan, what do you think is happening is it a bug or what... > > > > > Thanks, > > > > HI BigAL, > > I tried to reproduce your problem on my end but I wasn't successful. > > However, I did notice an error in your code that might be causing > > problems. > > > > Specifically, this line: > > deleteEntryByUrl($client, $event->id->text); > > > > Should be changed to this: > > deleteEntryByUrl($client, $event->getLink('edit')->href); > > > > The difference here is that the edit link (which is what's returned by > > "getLink('edit')") also has a version number appended to the end. If > > you try to perform a delete operation without that version number you > > should get a HTTP 400/Bad Request error back from the server. I'm > > actually a little curious how the code you provided was able to delete > > events as is. :) > > > > In any case, try making that change and see if things don't improve. > > Afterwords, reply to this post and let me know how things went. If > > you're still experiencing the problem I'll take another look. > > > > -- > > Trevor Johnshttp://tjohns.net > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Calendar Data API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-calendar-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
