MODX Community

Fred Element Sorting Not Working?

Before I submit a bug, maybe someone can advise if I am missing something obvious. I went into the system settings for Fred and set all the items for sorting by “Name”. But when I go back to Fred, each time it defaults to sorting by…I have no idea. I guess it sorts by “Rank”? The Name column is never sorted alphabetically. At first I thought it was but in descending order (because I saw my Who Are We element at the top, but then all of a sudden an element named Button that I created before and was further down, now shows at the top.

I have to click on the Name column heading every time to get the sort to work when I go to the element editor.

Any advice? Or a bug? I would have thought that if this was a bug that someone smarter than I am would have seen it and put in for investigation!

MODX Revolution: 2.7.2-pl
Fred: fred-1.1.1-pl


I might be wrong here, but I could imagine the system settings are expecting either ASC, DESC or RAND() as an input. The general syntax is one of those two:

Option 1:   $query->sortby('DESC()');

Option 2:   $query->sortby('Name','ASC');

So the question is, whether or not you can define the column to sort by. I’m assuming if you put in ASC or DESC it works fine (probably sorting by ID then)?

Again this is just my understanding of things, I haven’t used FRED, so please don’t quote me, but I hope this might be helpful at least a little bit…