(here, today)
calling maniphest.search with order: [“project”, “id”] results in this error:
#1054: Unknown column 'projectGroupName.indexedObjectName' in 'order clause'
Description
Event Timeline
This isn't meaningful, but we can raise a more specific error.
Specifically, ordering by "project" is not meaningful if you aren't also grouping by project. A task may belong to both "Aardvark Adventure" and "Zebra Zither Concerto". I'm not sure what the user is trying to do, but it probably isn't valid and/or this probably isn't the best way to accomplish it.
The fix I'd propose is:
- When we begin executing the query:
- If project is in the order vector and groupBy is any value other than GROUP_PROJECT:
- Throw an exception trying to explain that this order is not sensible in the general case and explaining the underlying constraint ("You can not order by project unless you are also grouping by project.")
- If project is in the order vector and groupBy is any value other than GROUP_PROJECT:
Alternatively, since project is automatically applied to the vector if it is relevant (that is, GROUP_PROJECT implies that the vector becomes project, ..., regardless of other settings) we could add some kind of key to getOrderableColumns() like 'internal' => true, a flag which causes the ordering column to be hidden from Conduit help and rejected in Conduit calls. This is perhaps cleaner, but perhaps also a little more work.