Issue with reassigning reviewers who have previously declined in OJS 2.4.x

We use OJS 2.4.3 for peer review management and I’ve come across a minor bug that appears to be present throughout the 2.4.x series. The SectionEditorSubmissionDAO::getReviewersForArticle method returns a list of all eligible reviewers for an article, including those who have previously declined a review request for the article. It returns a $reviewers object used by the sectionEditor/selectReviewer.tpl template which contains the code:

        {if $reviewer->declined}
            <a class="action" href="{url op="reassignReviewer" path=$articleId|to_array:$reviewer->getUserId()}">{translate key="editor.reassign"}</a>
        {else}
            {translate key="common.alreadyAssigned"}
        {/if}

The problem is that the “declined” field from the review_assignments table was not part of the SELECT statement in the DAO, so it’s always null and editors cannot therefore reassign a reviewer who has had a change of heart about the request. They’ll always show as alreadyAssigned to editors.

Fortunately the fix is trivial–adding one more argument to the SELECT solves the problem. Change the line which reads:
ar.review_id,
to:
ar.review_id, ar.declined,
at around line 823 of the class solves the problem. I’ve tested it on our system and it appears to give the desired behavior, showing the “Reassign” link as it should.

Anticipating a likely question, unfortunately, I’m not git-space yet–our OJS is heavily modded–so I cannot submit a pull request :slight_smile:
Roger

Hi @rkemp,

Thanks – I’ve filed this for investigation at:

Git does provide tools to cherry-pick small modifications over to other branches; that could be used to send a pull request in without disturbing your customizations. But that’s a fair amount of work to invest for the sake of a small change, so not to worry, I’m happy to work with the description you’ve given!

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,
Thanks. I came across this while looking into the SQL query in getReviewersForArticle. Our system has large user and review_assignments tables and this query is really slow. The query contains two JOINs that I think are unnecessary.

At lines 836 & 839 there are:
LEFT JOIN review_assignments ra ON (ra.reviewer_id = u.user_id)
LEFT JOIN articles a ON (ra.submission_id = a.article_id)

There are no references to any of the columns added by these joins in the SELECT or WHERE clauses or anywhere else in this method, so I believe they can be removed.
Roger