diff options
author | Robert Speicher <robert@gitlab.com> | 2016-08-18 23:01:03 +0000 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2016-08-18 18:51:11 -0500 |
commit | 25fb93cebbbfadc1714abfb470fe0a3cf4b44bfc (patch) | |
tree | 0996a3691f73af8413297aabd33340612021fcff /app/controllers | |
parent | 2e66559e382ded6608e40ed522a6d82a9e851956 (diff) | |
download | gitlab-ce-25fb93cebbbfadc1714abfb470fe0a3cf4b44bfc.tar.gz |
Merge branch '21028-missing-default-sort-for-users-with-an-existing-cookie' into 'master'
Handle legacy sort order values
Convert the legacy sort order values id_asc / id_desc into the ones we use now, created_at / created_desc, to stop the dropdown being blank.
Closes #21028.
See merge request !5880
Diffstat (limited to 'app/controllers')
-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 |