-
Notifications
You must be signed in to change notification settings - Fork 468
Description
Valid Title
- I have updated the title to accurately reflect the bug description
Description
Bug from community forum : https://forum.pkp.sfu.ca/t/ojs-3-3-review-request-email-shows-wrong-signature/97076
Appears on 3.5 as well as the 3.3.0-17 in original post. Essentially profile signature isn't showing up even when there is a profile signature.
Code is suggested for fix at the bottom
Steps to Reproduce
- Preconditions. As an Editor you must have a signature in the Profile > Contact > Signature
- Login with Editor
- Navigate to Workflow settings > Email > Email Templates
- Find template for 3.3 REVIEW_REQUEST and REVIEW_REQUEST_ONECLICK
- Scroll down to the bottom of the template
- Observe the template emails
To see the email
- Login as Editor
- Find a submission in Review > View
- Add a reviewer
- Find the Review Request template (default)
- Observe the email signature
Expected Result
Should be the signature from the profile when it is filled out and full name when it is not filled out
Actual Result
It displays the full name & e-mail instead of their saved signature
Refer to original forum post : https://forum.pkp.sfu.ca/t/ojs-3-3-review-request-email-shows-wrong-signature/97076
Environment Details
No response
Application Version
OJS 3.3.0-17 (found) but still in 3.5.0-2 OJS
Logs
No response
Additional Information
Here is the community member's work to trace the root cause of the bug. Not sure if the fix is good. It looks like it returns if there is a signature but skips some other things?
function getContactSignature() {
$signature = htmlspecialchars($this->getFullName());
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER);
if ($a = $this->getLocalizedAffiliation()) $signature .= '<br/>' . htmlspecialchars($a);
if ($p = $this->getPhone()) $signature .= '<br/>' . __('user.phone') . ' ' . htmlspecialchars($p);
$signature .= '<br/>' . htmlspecialchars($this->getEmail());
return $signature;
}Suggested fix:
function getContactSignature() {
$signature = $this->getLocalizedSignature();
if (!empty($signature)) {
return $signature;
}
$signature = htmlspecialchars($this->getFullName());
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER);
if ($a = $this->getLocalizedAffiliation()) $signature .= '<br/>' . htmlspecialchars($a);
if ($p = $this->getPhone()) $signature .= '<br/>' . __('user.phone') . ' ' . htmlspecialchars($p);
$signature .= '<br/>' . htmlspecialchars($this->getEmail());
return $signature;
}Pull Request
pkp-lib(stable3.3): #11955
ojs(submodule update): pkp/ojs#5151
omp(submodule update): pkp/omp#2143
ops(submodule update): pkp/ops#1116