Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Fix bug when orderBy value is empty in issue list and board list
Browse files Browse the repository at this point in the history
  • Loading branch information
김창근 committed Nov 7, 2014
1 parent 1e991f3 commit 4b56767
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/controllers/BoardApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import models.enumeration.Operation;
import models.enumeration.ResourceType;

import org.apache.commons.lang3.StringUtils;
import org.codehaus.jackson.node.ObjectNode;

import play.data.Form;
Expand Down Expand Up @@ -66,7 +67,7 @@ private ExpressionList<Posting> asExpressionList(Project project) {
el.or(icontains("title", filter), icontains("body", filter));
}

if (orderBy != null) {
if (StringUtils.isNotBlank(orderBy)) {
el.orderBy(orderBy + " " + orderDir);
}

Expand Down
4 changes: 2 additions & 2 deletions app/models/support/SearchCondition.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public ExpressionList<Issue> asExpressionList() {
el.eq("state", st);
}

if (orderBy != null) {
if (StringUtils.isNotBlank(orderBy)) {
if (orderBy.equals("dueDate")) {
String formulaName = orderDir.equals("asc") ? "dueDateAsc" : "dueDateDesc";
el.orderBy(formulaName + " " + orderDir);
Expand Down Expand Up @@ -310,7 +310,7 @@ public ExpressionList<Issue> asExpressionList(Project project) {
el.add(LabelSearchUtil.createLabelSearchExpression(el.query(), labelIds));
}

if (orderBy != null) {
if (StringUtils.isNotBlank(orderBy)) {
if (orderBy.equals("dueDate")) {
String formulaName = orderDir.equals("asc") ? "dueDateAsc" : "dueDateDesc";
el.orderBy(formulaName + " " + orderDir);
Expand Down

0 comments on commit 4b56767

Please sign in to comment.