diff options
author | Brian Conry <bconry@bestpractical.com> | 2022-08-10 16:42:05 +0300 |
---|---|---|
committer | Brian Conry <bconry@bestpractical.com> | 2022-08-10 17:45:45 +0300 |
commit | 1c7176a8f41f6a908071d42ca9990fcb7a755e2c (patch) | |
tree | d082bb3c3abe018b6e694ab1fe94108d65f322ab | |
parent | 0424423db5da4919eb7fda29aa6e564b086a7b38 (diff) |
Sort SavedSearches5.0/sort-saved-searches
SavedSearches were previously returned in an unpredictable order
paralleling the order that the database returned the underlying
Attributes, probably based more on the order in which they were created
than on anything else.
This change automatically sorts the SavedSearches by Name (stored in the
Attribute's Description) after they are fetched in LimitToPrivacy.
-rw-r--r-- | lib/RT/SavedSearches.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/RT/SavedSearches.pm b/lib/RT/SavedSearches.pm index f3401da74c..21725ca598 100644 --- a/lib/RT/SavedSearches.pm +++ b/lib/RT/SavedSearches.pm @@ -104,6 +104,7 @@ sub LimitToPrivacy { next if $type && $search->Type && $search->Type ne $type; push(@{$self->{'objects'}}, $search); } + @{$self->{'objects'}} = sort { lcfirst($a->Name) cmp lcfirst($b->Name) } @{$self->{'objects'}}; } else { $RT::Logger->error("Could not load object $privacy"); } |