Bug fix -- subcategories in forums topic list should now be sorted alphabetically - #720
Conversation
|
Nice fix @caesar2164 and @akjags -- much better to fix the code than add in a bunch of remedial junk. |
|
Well, that was simple. +1 |
|
The code looks good, my concern remains about the unintentional reordering of topics in production. sort_key is an ordinal, what this code does is says "if there is no value, replace this value with the title." But prior to this replacement, the order is the order that they were pulled from the DB, probably created_at. So, let's suppose the titles are C,A,B, and the course author placed them in this order, but never added a sort key. Deploying this to production will make the course topics appear as A,B,C. So while this fixes one bad thing, it also introduces a potential new bad thing, namely, the surprise reordering of topics in production. Would you mind coming up with a rake task to go along with this deployment that checks to see if there are no sort_keys set on all of the topics, and then walk through them and assign 1,2,3,... in the order they appear? This way, when we deploy this, it won't surprise the course authors and students. |
|
Confirmed that this code works on edx-west staging server to fix sorting issue we have |
|
Oops that was an accident. But good news, Giulio @caesar2164 !! |
|
Ok, @kevinchugh & @chrisndodge, added course level advanced setting/feature flag which defaults to false to sort course categories & subcategories by alpha. I also wrote a pair of tests to show that if the flag is set to false it does not sort, and if it's set to true it does sort and also uses the titles as sort_keys. I think this should be ready to go now, let me know if I need to do anything else before merging. |
There was a problem hiding this comment.
Hm, what happens if course.discussion_sort_alpha is unset?
There was a problem hiding this comment.
it isn't because it defaults to false in course advanced settings
|
@jzoldak - could you take a look at my unit tests? |
|
thanks for the extra settings and unit test, please ensure courses are defaulted to old sort upon deployment :-) 👍 |
|
👍 on the tests! |
Bug fix -- subcategories in forums topic list should now be sorted alphabetically
Use display names for module edit links in the cms
…agnosis Fix security diagnosis openedx#720
ziafazal/YONK-338: added pagination support and user grades
…-no-submission Handle case where ora2 score override had no previous score
Bumping version of rocket chat xblock to 0.2.3
* fix: [AA-1044] add missing h2 for screenreaders - Add placeholder h2 tag with message indicating reserve for future use - internationalize placeholder text
@kevinchugh @caesar2164
We figured out that the reason subcategories weren't getting sorted was that they had a sort_key of None, whereas the entries had a sort_key of their title, so with this simple fix, the already existing sorting mechanism should take care of the subcategory sorting as well.