From 88bf1584a6304a0765822451dbb3a35df92b14e9 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 11 Sep 2009 01:04:00 +0000 Subject: [PATCH] Revert r55459, 55467, 55469, 55518 (Page creation notification email is sent when a watched page is deleted). Breaks current setups where enotif_body is customized. Sidenote: anyone looking to do this right should redo EmailNotification::notifyOnPageChange() to just use the params array from RC, rather than tacking more crap onto this function --- RELEASE-NOTES | 2 -- includes/EnotifNotifyJob.php | 3 +-- includes/RecentChange.php | 3 +-- includes/UserMailer.php | 21 ++++++--------------- languages/messages/MessagesEn.php | 5 +---- 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cdad48a6e0..4b81544a87 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -427,8 +427,6 @@ this. Was used when mwEmbed was going to be an extension. * (bug 20296) Fixed an PHP warning in Language::getMagic() in PHP 5.3 * When creating accounts, don't prefill name from current username (which presumably is already taken) -* (bug 15646) Page creation notification email is no longer sent when a - watched page is deleted * (bug 20358) Unprotect tab was missing accesskey; now same as protect tab. * (bug 20317) Cleaned up default main page link accesskey settings * (bug 20362) Special:Statistics now produces valid HTML when view counters are diff --git a/includes/EnotifNotifyJob.php b/includes/EnotifNotifyJob.php index ee363ec5f8..f7178d0f38 100644 --- a/includes/EnotifNotifyJob.php +++ b/includes/EnotifNotifyJob.php @@ -27,8 +27,7 @@ class EnotifNotifyJob extends Job { $this->params['summary'], $this->params['minorEdit'], $this->params['oldid'], - $this->params['watchers'], - $this->params['deleted'] + $this->params['watchers'] ); return true; } diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 3fc8ed7735..386ae72465 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -196,8 +196,7 @@ class RecentChange $this->mAttribs['rc_timestamp'], $this->mAttribs['rc_comment'], $this->mAttribs['rc_minor'], - $this->mAttribs['rc_last_oldid'], - $this->mAttribs['rc_deleted'] ); + $this->mAttribs['rc_last_oldid'] ); } } diff --git a/includes/UserMailer.php b/includes/UserMailer.php index d7dbff9b26..ce3ca9ea83 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -281,7 +281,7 @@ class EmailNotification { * @param $minorEdit * @param $oldid (default: false) */ - function notifyOnPageChange($editor, $title, $timestamp, $summary, $minorEdit, $oldid = false, $deleted = false ) { + function notifyOnPageChange($editor, $title, $timestamp, $summary, $minorEdit, $oldid = false) { global $wgEnotifUseJobQ, $wgEnotifWatchlist, $wgShowUpdatedMarker; if ($title->getNamespace() < 0) @@ -328,18 +328,16 @@ class EmailNotification { "summary" => $summary, "minorEdit" => $minorEdit, "oldid" => $oldid, - "watchers" => $watchers, - "deleted" => $deleted - ); + "watchers" => $watchers); $job = new EnotifNotifyJob( $title, $params ); $job->insert(); } else { - $this->actuallyNotifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit, $oldid, $watchers, $deleted ); + $this->actuallyNotifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit, $oldid, $watchers ); } } - /** + /* * Immediate version of notifyOnPageChange(). * * Send emails corresponding to the user $editor editing the page $title. @@ -352,9 +350,8 @@ class EmailNotification { * @param $minorEdit bool * @param $oldid int Revision ID * @param $watchers array of user IDs - * @param $deleted boolean If page was deleted */ - function actuallyNotifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit, $oldid, $watchers, $deleted ) { + function actuallyNotifyOnPageChange($editor, $title, $timestamp, $summary, $minorEdit, $oldid, $watchers) { # we use $wgPasswordSender as sender's address global $wgEnotifWatchlist; global $wgEnotifMinorEdits, $wgEnotifUserTalk; @@ -376,7 +373,6 @@ class EmailNotification { $this->minorEdit = $minorEdit; $this->oldid = $oldid; $this->editor = $editor; - $this->deleted = $deleted; $this->composed_common = false; $userTalkId = false; @@ -454,10 +450,6 @@ class EmailNotification { $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastvisited', $difflink ); $keys['$OLDID'] = $this->oldid; $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'changed' ); - } else if( $this->deleted ) { - $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_deletedpagetext' ); - $keys['$OLDID'] = ''; - $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'deleted' ); } else { $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_newpagetext' ); # clear $OLDID placeholder in the message template @@ -476,8 +468,7 @@ class EmailNotification { $body = strtr( $body, $keys ); $pagetitle = $this->title->getPrefixedText(); $keys['$PAGETITLE'] = $pagetitle; - $keys['$REVINFO'] = $this->deleted ? '' : - wfMsgForContent( 'enotif_rev_info', $this->title->getFullUrl() ); + $keys['$PAGETITLE_URL'] = $this->title->getFullUrl(); $keys['$PAGEMINOREDIT'] = $medit; $keys['$PAGESUMMARY'] = $summary; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 646b47e8b7..09ef10a48a 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2611,17 +2611,14 @@ Future changes to this page and its associated talk page will be listed there, a 'enotif_impersonal_salutation' => '{{SITENAME}} user', 'changed' => 'changed', 'created' => 'created', -'deleted' => 'deleted', -'enotif_deletedpagetext' => 'This page is no longer available.', 'enotif_subject' => '{{SITENAME}} page $PAGETITLE has been $CHANGEDORCREATED by $PAGEEDITOR', 'enotif_lastvisited' => 'See $1 for all changes since your last visit.', 'enotif_lastdiff' => 'See $1 to view this change.', 'enotif_anon_editor' => 'anonymous user $1', -'enotif_rev_info' => 'See $1 for the current revision.', 'enotif_body' => 'Dear $WATCHINGUSERNAME, -The {{SITENAME}} page $PAGETITLE has been $CHANGEDORCREATED on $PAGEEDITDATEANDTIME by $PAGEEDITOR. $REVINFO +The {{SITENAME}} page $PAGETITLE has been $CHANGEDORCREATED on $PAGEEDITDATE by $PAGEEDITOR, see $PAGETITLE_URL for the current revision. $NEWPAGE -- 2.20.1