Bug 7763

Summary: Blank email notification sent when submission metadata is edited
Product: OJS Reporter: barbara.hui
Component: Open Journal SystemsAssignee: PKP Support <pkp-support>
Status: RESOLVED FIXED    
Severity: normal CC: alec, barbara.hui
Priority: P3    
Version: 2.4.0   
Hardware: All   
OS: All   
Version Reported In: Also Affects:
Attachments: Patch against OJS 2.3.7

Description barbara.hui 2012-08-08 13:34:43 PDT
What's happening is that when a user is signed up to get email notifications for certain actions, the emails that are sent have the subject "[journal_path] Array" and a blank body (with the journal's footer at the bottom). I posted a description to the forums here: http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=8813 -- looks like at least one other site is experiencing this.

In trying to debug, it looks like there's something going on it this file in the pkp/lib submodule:
ojs/lib/pkp/classes/notification/NotificationDAO.inc.php
On line 292 when the parameters should be set for various parts of the email (subject, body), the parameters are empty.
Comment 1 Alec Smecher 2012-08-08 16:18:10 PDT
Barbara, can you verify whether there's an email called "NOTIFICATION" in your Journal Manager's "Prepared Emails" interface?
Comment 2 barbara.hui 2012-08-08 16:29:05 PDT
Hi Alec,

Yes, the email template is in the UI. I've checked the database queries in the code and those seem fine. Somehow the parameters for the subject and body of the email/notification aren't being passed in properly when the notification object is created.

Barbara
Comment 3 Alec Smecher 2012-08-08 16:31:05 PDT
Unfortunately I'm having trouble replicating the problem. Does it seem to affect all emailed notifications, or just one or two in particular?
Comment 4 barbara.hui 2012-08-08 16:47:04 PDT
Sorry, here's how I'm replicating the problem that users are reporting: 

-- sign into journal as author (this user has author role only)
-- click on "Notifications" in the sidebar, then "Manage"
-- check off "Send me an email for these types of notifications." under "Submission Events" --> "Title's" metadata has been modified."
-- sign in to journal as editor (this user is also has all other roles for this journal)
-- make some modifications to that submission's metadata (example URL: ojs/index.php/test-journal/editor/viewMetadata/12345)
-- click "Save Metadata" at the bottom of the page
-- upon submission, the author account gets an email with the subject "[Test] Array" and the contents:

________________________________________________________________________
Internal Test Journal
https://submit.escholarship.org/ojs/index.php/test-journal
Comment 5 Alec Smecher 2012-08-08 18:19:22 PDT
Created attachment 3838 [details]
Patch against OJS 2.3.7

Barbara, try this patch -- it should correct the issue. It was a pretty obscure POST variable clobbering.
Comment 6 Alec Smecher 2012-08-08 18:40:03 PDT
Fixed accidental override from posted subject param in notification email
https://github.com/pkp/pkp-lib/commit/d61d91889ae6b89559b9d3a6b9e58f943bdcac49
Comment 7 Alec Smecher 2012-08-08 18:40:04 PDT
Fixed accidental override from posted subject param in notification email
https://github.com/pkp/pkp-lib/commit/232dbf5cbdb75f2b6cf36a696b6c50bf28b6ff51
Comment 8 barbara.hui 2012-08-09 11:01:33 PDT
Aha! Thanks Alec. That fixes it.