Comment 112 for bug 307680

Revision history for this message
In , Matthew-mecca (matthew-mecca) wrote :

> I did notice some issues with the patch though. For me, changing the task
> filter doesn't change the displayed tasks at all. STR:
>
>
> * Apply patch, start Lightning, go to task view
> * Create a few tasks with the quick add feature
> * Switch through the filters
>
> Result:
>
> * All tasks are shown, regardless of what filter is chosen.

I'm not able to reproduce this - for me the old filters work the same way as without the patch applied until some tasks are set as repeating (which is how its supposed to work). Can you provide more details of which filter is selected and which tasks are still showing when they shouldn't? Do you show any errors?

> > onAddItem: function tTO_onAddItem(aItem) {
> ...
> >+ let occs;
> >+ if (this.binding.mFilter.endDate) {
> >+ occs = aItem.getOccurrencesBetween(this.binding.mFilter.startDate,
> >+ this.binding.mFilter.endDate,
> >+ {});
> Lets be more robust here and also check if the start date isn't null.

> >- if (savedThis.mFilter.startDate && savedThis.mFilter.endDate) {
> >+ if (savedThis.mFilter.endDate) {
> > filter |= aCalendar.ITEM_FILTER_CLASS_OCCURRENCES;
> > }
> Same comment as before, this time I have the feeling you did it for a reason
> :-) Why only check for end date here? Can't we be more robust and also check
> for the start date?

In both cases the startDate is now made optional for expanding occurrences by this:

> > if (itemReturnOccurrences && item.recurrenceInfo) {
> >+ let startDate = aRangeStart;
> >+ if (!aRangeStart && isToDo(item))
> >+ startDate = item.entryDate;

If the startDate is set it is used, and if it isn't the start date of the each parent task is used. The check remains for the endDate, if it is not provided then occurrences are not expanded. This allows for for filters like "show occurrences for all repeating tasks through 3/2/2010", and is the basis for allowing expansion of a finite occurrence set based on the date selected in the view or today pane. I added the isToDo() check to avoid inadvertently breaking any other code that relies on the old expansion requirements.