Skip to content

Commit

Permalink
SAK-42694 - Events were being posted with an empty assignmentId when …
Browse files Browse the repository at this point in the history
…the assignment was just created. Switch to the assignmentReference which will always have a value. (sakaiproject#7498)
  • Loading branch information
maurercw authored and Miguel Pellicer committed Oct 28, 2019
1 parent 926aeb2 commit 1d56b0e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7996,34 +7996,34 @@ private void post_save_assignment(RunData data, String postOrSave) {
// log event if there is a title update
if (!StringUtils.equals(aOldTitle, title)) {
// title changed
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_TITLE, assignmentId, true));
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_TITLE, assignmentReference, true));
}

if (!aOldAccess.equals(a.getTypeOfAccess())) {
// site-group access setting changed
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_ACCESS, assignmentId, true));
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_ACCESS, assignmentReference, true));
} else {
Collection aGroups = a.getGroups();
if (!(aOldGroups == null && aGroups == null)
&& !(aOldGroups != null && aGroups != null && aGroups.containsAll(aOldGroups) && aOldGroups.containsAll(aGroups))) {
//group changed
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_ACCESS, assignmentId, true));
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_ACCESS, assignmentReference, true));
}
}

if (oldOpenTime != null && !oldOpenTime.equals(a.getOpenDate())) {
// open time change
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_OPENDATE, assignmentId, true));
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_OPENDATE, assignmentReference, true));
}

if (oldDueTime != null && !oldDueTime.equals(a.getDueDate())) {
// due time change
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_DUEDATE, assignmentId, true));
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_DUEDATE, assignmentReference, true));
}

if (oldCloseTime != null && !oldCloseTime.equals(a.getCloseDate())) {
// due time change
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_CLOSEDATE, assignmentId, true));
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_CLOSEDATE, assignmentReference, true));
}
}
}
Expand Down

0 comments on commit 1d56b0e

Please sign in to comment.