-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkp/pkp-lib#4789 Permit declined reviews to be reinitiated #8242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @touhidurabir. I've left a few comments throughout. I've left the text review for after we resolve this question that I just added to the issue:
We'll need to get clarity about that before we finalize this. But from a technical perspective it's looking great.
One other thing that i noticed is that when a review has been reconsidered, in the status it says "Review due: [date]" but it should say "Response due: [date]":
However, I'd suggest you not work on resolving this until we get an answer to the question in the issue. How we "fix" this will depend on how we present this feature to the editors.
$reconsiderReviewerForm = new ReconsiderRequestReviewerForm($reviewAssignment, $reviewRound, $submission); | ||
$reconsiderReviewerForm->readInputData(); | ||
|
||
// Reinstate the reviewer and return status message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment looks maybe out of place...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
if ($reconsiderReviewerForm->execute() && !$request->getUserVar('skipEmail')) { | ||
$reviewer = Repo::user()->get($reviewAssignment->getReviewerId()); | ||
$user = $request->getUser(); | ||
$context = PKPServices::get('context')->get($submission->getData('contextId')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this happens within a grid handler that can only be accessed through a HTTP request, you can pull the context from the request: $context = $request->getContext();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
* @class ReviewerReconsiderRequest | ||
* @ingroup mail_mailables | ||
* | ||
* @brief Email sent to a declined reviewer to reconsider reviewing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Email sent to a review who has declined their review assignment to ask them
to reconsider accepting the review assignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
* @file classes/mail/mailables/ReviewerReconsiderRequest.php | ||
* | ||
* Copyright (c) 2014-2021 Simon Fraser University | ||
* Copyright (c) 2000-2021 John Willinsky |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Date should be -2022. Annoying. I miss this all the time. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
|
||
if ( $this->getReconsiderRequested() ) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some extra spaces around the (
, )
and !
in this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
@@ -434,7 +436,8 @@ public function updateObject($reviewAssignment) | |||
reminder_was_automatic = ?, | |||
review_form_id = ?, | |||
review_round_id = ?, | |||
unconsidered = ? | |||
unconsidered = ?, | |||
reconsider_requested = ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some old tabs in here for some reason, so there's some whitespace discrepancies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
* @param ReviewRound $reviewRound | ||
* @param Submission $submission | ||
*/ | ||
public function __construct($reviewAssignment, $reviewRound, $submission) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead and put the @param
types into the function signature. It's hard to do with the older code in some places, but constructors are ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
$reviewAssignment = $this->getReviewAssignment(); /** @var ReviewAssignment $reviewAssignment */ | ||
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); /** @var ReviewAssignmentDAO $reviewAssignmentDao */ | ||
|
||
if (isset($reviewAssignment) && $reviewAssignment->getSubmissionId() == $submission->getId() && !Hook::call('EditorAction::reconsiderReviewer', [&$submission, $reviewAssignment])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Hook
here can be removed. This is part of an older pattern that we keep around for existing third-party code. But we don't need to add a new hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
$reviewAssignmentDao->updateObject($reviewAssignment); | ||
|
||
// Stamp the modification date | ||
$submission->stampModified(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to use stampLastActivity()
here instead of stampModified()
. I think we only use stampModified()
for changes to the submission itself, but stampLastActivity()
is for whenever activity takes place related to the submission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
locale/en_US/common.po
Outdated
@@ -1727,6 +1727,9 @@ msgstr "Reviewer cancelled." | |||
msgid "notification.reinstatedReviewer" | |||
msgstr "Reviewer reinstated." | |||
|
|||
msgid "notification.requestReconsiderReviewer" | |||
msgstr "Reviewer requested to reconsider." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request to reconsider the review assignment was sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
27ac1ee
to
201813b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I found a couple of small things but it seems just about ready to go. 👍
locale/en_US/editor.po
Outdated
@@ -278,6 +281,9 @@ msgstr "Review Submitted" | |||
msgid "editor.review.reviewerThanked" | |||
msgstr "Reviewer Thanked" | |||
|
|||
msgid "editor.review.ReviewerResendRequest" | |||
msgstr "Reviewer Requested to Reconsider" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request Resent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
"upload review files, and submit your review request.</p>" | ||
"<p>If you have any questions, please contact me.</p>" | ||
"<p>Kind regards,</p>" | ||
"{$signature}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"<p>Dear {$recipientName},</p>"
"<p>Recently, you declined our request to review a submission, {$submission Title}, for {$contextName}. I'm writing to see if you are able to conduct the review after all.</p>"
"<p>We would be grateful if you're able to perform this review, but we understand if that is not possible at this time. Either way, please <a href=\"{$reviewAssignmentUrl}\">accept or decline the request</a> by {$responseDueDate}, so that we can find an alternate reviewer."
"<p>If you have any questions, please contact me.</p>"
"<p>Kind regards,</p>"
"{$signature}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
locale/en_US/emails.po
Outdated
@@ -312,3 +312,17 @@ msgstr "" | |||
"<p>If you have any questions, please contact me from your <a href=\"{$authorSubmissionUrl}\">submission dashboard</a>.</p>" | |||
"<p>Kind regards,</p>" | |||
"<p>{$signature}</p>" | |||
|
|||
msgid "emails.reviewResendRequest.subject" | |||
msgstr "Can you reconsider to review for {$contextName}?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting your review again for {$contextName}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
protected static array $fromRoleIds = [Role::ROLE_ID_MANAGER]; | ||
protected static array $toRoleIds = [Role::ROLE_ID_REVIEWER]; | ||
|
||
public function __construct(Context $context, PKPSubmission $submission, ReviewAssignment $reviewAssignment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were rendered correctly in the email that was sent, so I think it's only in the email preview that the variables are missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is because of this code:
Vitaliy is in the process of removing the last bits of the SubmissionMailTemplate
and this will probably get fixed when that is done. Can you file an issue to solve this later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locale/en_US/submission.po
Outdated
@@ -1854,6 +1857,9 @@ msgstr "This review has been completed." | |||
msgid "submission.review.status.thanked" | |||
msgstr "This review is complete and the reviewer has been thanked for their contribution." | |||
|
|||
msgid "submission.review.status.reconsiderRequested" | |||
msgstr "Waiting for a response from the reviewer to reconsider previously declined review request." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only shows up to a review on a submission they are assigned to. So I think we can reuse submission.review.status.awaitingResponse
:
Waiting for a response from the reviewer.
From their perspective, it doesn't matter if it's a new request or a second request. Just that they need to respond.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -54,6 +54,7 @@ class ReviewAssignment extends \PKP\core\DataObject | |||
public const REVIEW_ASSIGNMENT_STATUS_COMPLETE = 8; // review has been confirmed by an editor | |||
public const REVIEW_ASSIGNMENT_STATUS_THANKED = 9; // reviewer has been thanked | |||
public const REVIEW_ASSIGNMENT_STATUS_CANCELLED = 10; // reviewer cancelled review request | |||
public const REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND = 11; // requested reviewer to reconsider declined invitation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// request resent to reviewer after they declined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done .
public function setReconsiderRequested($reconsider) | ||
{ | ||
$this->setData('reconsider_requested', $reconsider); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename these getter/setter methods to xxxRequestResent()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
locale/en_US/manager.po
Outdated
@@ -2860,6 +2863,11 @@ msgstr "" | |||
"This email is sent when a reviewer that was unassigned is reinstated by an " | |||
"editor." | |||
|
|||
msgid "mailable.reviewerResendRequest.description" | |||
msgstr "" | |||
"This email is sent when a reviewer who has declined review invitation previously " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This email is sent by an editor to a reviewer who has declined a review request, when the editor wishes to resend the request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
locale/en_US/submission.po
Outdated
@@ -1824,6 +1824,9 @@ msgstr "{$editorName} has marked the round {$round} review for submission {$subm | |||
msgid "log.review.reviewReinstated" | |||
msgstr "The round {$round} review by {$reviewerName} for submission {$submissionId} has been reinitiated." | |||
|
|||
msgid "log.review.reviewerResendRequest" | |||
msgstr "The round {$round} review by {$reviewerName} for submission {$submissionId} has been requested to reconsider." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resent the request to review in round {$round} to {$reviewerName} for submission {$submissionid}.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
'stageId' => $reviewAssignment->getStageId(), | ||
'round' => $reviewAssignment->getRound(), | ||
] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I viewed the activity log after resending a request, I got the following error. I don't know if this is related to this log entry, but can you double-check the event is showing up alright in the activity log?
PHP Fatal error: Uncaught Error: Call to a member function getFullName() on null in ojs/lib/pkp/classes/log/EmailLogEntry.php:138
Stack trace:
#0 ojs/lib/pkp/controllers/grid/eventLog/EventLogGridCellProvider.php(103): PKP\log\EmailLogEntry->getSenderFullName()
#1 ojs/lib/pkp/classes/controllers/grid/GridCellProvider.php(57): PKP\controllers\grid\eventLog\EventLogGridCellProvider->getTemplateVarsFromRowColumn(Object(PKP\controllers\grid\eventLog\EventLogGridRow), Object(PKP\controllers\grid\GridColumn))
#2 ojs/lib/pkp/classes/controllers/grid/GridHandler.php(1254): PKP\controllers\grid\GridCellProvider->render(Object(APP\core\Request), Object(PKP\controllers\grid\eventLog\EventLogGridRow), Object(PKP\controllers\grid\GridColumn))
#3 ojs/lib/pkp/classes/controllers/grid/GridHandler.php(1155): PKP\controllers\grid\GridHandler->_renderCellInternally(Object(APP\core\Request), Object(PKP\controllers\grid\eventLog\EventLogGridRow), Object(PKP\controllers\grid\GridColumn))
#4 ojs/lib/pkp/classes/controllers/grid/GridHandler.php(1130): PKP\controllers\grid\GridHandler->renderRowInternally(Object(APP\core\Request), Object(PKP\controllers\grid\eventLog\EventLogGridRow))
#5 ojs/lib/pkp/classes/controllers/grid/GridHandler.php(1180): PKP\controllers\grid\GridHandler->renderRowsInternally(Object(APP\core\Request), Array)
#6 ojs/lib/pkp/classes/controllers/grid/GridHandler.php(1055): PKP\controllers\grid\GridHandler->renderGridBodyPartsInternally(Object(APP\core\Request))
#7 ojs/lib/pkp/classes/controllers/grid/GridHandler.php(726): PKP\controllers\grid\GridHandler->doSpecificFetchGridActions(Array, Object(APP\core\Request), Object(APP\template\TemplateManager))
#8 [internal function]: PKP\controllers\grid\GridHandler->fetchGrid(Array, Object(APP\core\Request))
#9 ojs/lib/pkp/classes/core/PKPRouter.php(465): call_user_func(Array, Array, Object(APP\core\Request))
#10 ojs/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array)
#11 ojs/lib/pkp/classes/core/Dispatcher.php(163): PKP\core\PKPComponentRouter->route(Object(APP\core\Request))
#12 ojs/lib/pkp/classes/core/PKPApplication.php(379): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#13 ojs/index.php(21): PKP\core\PKPApplication->execute()
#14 {main}
thrown in ojs/lib/pkp/classes/log/EmailLogEntry.php on line 138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NateWr there seems to be some sort of problem but it seems unrelated to this PR, I may be mistaken but it seems that way after digging deeper into it . The problem arise when the sender_id
column in the email_log
table set to 0
. In my testing, it set to 0
when an author submit a new submission and a mail set to the author for which this log generated with sender_id
set to 0
. for now I set a fix which at least not cause the activity log to break and load it via ?->
. I think this need to be addressed via a separate issue . I will file a new one and looked into it .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks for l ooking into it. Did you get that issue filed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filed at #8273 .
eccee7b
to
1f9b311
Compare
locale/en_US/emails.po
Outdated
msgid "emails.reviewResendRequest.body" | ||
msgstr "" | ||
"<p>Dear {$recipientName},</p>" | ||
"<p>Recently, you declined our request to review a submission, {$submission Title}, for {$contextName}. I'm writing to see if you are able to conduct the review after all.</p>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typo was in my suggestion, but there's an extra space in {$submission Title}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
a89033f
to
79daa42
Compare
This aims to provide solution to #4789