Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-14585

Orderable columns fail when viewing task lists in postgresql 8.4

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: No Longer Reproducible
    • Affects Version/s: 6.0.X EE, 6.1.0 CE RC1, 6.2.0 CE M2
    • Fix Version/s: 6.1.X EE, 6.2.0 CE B2
    • Labels:
    • Environment:
      Tomcat 6.0.33 + Postgresql 8.4. 6.0.x Revision: 95763.
      Tomcat 7.0 + Postgresql 8.4. 6.1.x Revision: 95763.
      Tomcat 7.0 + Postgresql 8.4. 6.2.x Revision: 95763.
    • Story Points:
      2
    • Fix Priority:
      4

      Description

      In "My Workflow Tasks", both in "assigned to me" and "assigned to my roles" lists, if click on orderable column "due date", lists become empty and exception is thrown:

      11:55:52,323 ERROR [JDBCExceptionReporter:234] ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
      Position: 458
      11:55:52,351 ERROR [ProxyMessageListener:79] com.liferay.portal.kernel.workflow.WorkflowException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.SQLGrammarException: could not execute query
      com.liferay.portal.kernel.workflow.WorkflowException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.SQLGrammarException: could not execute query
      at com.liferay.portal.workflow.kaleo.WorkflowTaskManagerImpl.search(WorkflowTaskManagerImpl.java:476)

      Debugging the generated query in the psql console, I found that "order by" column due date needs to be included in the select:

      Original (fails)
      lportal_two=# SELECT DISTINCT KaleoTaskInstanceToken.kaleoTaskInstanceTokenId FROM KaleoTaskInstanceToken INNER JOIN KaleoTaskAssignmentInstance ON (KaleoTaskAssignmentInstance.kaleoTaskInstanceTokenId = KaleoTaskInstanceToken.kaleoTaskInstanceTokenId) WHERE (KaleoTaskInstanceToken.companyId = 10136) AND (KaleoTaskInstanceToken.completed = false) AND ((KaleoTaskAssignmentInstance.assigneeClassName = 'com.liferay.portal.model.User') AND (KaleoTaskAssignmentInstance.assigneeClassPK = 10524)) ORDER BY KaleoTaskInstanceToken.dueDate DESC, KaleoTaskInstanceToken.kaleoTaskId DESC;

      Modified (works):
      lportal_two=# SELECT DISTINCT KaleoTaskInstanceToken.kaleoTaskInstanceTokenId, KaleoTaskInstanceToken.kaleoTaskId, KaleoTaskInstanceToken.dueDate FROM KaleoTaskInstanceToken INNER JOIN KaleoTaskAssignmentInstance ON (KaleoTaskAssignmentInstance.kaleoTaskInstanceTokenId = KaleoTaskInstanceToken.kaleoTaskInstanceTokenId) WHERE (KaleoTaskInstanceToken.companyId = 10136) AND (KaleoTaskInstanceToken.completed = false) AND ((KaleoTaskAssignmentInstance.assigneeClassName = 'com.liferay.portal.model.User') AND (KaleoTaskAssignmentInstance.assigneeClassPK = 10524)) ORDER BY KaleoTaskInstanceToken.dueDate DESC, KaleoTaskInstanceToken.kaleoTaskId DESC;
      kaleotaskinstancetokenid | kaleotaskid | duedate
      --------------------------------------------
      11457 | 11026 |
      11543 | 11026 |

        Attachments

          Activity

            People

            Assignee:
            luyang.tan Luyang Tan (Inactive)
            Reporter:
            daniel.sanz Daniel Sanz
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              8 years, 6 weeks, 6 days ago

                Packages

                Version Package
                6.1.X EE
                6.2.0 CE B2