Merge pull request #194 from zentyal/ejhernandez/skip-recurrence-id-without-dtstart
Ignore recurrence-id vevents without dtstart and outside date range
This commit is contained in:
commit
fb7e044bd3
|
@ -1008,7 +1008,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
{
|
{
|
||||||
if ([dateRange containsDate: [component startDate]])
|
if ([dateRange containsDate: [component startDate]])
|
||||||
{
|
{
|
||||||
// We must pass nill to :container here in order to avoid re-entrancy issues.
|
// We must pass nil to :container here in order to avoid re-entrancy issues.
|
||||||
newRecord = [self _fixupRecord: [component quickRecordFromContent: nil container: nil]];
|
newRecord = [self _fixupRecord: [component quickRecordFromContent: nil container: nil]];
|
||||||
[ma replaceObjectAtIndex: recordIndex withObject: newRecord];
|
[ma replaceObjectAtIndex: recordIndex withObject: newRecord];
|
||||||
}
|
}
|
||||||
|
@ -1025,8 +1025,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
{
|
{
|
||||||
// The recurrence id of the exception is outside the date range;
|
// The recurrence id of the exception is outside the date range;
|
||||||
// simply add the exception to the records array.
|
// simply add the exception to the records array.
|
||||||
// We must pass nill to :container here in order to avoid re-entrancy issues.
|
// We must pass nil to :container here in order to avoid re-entrancy issues.
|
||||||
newRecord = [self _fixupRecord: [component quickRecordFromContent: nil container: nil]];
|
newRecord = [self _fixupRecord: [component quickRecordFromContent: nil container: nil]];
|
||||||
|
if ([newRecord objectForKey: @"startDate"] && [newRecord objectForKey: @"endDate"]) {
|
||||||
newRecordRange = [NGCalendarDateRange
|
newRecordRange = [NGCalendarDateRange
|
||||||
calendarDateRangeWithStartDate: [newRecord objectForKey: @"startDate"]
|
calendarDateRangeWithStartDate: [newRecord objectForKey: @"startDate"]
|
||||||
endDate: [newRecord objectForKey: @"endDate"]];
|
endDate: [newRecord objectForKey: @"endDate"]];
|
||||||
|
@ -1034,6 +1035,10 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
[ma addObject: newRecord];
|
[ma addObject: newRecord];
|
||||||
else
|
else
|
||||||
newRecord = nil;
|
newRecord = nil;
|
||||||
|
} else {
|
||||||
|
[self warnWithFormat: @"Recurrence %@ without dtstart or dtend. Ignoring", recurrenceId];
|
||||||
|
newRecord = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newRecord)
|
if (newRecord)
|
||||||
|
|
Loading…
Reference in a new issue