r77935 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77934‎ | r77935 | r77936 >
Date:00:31, 7 December 2010
Author:reedy
Status:reverted
Tags:
Comment:
Revert r77839, tiny subtle change is subtle

$formatted = strval( $this->formatRevValue( $field, $value, $row ) );
!=
$formatted = strval( $this->formatValue( $field, $value, $row ) );

Remove extra parameter to formatValue, it's abstract definition doesn't take row


Slightly more obvious now. Grrr. Still a lot of duplication
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/SpecialCode.php
@@ -235,7 +235,7 @@
236236 $this->mCurrentRow = $row; # In case formatValue needs to know
237237 foreach ( $fieldNames as $field => $name ) {
238238 $value = isset( $row->$field ) ? $row->$field : null;
239 - $formatted = strval( $this->formatValue( $field, $value, $row ) );
 239+ $formatted = strval( $this->formatValue( $field, $value ) );
240240 if ( $formatted == '' ) {
241241 $formatted = ' ';
242242 }
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -354,6 +354,27 @@
355355 }
356356 }
357357
 358+ // Note: this function is poorly factored in the parent class
 359+ function formatRow( $row ) {
 360+ global $wgWikiSVN;
 361+ $css = "mw-codereview-status-{$row->cr_status}";
 362+ $s = "<tr class=\"$css\">\n";
 363+ // Some of this stolen from Pager.php...sigh
 364+ $fieldNames = $this->getFieldNames();
 365+ $this->mCurrentRow = $row; # In case formatValue needs to know
 366+ foreach ( $fieldNames as $field => $name ) {
 367+ $value = isset( $row->$field ) ? $row->$field : null;
 368+ $formatted = strval( $this->formatRevValue( $field, $value, $row ) );
 369+ if ( $formatted == '' ) {
 370+ $formatted = '&#160;';
 371+ }
 372+ $class = 'TablePager_col_' . htmlspecialchars( $field );
 373+ $s .= "<td class=\"$class\">$formatted</td>\n";
 374+ }
 375+ $s .= "</tr>\n";
 376+ return $s;
 377+ }
 378+
358379 function getTitle() {
359380 return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() );
360381 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r77937Technically reverting r77935, making r77839 live again (Confusing, eh? Good j...reedy00:50, 7 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77839abstract class SvnTablePager extends TablePager...reedy22:49, 5 December 2010

Status & tagging log