Skip to content

Commit eda4ee4

Browse files
marktriggsMiguel Pellicer
authored and
Miguel Pellicer
committed
SAK-39957 If an imported comment cell is blank, clear any existing comment
1 parent 09143e2 commit eda4ee4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gradebookng/tool/src/java/org/sakaiproject/gradebookng/business/util/ImportGradesHelper.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,10 @@ private static Status determineStatus(final ImportedColumn column, final Assignm
674674

675675
// has a value, could be NEW or an UPDATE. Preserve NEW if we already had it
676676
if (status != Status.NEW) {
677-
if (StringUtils.isNotBlank(importedComment) && !StringUtils.equals(importedComment, existingComment)) {
677+
boolean importContainsNewComment = (StringUtils.isNotBlank(importedComment) && !StringUtils.equals(importedComment, existingComment));
678+
boolean importClearsExistingComment = (StringUtils.isBlank(importedComment) && StringUtils.isNotBlank(existingComment));
679+
680+
if (importContainsNewComment || importClearsExistingComment) {
678681
status = Status.UPDATE;
679682
break;
680683
}

0 commit comments

Comments
 (0)