r88043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88042‎ | r88043 | r88044 >
Date:11:09, 14 May 2011
Author:platonides
Status:reverted (Comments)
Tags:
Comment:
(Bug 28960) add message when email copy is sent to user
Also added an error message when the mails were not sent.
Documented the new messages plus some older ones.

Note: $successCount and $failCount fields of Status are ugly to use.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/specials/SpecialEmailuser.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesQqq.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -32,6 +32,7 @@
3333 * New title field of Special:MovePage is now length limited on client side.
3434 * (bug 28888) Searching for something starting with a # sign no longer tells
3535 the user a page named [[:]] already exists.
 36+* (bug 28960) Added more messages to Special:EmailUser.
3637
3738 === API changes in 1.19 ===
3839 * (bug 27790) add query type for querymodules to action=paraminfo
Index: trunk/phase3/includes/specials/SpecialEmailuser.php
@@ -148,8 +148,18 @@
149149 if( $result === true || ( $result instanceof Status && $result->isGood() ) ) {
150150 $wgOut->setPageTitle( wfMsg( 'emailsent' ) );
151151 $wgOut->addWikiMsg( 'emailsenttext' );
152 - $wgOut->returnToMain( false, $this->mTargetObj->getUserPage() );
 152+ if ( $status->successCount > 1 ) $wgOut->addWikiMsg( 'emailyougotcopy' );
 153+ } elseif ( $result instanceof Status ) {
 154+ if ( $status->successCount == 0 ) {
 155+ $wgOut->setPageTitle( wfMsg( 'emailnotsent' ) );
 156+ $wgOut->addWikiMsg( $result->getWikiText( 'emailfailed' ) );
 157+ } elseif ( $status->failCount ) {
 158+ $wgOut->setPageTitle( wfMsg( 'emailsent' ) );
 159+ $wgOut->addWikiMsg( 'emailsenttext' );
 160+ $wgOut->addWikiMsg( $result->getWikiText( 'emailccfailed' ) );
 161+ }
153162 }
 163+ $wgOut->returnToMain( false, $this->mTargetObj->getUserPage() );
154164 }
155165
156166 /**
@@ -303,6 +313,8 @@
304314 if( !$status->isGood() ) {
305315 return $status;
306316 } else {
 317+ $status->successCount++;
 318+
307319 // if the user requested a copy of this mail, do this now,
308320 // unless they are emailing themselves, in which case one
309321 // copy of the message is sufficient.
@@ -314,6 +326,11 @@
315327 );
316328 wfRunHooks( 'EmailUserCC', array( &$from, &$from, &$cc_subject, &$text ) );
317329 $ccStatus = UserMailer::send( $from, $from, $cc_subject, $text );
 330+ if ( $ccStatus->isGood() ) {
 331+ $ccStatus->successCount++;
 332+ } else {
 333+ $ccStatus->failCount++;
 334+ }
318335 $status->merge( $ccStatus );
319336 }
320337
Index: trunk/phase3/languages/messages/MessagesQqq.php
@@ -2328,6 +2328,15 @@
23292329 {{Identical|Send}}',
23302330 'emailccme' => 'Used at [[Special:Preferences]] > E-mail',
23312331 'emailccsubject' => 'Subject of the carbon-copied email for the sender sent through MediaWiki.',
 2332+'emailsent' => 'Title of Special:Emailuser when it says you it sent an email',
 2333+'emailnotsent' => 'Title of Special:Emailuser when it says you it did not sent the email',
 2334+'emailsenttext' => 'When you send an e-mail, Special:Emailuser says you this (Your email has been sent).',
 2335+'emailyougotcopy' => 'Shown below emailsenttext when \'e-mail em a copy\' was chosen.',
 2336+'emailfailed' => 'Error message when sending of the main e-mail failed (cc one is not even tried). The actual error is given as parameter.',
 2337+'emailccfailed' => 'Error message when the e-mail was sent but the user copy was not. The actual error is given as parameter.',
 2338+
 2339+
 2340+'emailyougotcopy' => 'Shown below emailsenttext if you chose "send me a copy".',
23322341 'emailuserfooter' => 'This message is appended to every email sent through the "Email user" function.
23332342
23342343 * $1: username of the sender
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2696,7 +2696,11 @@
26972697 'emailccme' => 'E-mail me a copy of my message.',
26982698 'emailccsubject' => 'Copy of your message to $1: $2',
26992699 'emailsent' => 'E-mail sent',
 2700+'emailnotsent' => 'E-mail not sent',
27002701 'emailsenttext' => 'Your e-mail message has been sent.',
 2702+'emailyougotcopy' => 'A copy of the e-mail has been sent to you.',
 2703+'emailfailed' => 'The e-mail could not be sent: $1',
 2704+'emailccfailed' => 'Your e-mail copy could not be sent: $1',
27012705 'emailuserfooter' => 'This e-mail was sent by $1 to $2 by the "E-mail user" function at {{SITENAME}}.',
27022706
27032707 # User Messenger

Follow-up revisions

RevisionCommit summaryAuthorDate
r88046Followup r88043: Add new message keys to maintenance fileraymond11:21, 14 May 2011
r88119Revert r88043. It was broken in several ways.platonides22:36, 14 May 2011
r88340Revert r88046 due to revert of parent revision r88043.raymond18:41, 17 May 2011

Comments

#Comment by Raymond (talk | contribs)   11:42, 14 May 2011

Seen on Translatewiki:

PHP Notice: Trying to get property of non-object in /www/w/includes/specials/SpecialEmailuser.php on line 151

Status & tagging log