From 3bbd9c25b48414e5d084ce3489021e0e43c7f9af Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 7 Oct 2009 13:20:16 +0000 Subject: [PATCH] Monotone-Parent: ef8d14f35a0201fb30074fc2e88eab645eadb392 Monotone-Revision: 6ac69e11d0bffd5ce9515e9bedac3e73c6e08938 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-07T13:20:16 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 +++++++ .../Appointments/SOGoAppointmentFolders.m | 23 +++++++++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43132c634..4c782177f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-10-07 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentFolders.m + (_fetchPersonalFolders:withChannel:): we now skip unexisting + folders declared in the list of web folder ids to avoid problems. + When such id is found, it is also reported in the logs to inform + the administrator of this inconsistency. + 2009-10-06 Wolfgang Sourdeau * SoObjects/Mailer/SOGoMailFolder.m (_appendMessageData:usingId): diff --git a/SoObjects/Appointments/SOGoAppointmentFolders.m b/SoObjects/Appointments/SOGoAppointmentFolders.m index 909f1408b..bde129c67 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolders.m +++ b/SoObjects/Appointments/SOGoAppointmentFolders.m @@ -29,6 +29,8 @@ #import #import #import +#import + #import #import @@ -309,20 +311,27 @@ isWebRequest = [[context request] handledByDefaultHandler]; error = [super _fetchPersonalFolders: sql withChannel: fc]; - webCalendarIds = [self webCalendarIds]; - max = [webCalendarIds count]; - if (!error && max) + if (!error) { + webCalendarIds = [self webCalendarIds]; + max = [webCalendarIds count]; for (count = 0; count < max; count++) { name = [webCalendarIds objectAtIndex: count]; if (isWebRequest) { old = [subFolders objectForKey: name]; - folder = [SOGoWebAppointmentFolder objectWithName: name - inContainer: self]; - [folder setOCSPath: [old ocsPath]]; - [subFolders setObject: folder forKey: name]; + if (old) + { + folder = [SOGoWebAppointmentFolder objectWithName: name + inContainer: self]; + [folder setOCSPath: [old ocsPath]]; + [subFolders setObject: folder forKey: name]; + } + else + [self errorWithFormat: @"webcalendar inconsistency: folder with" + @" name '%@' was not found in the database," + @" conversion skipped", name]; } else [subFolders removeObjectForKey: name];