[publication] Fix submission notification text to attribute the submitter#10864
Open
Cryptoteep wants to merge 1 commit into
Open
[publication] Fix submission notification text to attribute the submitter#10864Cryptoteep wants to merge 1 commit into
Cryptoteep wants to merge 1 commit into
Conversation
…tter
Notification recipients (e.g. users with "new publication submission"
notifications enabled) received an email worded as a first-person
confirmation ("This is to confirm the project proposal... We will
notify you once this proposal has been reviewed"), which reads as
though the recipient themselves submitted the proposal even when a
different user actually submitted it.
Update notifier_publication_submission.tpl to use the already-available
$User template variable, consistent with notifier_publication_edit.tpl,
so the email correctly states who submitted the proposal.
Adds a unit test covering the rendered notification text.
Fixes aces#10852
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #10852.
When a user enables "notify me of new publication submissions" in
my_preferencesand a different user submits a new publicationproposal, the notification email received by the first user was worded
as a first-person confirmation:
This reads as though the recipient themselves submitted the proposal,
which is confusing/incorrect when the recipient is actually being
notified about someone else's submission.
modules/publication/ajax/FileUpload.php'snotify()function alreadybuilds a
Uservalue (the submitter's full name) and passes it into thetemplate data for
notifier_publication_submission.tpl, but thetemplate never used that variable. This mirrors the existing
notifier_publication_edit.tpl, which correctly says "... has beenedited by {$User}."
Changes
smarty/templates/email/notifier_publication_submission.tpl: rewordthe notification to state who submitted the proposal, using the
already-available
{$User}variable, and drop the "This is toconfirm ... we will notify you" phrasing that implied the recipient
was the submitter.
test/unittests/PublicationSubmissionNotificationTemplateTest.php:new unit test that renders the template's placeholders with sample
data and asserts:
submitter's name,
FileUpload.php::notify()(Title,Date,User,ProjectName) are still present in the template.No PHP logic changed —
FileUpload.phpalready assembled and passedthe
Uservalue; only the template text was wrong.Test plan
test/unittests/PublicationSubmissionNotificationTemplateTest.php,a pure-PHP unit test (no DB/Smarty bootstrap required) that
simulates the
{$Var}substitution performed byEmail::send()and asserts on the resulting text.
vendor/bin/phpunit/composer testin thesandbox used to prepare this PR (no PHP/composer toolchain
available in that environment). The test was manually verified by
reproducing the same substitution logic in a standalone script
against the real template file, confirming the assertions pass.
Please run the LORIS unit test suite (
test/unittests.sh/phpunit --testsuite LorisUnitTests) in CI to confirm.