Skip to content

Commit

Permalink
bugfix: advanced DatasetFieldType displayOrder comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ffritze committed Aug 7, 2024
1 parent f093280 commit a57719f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetFieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ public void setDatasetFieldDefaultValues(List<DatasetFieldDefaultValue> datasetF

@Override
public int compareTo(DatasetFieldType o) {
return Integer.compare(this.getDisplayOrder(), (o.getDisplayOrder()));
int result = Integer.compare(this.getDisplayOrder(), (o.getDisplayOrder()));
if(!this.isHasParent() && o.isChild() && result == 0) {
result = -1;
}
return result;
}

public String getDisplayName() {
Expand Down

0 comments on commit a57719f

Please sign in to comment.