In the Node view wizard, the default sort for Title is descending (should be ascending).
This is provided by \Drupal\node\Plugin\views\wizard\Node::getAvailableSorts():
return array(
'node_field_data-title:DESC' => $this->t('Title')
);
It should be ASC not DESC for the default sort direction for the node titles. Sorting in reverse alphabetical order makes no sense at all, so anyone who uses this in the wizard would need to change the direction, most likely.
Should be a one-line patch, unless there is some kind of a test out there that is depending on this strange behavior, so I have marked this as a Novice issue.
Comment | File | Size | Author |
---|---|---|---|
#3 | Node-node_views_wizard_has_wrong_sort_direction_for_title-2782323-3.patch | 957 bytes | vpshah86 |
Comments
Comment #2
vpshah86 CreditAttribution: vpshah86 at Clarion Technologies commentedComment #3
vpshah86 CreditAttribution: vpshah86 at Clarion Technologies commentedHi @jhodgdon
Adding the patch file for node sorting by ASC.
Please review it.
Thanks
Comment #4
jhodgdonThat does look like the right patch.
I also applied it, and tested manually by making a view using the Node wizard, using the sort labeled "Title" in the wizard. It came out with the titles sorted alphabetically (ascending), not descending as it previously did.
I am assuming since this behavior was apparently previously not tested, maybe it hasn't been deemed important to test... In an automated test, you don't select things from drop-down Select lists using their UI title anyway, but the internal string, so someone writing the test would have immediately known it was wrong (that is actually how I noticed it, since I was writing a test for the User Guide and the test had to put this "node_field_data-title:DESC" string in for the value when it submitted the wizard form)... anyway I will go ahead and mark this as RTBC and if the maintainers decide it needs a test, they can act accordingly.
Thanks!
Comment #6
jhodgdonSeems to have been an aborted test in there. Most recent result is Passed.
Comment #7
catchCommitted/pushed to 8.3.x and cherry-picked to 8.2.x. Thanks! Agreed this doesn't need a test.