r83270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83269‎ | r83270 | r83271 >
Date:03:35, 5 March 2011
Author:bawolff
Status:ok
Tags:
Comment:
(bug 27862; follow-up r77714) Make emailuser api module not freak out when SpecialEmailUser returns a status object instead of true.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiEmailUser.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialEmailuser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiEmailUser.php
@@ -63,6 +63,17 @@
6464 'CCMe' => $params['ccme'],
6565 );
6666 $retval = SpecialEmailUser::submit( $data );
 67+
 68+ if ( $retval instanceof Status ) {
 69+ // SpecialEmailUser sometimes returns a status
 70+ // sometimes it doesn't.
 71+ if ( $retval->isGood() ) {
 72+ $retval = true;
 73+ } else {
 74+ $retval = $retval->getErrorsArray();
 75+ }
 76+ }
 77+
6778 if ( $retval === true ) {
6879 $result = array( 'result' => 'Success' );
6980 } else {
Index: trunk/phase3/includes/specials/SpecialEmailuser.php
@@ -221,7 +221,8 @@
222222 * getPermissionsError(). It is probably also a good
223223 * idea to check the edit token and ping limiter in advance.
224224 *
225 - * @return Mixed: True on success, String on error
 225+ * @return Mixed: Status object, or potentially a String on error
 226+ * or maybe even true on success if anything uses the EmailUser hook.
226227 */
227228 public static function submit( $data ) {
228229 global $wgUser, $wgUserEmailUseReplyTo;
Index: trunk/phase3/RELEASE-NOTES
@@ -203,6 +203,7 @@
204204 * (bug 27688) Simplify queries to list user block information
205205 * (bug 27708) list=users does not have a property to return user id
206206 * (bug 27715) imageinfo didn't respect revdelete
 207+* (bug 27862) Useremail module didn't properly return success on success.
207208
208209 === Languages updated in 1.18 ===
209210

Follow-up revisions

RevisionCommit summaryAuthorDate
r834871.17wmf1: MFT r82696, r83270, r83284, r83374, r83390, r83392, r83402, r83403,...catrope21:44, 7 March 2011
r85354MFT r82518, r82530, r82538, r82547, r82550, r82565, r82572, r82608, r82696, r...demon18:25, 4 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77714* Converted UserMailer stuff to return a Status object instead of true-or-Wik...ialex13:27, 4 December 2010

Status & tagging log