Skip to content

Commit

Permalink
#10090 fix conflicts and rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
Hafsa-Naeem committed Oct 2, 2024
1 parent 3fa4c3c commit b09c81b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 11 additions & 0 deletions classes/stageAssignment/StageAssignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,15 @@ public function scopeWithContextId(Builder $query, ?int $contextId): Builder
->where('submissions.context_id', $contextId);
});
}


/**
* Accessor for the userId attribute.
*
* @return int The user_id as an integer.
*/
public function getUserIdAttribute(): int
{
return (int) $this->attributes['user_id'];
}
}
11 changes: 4 additions & 7 deletions controllers/grid/queries/form/QueryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,11 @@ public function fetch($request, $template = null, $display = false, $actionArgs
// if current user is an anonymous reviewer, filter out authors
foreach ($reviewAssignments as $reviewAssignment) {
if ($reviewAssignment->getReviewerId() == $user->getId()) {
if ($reviewAssignment->getReviewMethod() != ReviewAssignment::SUBMISSION_REVIEW_METHOD_OPEN) {
// Replaces StageAssignmentDAO::getBySubmissionAndRoleId
$excludeUsers = StageAssignment::withSubmissionIds([$query->assocId])
if ($reviewAssignment->getReviewMethod() == ReviewAssignment::SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS) {
$stageAssignments = StageAssignment::withSubmissionIds([$query->assocId])
->withRoleIds([Role::ROLE_ID_AUTHOR])
->withUserId($user->getId())
->get()
->pluck('userId')
->all();
->get();
$excludeUsers = $stageAssignments->pluck('userId')->all();
}
}
}
Expand Down

0 comments on commit b09c81b

Please sign in to comment.