r57331 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57330‎ | r57331 | r57332 >
Date:17:38, 3 October 2009
Author:aaron
Status:ok
Tags:
Comment:
Reason field handling fixes
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -114,8 +114,15 @@
115115 $this->expiry = strlen($this->expiry) ? $this->expiry : $this->expirySelection;
116116 if( $this->expiry == 'existing' ) $this->expiry = $this->oldExpiry;
117117 // Custom reason takes precedence
118 - $this->reason = strlen($this->reason) || $this->reasonSelection == 'other' ?
119 - $this->reason : $this->reasonSelection;
 118+ if( $this->reasonSelection != 'other' ) {
 119+ $comment = $this->reasonSelection; // start with dropdown reason
 120+ if( $this->reason != '' ) {
 121+ $comment .= ": {$this->reason}"; // append custom reason
 122+ }
 123+ } else {
 124+ $comment = $this->reason; // just use custom reason
 125+ }
 126+ $this->reason = $comment;
120127 // Validate precedence setting
121128 $allowed = array(FLAGGED_VIS_QUALITY,FLAGGED_VIS_LATEST,FLAGGED_VIS_PRISTINE);
122129 if( $this->select && !in_array( $this->select, $allowed ) ) {
@@ -421,7 +428,7 @@
422429 }
423430 $settings = '[' . implode(', ',$set). ']';
424431 # Append comment with settings (other than for resets)
425 - $reason = '';
 432+ $reason = $this->reason;
426433 if( !$reset ) {
427434 $reason = $this->reason ? "{$this->reason} $settings" : "$settings";
428435 $encodedExpiry = Block::encodeExpiry($expiry, $dbw );

Follow-up revisions

RevisionCommit summaryAuthorDate
r57344Follow-up r57331: Use colon-separator and commaList consistently...raymond20:44, 3 October 2009

Status & tagging log