Issue with "View regrets, cancels, previous rounds" in OJS 2.4.8

We’ve come across an issue with the code that generates the list of review reports from previous review rounds in OJS. I’ve looked at the 2.4.8 tree on Github and the issue is still present there.

The page is supposed to present the list of peer review details (reviewer name, request, underway, etc) recommendations, links to review forms, etc for all completed reviews from previous rounds. However, if the number of review rounds exceeds two (i.e. 3+) the page does not generate the correct info. As well, it shows details review details for reviewers who have declined to review, which I think is undesired behavior.

Fixing the issues requires minor modifications to the SubmissionEditHandler::submissionRegrets() function and the rounds.tpl template.

The current code in SubmissionEditHandler.php reads:

$reviewFormResponses = array();
	if (isset($reviewAssignments[$numRounds-1])) {
		foreach ($reviewAssignments[$numRounds-1] as $reviewAssignment) {
			$reviewFormResponses[$reviewAssignment->getId()] = $reviewFormResponseDao->reviewFormResponseExists($reviewAssignment->getId());
		}
	}

It assumes there has been only one previous review round and sets the $reviewFormResponses counter array to hold the number of responses for each review_id from that round. It should loop through all previous review rounds when setting this array. One can see this by looking in the rounds.tpl template file where this object is accessed. In that file the round variable loops through all previous rounds. I have corrected the code on our installation to read:

$reviewFormResponses = array();
            for ($round=1;$round<$numRounds;$round++) {
                if (isset($reviewAssignments[$round])) {
                        foreach ($reviewAssignments[$round] as $reviewAssignment) {
                                $reviewFormResponses[$reviewAssignment->getId()] = $reviewFormResponseDao->reviewFormResponseExists($reviewAssignment->getId());
		}
                }
            }

Now, for all previous reviews where there were reviewer responses, both the reviewer recommendation and reviewFormResponse icon appear correctly (both were suppressed due to the error).

Additionally, changing the condition {if !$reviewAssignment->getCancelled()} at ~line 84 of rounds.tpl to {if !$reviewAssignment->getCancelled() && !$reviewAssignment->getDeclined()} prevents the declined reviewers (who have already been listed in the table at the top of the page) from having their non-review details from being listed.

Roger

Hi @rkemp,

Thanks for the detail and proposed solution – I’ve filed this for attention before the next OJS 2.4.x release: Review "past rounds" presentation for editors with 3+ rounds · Issue #2360 · pkp/pkp-lib · GitHub

If this is useful for anyone using OJS 2.4.8, I’d be interested in confirmation about the proposed change.

Regards,
Alec Smecher
Public Knowledge Project Team