r77986 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77985‎ | r77986 | r77987 >
Date:15:57, 7 December 2010
Author:catrope
Status:ok
Tags:
Comment:
Followup r77577: per CR, load "CC me" checkbox state from user preference on first view
Modified paths:
  • /trunk/extensions/ContactPage/SpecialContact.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContactPage/SpecialContact.php
@@ -121,6 +121,7 @@
122122 function __construct( $target, $par ) {
123123 global $wgRequest, $wgUser;
124124
 125+ $this->wasPosted = $wgRequest->wasPosted();
125126 $this->formType = $wgRequest->getText( 'formtype', $par );
126127
127128 # Check for type in [[Special:Contact/type]]: change pagetext and prefill form fields
@@ -214,7 +215,7 @@
215216 }
216217
217218 function showForm() {
218 - global $wgOut, $wgUser, $wgContactRequireAll, $wgContactIncludeIP;
 219+ global $wgOut, $wgUser, $wgContactRequireAll, $wgContactIncludeIP, $wgRequest;
219220
220221 #TODO: show captcha
221222
@@ -287,10 +288,11 @@
288289 </tr>';
289290 }
290291
 292+ $ccme = $this->wasPosted ? $this->cc_me : $wgUser->getBoolOption( 'ccmeonemails' );
291293 $form .= '<tr>
292294 <td></td>
293295 <td class="mw-input">' .
294 - Xml::checkLabel( wfMsg( 'emailccme' ), 'wpCCMe', 'wpCCMe', $this->cc_me ) .
 296+ Xml::checkLabel( wfMsg( 'emailccme' ), 'wpCCMe', 'wpCCMe', $ccme ) .
295297 '<br />' . $this->getCaptcha() .
296298 '</td>
297299 </tr>

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77577ContactPage: (bug 26201) Preservation of "CC me" checkbox state broken. Patch...catrope14:15, 2 December 2010

Status & tagging log