Skip to content

[Email Templates] | Edit Templates - Review Email, Editorial signature is not being displayed correctly in the templates #11832

@Tribunal33

Description

@Tribunal33

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

Image

Steps to Reproduce

  1. Preconditions. As an Editor you must have a signature in the Profile > Contact > Signature
  2. Login with Editor
  3. Navigate to Workflow settings > Email > Email Templates
  4. Find template for 3.3 REVIEW_REQUEST and REVIEW_REQUEST_ONECLICK
  5. Scroll down to the bottom of the template
  6. Observe the template emails

To see the email

  1. Login as Editor
  2. Find a submission in Review > View
  3. Add a reviewer
  4. Find the Review Request template (default)
  5. 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

Metadata

Metadata

Assignees

Labels

Bug:1:MinorA bug found in uncommon paths, with low consequences, limited users or has an easy workaroundTry MeThis issue might be good for a new contributor. Can you help us?

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions