Logic in the cancelReview function OJS 2.4.3

I’m working with the code for SEs to cancel reviews and am puzzled by a piece of code in the SectionEditorAction::cancelReview function. There is a test to check if it is valid for the SE to cancel the review based on whether the reviewer was 1) notified, 2) not previously cancelled 3) still underway (and 4 did not decline the review???). The code at line 315 reads:

if ($reviewAssignment->getSubmissionId() == $sectionEditorSubmission->getId()) {
// Only cancel the review if it is currently not cancelled but has previously
// been initiated, and has not been completed.
 if ($reviewAssignment->getDateNotified() != null && !$reviewAssignment->getCancelled() && ($reviewAssignment->getDateCompleted() == null || $reviewAssignment->getDeclined())) {

I think that last term in bold is incorrect and unnecessary. If the reviewer declines the review request, the review assignment disappears from the peerReview.tpl summary page and the SE can’t click “cancel”. And even if it didn’t disappear from the page, it would only make sense to cancel assignments that had not been previously declined. Am I misunderstanding the purpose of this code?

Roger

Hi @rkemp,

This is a really old code, dated from 2005, see here the commit that introduced this change: #1785# Corrected reviewer regrets problems (submissions became "stuck"). · pkp/ojs@337a2d8 · GitHub

See this bug entry to understand the need for this check: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=1785

Regards,
Bruno

Hi Bruno,
Thanks for the quick response and the Bugzilla pointer. From that discussion I see the check was needed back when SEs had the ability to re-request a previously declined reviewer (perhaps due to a change of mind or fruitless search for alternates). That discussion thread also answers the question I posed in the other thread about the meaning of date_completed in the review_assignments table (i.e. date of submitted review xor date of completed interaction)–it’s the date of the completed interaction.

Roger