Skip to content

PM FindProjects, orderBy "project" column fails with invalid sql #37

@eigood

Description

@eigood

qapps/hm/Project/FindProject, shows all projects for me. Good. I then click "Project Up or Down" error. That gives a parameter orderByField=^workEffortId. The '^' gets converted to UPPER(workEffortId) in the generated sql. However, component/HiveMind/screen/HiveMindRoot/Project/FindProject.xml, the actions/WorkEffortParty has distinct=true, and that conflicts, as I get this postgresql error: Caused by: org.postgresql.util.PSQLException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

The generated SQL looks like this:

SELECT DISTINCT WEFF.WORK_EFFORT_ID, WEFF.WORK_EFFORT_NAME, WEFF.PRIORITY, WEFF.STATUS_ID, WEFF.ESTIMATED_COMPLETION_DATE, WEFF.ESTIMATED_WORK_TIME, WEFF.ACTUAL_WORK_TIME FROM (public.WORK_EFFORT WEFF LEFT OUTER JOIN public.WORK_EFFORT_PARTY WEP ON WEFF.WORK_EFFORT_ID = WEP.WORK_EFFORT_ID) WHERE (WEFF.WORK_EFFORT_TYPE_ENUM_ID = $1 AND (WEFF.VISIBILITY_ENUM_ID IN ($2, $3) OR (((WEP.FROM_DATE IS NULL OR WEP.FROM_DATE <= $4) AND (WEP.THRU_DATE IS NULL OR WEP.THRU_DATE > $5)) AND WEP.PARTY_ID = $6))) ORDER BY WEFF.WORK_EFFORT_ID ASC NULLS LAST, UPPER(WEFF.WORK_EFFORT_ID) DESC NULLS LAST OFFSET 0 ROWS FETCH FIRST 20 ROWS ONLY

Note the doubled-up order by entries.

This is further conflicted by the show-order-by=case-insenstive in that same xml file.

I'm not sure where to go about fixing this, but it super easy to replicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions