From ce8f2e9481a823bc73efb3eaadf367e15dd10d77 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 14 Mar 2017 14:18:53 -0400 Subject: [PATCH] (fix) fixed task sorting on multiple categories --- NEWS | 1 + UI/Scheduler/NSArray+Scheduler.m | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index f22175b69..92e8671cb 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Bug fixes - [web] fixed handling of attachments in mail editor (#4058, #4063) - [web] fixed saving draft outside Mail module (#4071) - [web] fixed SCAYT automatic language selection in HTML editor + - [web] fixed task sorting on multiple categories 3.2.7 (2017-02-14) ------------------ diff --git a/UI/Scheduler/NSArray+Scheduler.m b/UI/Scheduler/NSArray+Scheduler.m index 0309e0226..ff4025671 100644 --- a/UI/Scheduler/NSArray+Scheduler.m +++ b/UI/Scheduler/NSArray+Scheduler.m @@ -266,7 +266,12 @@ NSComparisonResult result; selfCategory = [self objectAtIndex: taskCategoryIndex]; + if ([selfCategory isKindOfClass: [NSArray class]]) + selfCategory = [(id)selfCategory lastObject]; + otherCategory = [otherTask objectAtIndex: taskCategoryIndex]; + if ([otherCategory isKindOfClass: [NSArray class]]) + otherCategory = [(id)otherCategory lastObject]; if ([selfCategory isNotNull] && [otherCategory isNotNull]) result = [selfCategory caseInsensitiveCompare: otherCategory];