After some more debugging, I see the following:
- add "echo $sql;" to line 106 of manager/frame/nodes.php and I see the following SQL query:
SELECT DISTINCT sc.id, pagetitle, parent, isfolder, published, deleted, type, menuindex, hidemenu, alias, contentType, privateweb, privatemgr, IF(1=0 OR sc.privatemgr=0, 1, 0) AS has_access FROM `aseu_live`.`modx_site_content` AS sc LEFT JOIN `aseu_live`.`modx_document_groups` dg on dg.document = sc.id WHERE (parent=0) GROUP BY sc.id ORDER BY pagetitle ASC
so the correct SQL query is being passed by MODx.
It turns out this is a MySQL bug in 5.0.51, fixed in 5.0.52.
ORDER BY not working with GROUP BY.
The fix until 5.0.52 is available is as noted in the above bug report (this is not ideal, and only temporary):
Rewrite the SQL query (lines ~99-105) to:
$sql = "SELECT * FROM
(
SELECT DISTINCT sc.id, pagetitle, parent, isfolder, published, deleted, type, menuindex, hidemenu, alias, contentType, privateweb, privatemgr,
IF(1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? "":" OR dg.document_group IN ({$docgrp})") . ", 1, 0) AS has_access
FROM {$tblsc} AS sc
LEFT JOIN {$tbldg} dg on dg.document = sc.id
$access
WHERE (parent={$parent})
GROUP BY sc.id
) subquery
ORDER BY {$orderby};";
This works for me.