diff options
author | Sean McGivern <sean@gitlab.com> | 2016-08-18 23:16:06 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-08-18 23:26:07 +0100 |
commit | d3acded4bcb176472be5fdfe03a4bff55f39bdac (patch) | |
tree | 5a6d64e7684a143ef4082ea20e567ede0c60cb31 /app/controllers/concerns/issuable_collections.rb | |
parent | 717366d28da11acc6dbe60301bf7e2394400b3c1 (diff) | |
download | gitlab-ce-d3acded4bcb176472be5fdfe03a4bff55f39bdac.tar.gz |
Handle legacy sort order values21028-missing-default-sort-for-users-with-an-existing-cookie
The sort orders used to be id_asc / id_desc, and are now created_asc /
created_desc. Users can still have cookies containing the old sort
orders, or bookmarks to links specifying them, so convert these to the
new versions quietly.
Diffstat (limited to 'app/controllers/concerns/issuable_collections.rb')
-rw-r--r-- | app/controllers/concerns/issuable_collections.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/concerns/issuable_collections.rb b/app/controllers/concerns/issuable_collections.rb index c802922e0af..b5e79099e39 100644 --- a/app/controllers/concerns/issuable_collections.rb +++ b/app/controllers/concerns/issuable_collections.rb @@ -66,6 +66,11 @@ module IssuableCollections key = 'issuable_sort' cookies[key] = params[:sort] if params[:sort].present? + + # id_desc and id_asc are old values for these two. + cookies[key] = sort_value_recently_created if cookies[key] == 'id_desc' + cookies[key] = sort_value_oldest_created if cookies[key] == 'id_asc' + params[:sort] = cookies[key] end |