diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index a599b7a2a..78435eadb 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -855,9 +855,6 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir iCalTimeZone *eventTimeZone; unsigned count, max, offset; - records = [NSMutableArray array]; - ranges = nil; - content = [theRecord objectForKey: @"c_cycleinfo"]; if (![content isNotNull]) { @@ -933,35 +930,35 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir } // Calculate the occurrences for the given range + records = [NSMutableArray array]; ranges = [iCalRecurrenceCalculator recurrenceRangesWithinCalendarDateRange: recurrenceRange firstInstanceCalendarDateRange: firstRange recurrenceRules: rules exceptionRules: exRules exceptionDates: exDates]; + max = [ranges count]; + for (count = 0; count < max; count++) + { + oneRange = [ranges objectAtIndex: count]; + fixedRow = [self fixupCycleRecord: row + cycleRange: oneRange + firstInstanceCalendarDateRange: firstRange + withEventTimeZone: eventTimeZone]; + if (fixedRow) + [records addObject: fixedRow]; + } + + [self _appendCycleExceptionsFromRow: row + firstInstanceCalendarDateRange: firstRange + forRange: theRange + toArray: records]; + + [theRecords addObjectsFromArray: records]; } } } else [self errorWithFormat:@"cyclic record doesn't have content -> %@", theRecord]; - - max = [ranges count]; - for (count = 0; count < max; count++) - { - oneRange = [ranges objectAtIndex: count]; - fixedRow = [self fixupCycleRecord: row - cycleRange: oneRange - firstInstanceCalendarDateRange: firstRange - withEventTimeZone: eventTimeZone]; - if (fixedRow) - [records addObject: fixedRow]; - } - - [self _appendCycleExceptionsFromRow: row - firstInstanceCalendarDateRange: firstRange - forRange: theRange - toArray: records]; - - [theRecords addObjectsFromArray: records]; } - (NSArray *) _flattenCycleRecords: (NSArray *) _records diff --git a/SoObjects/Appointments/SOGoAppointmentFolders.m b/SoObjects/Appointments/SOGoAppointmentFolders.m index e1077c27d..798fe85bf 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolders.m +++ b/SoObjects/Appointments/SOGoAppointmentFolders.m @@ -139,8 +139,10 @@ static SoSecurityManager *sm = nil; SOGoWebAppointmentFolder *webCalendar; NSString *name; - if (![self newFolderWithName: folderDisplayName + if ([self newFolderWithName: folderDisplayName nameInContainer: &name]) + webCalendar = nil; + else { aptFolder = [subFolders objectForKey: name]; [aptFolder setFolderPropertyValue: url diff --git a/SoObjects/Appointments/SOGoEMailAlarmsManager.m b/SoObjects/Appointments/SOGoEMailAlarmsManager.m index e410d23ac..cee4b1340 100644 --- a/SoObjects/Appointments/SOGoEMailAlarmsManager.m +++ b/SoObjects/Appointments/SOGoEMailAlarmsManager.m @@ -211,6 +211,8 @@ iCalEntityObject *entity, *testEntity; int count, max, testRecIdSecs; + entity = nil; + entities = [calendar events]; max = [entities count]; if (max == 0) @@ -221,7 +223,6 @@ if (max > 0) { - entity = nil; for (count = 0; !entity && count < max; count++) { testEntity = [entities objectAtIndex: count];