[SAK-34072] Problem filtering submissions by group Created: 06-Apr-2018  Updated: 09-Apr-2018  Resolved: 07-Apr-2018

Status: Verified
Project: Sakai
Component/s: Assignments
Affects Version/s: 12.0
Fix Version/s: 12.1, 19.0 [Tentative]

Type: Bug Priority: Blocker
Reporter: Juan José Meroño Sánchez Assignee: Earle R Nietzel
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relate
is related to SAK-33552 Assignments doesn't work correctly fo... Verified
12 status: Resolved
Test Plan:

Please add a Test Plan here.


 Description   

I've found a problem in assigments checking groups allowed to grade.

https://github.com/sakaiproject/sakai/blob/master/assignment/impl/src/java/org/sakaiproject/assignment/impl/AssignmentServiceImpl.java#L581-L583

I don't know how to reproduce this in nightly servers, but the problem is because of the filter:

Set<String> assignmentGroups = assignment.getGroups();

This line is getting groups of assignment in format:

/site/35a67170-432f-46a4-8d4b-6fa5d19ade16/group/790a21a1-10a5-4c95-b28d-8ebcc0fc284d

But then this line:

groupsAllowed.stream().filter(g -> assignmentGroups.contains(g.getId())).collect(Collectors.toSet());

Is using g.getId() that is only: 790a21a1-10a5-4c95-b28d-8ebcc0fc284d
to filter, so the collection is always empty.
I guess g.getId() should be g.getReference()


Generated at Mon Dec 10 12:19:53 CST 2018 using JIRA 7.5.0#75005-sha1:fd8c849d4e278dd8bbaccc61e707a716ad697024.