OJS 3.3 review request email shows wrong signature

Hi Everyone,

We found a bug in OJS 3.3 when trying to add a new reviewer to a submission.

If the e-mail template uses the {$editorialContactSignature} variable, the system puts the Full Name & E-mail of the editor into the message. This happens even when the editor already has a custom signature saved in their user profile.

Current setup:

  • Tested OJS version: 3.3.0.17

  • Editor has a signature in their profile

  • The REVIEW_REQUEST and REVIEW_REQUEST_ONECLICK e-mail templates use {$editorialContactSignature} at the end

What we expect:

  • The review request mail should end with the editor’s saved signature

What happens now:

  • The mail ends with the editor’s name & e-mail instead of their saved signature

Code that seems to cause the problem:

lib/pkp/classes/user/User.inc.php

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;
    }

Would be great if the dev team could take a look at this and confirm whether it’s a bug or the intended behavior.

Thanks a lot!

Hi @lev,

Thanks for your post - have passed this along to our Dev team.

-Roger
PKP Team

Thank you @lev. Great find and root cause analysis. A bug ticket has been created. This is still seen on version 3.5 although I’m not sure if there was a change to the implementation once the email system was overhauled in 3.4. Your logic makes sense to me.

Here is the bug ticket to follow : [Email Templates] | Edit Templates - Review Email, Editorial signature is not being displayed correctly in the templates · Issue #11832 · pkp/pkp-lib · GitHub

1 Like

Hey @grierb,

thanks a lot for creating the bug ticket!
I hope you have all the info you need to work on it, but let me know if I can add anything.

Cheers,
Lev

Looks like a fix will be in the next release. I have confirmed it is now showing the editors signature if there is one available. Should be released in 3.3.0-23