Index: trunk/phase3/includes/revisiondelete/RevisionDelete.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | } |
133 | 133 | |
134 | 134 | public function getAuthorNameField() { |
135 | | - return 'rev_user_name'; // see Revision::selectUserFields() |
| 135 | + return 'user_name'; // see Revision::selectUserFields() |
136 | 136 | } |
137 | 137 | |
138 | 138 | public function canView() { |
Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -388,8 +388,8 @@ |
389 | 389 | $batch = new LinkBatch(); |
390 | 390 | # Give some pointers to make (last) links |
391 | 391 | foreach ( $this->mResult as $row ) { |
392 | | - $batch->addObj( Title::makeTitleSafe( NS_USER, $row->rev_user_name ) ); |
393 | | - $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->rev_user_name ) ); |
| 392 | + $batch->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) ); |
| 393 | + $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) ); |
394 | 394 | } |
395 | 395 | $batch->execute(); |
396 | 396 | $this->mResult->seek( 0 ); |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -327,7 +327,7 @@ |
328 | 328 | * Return the list of user fields that should be selected from user table |
329 | 329 | */ |
330 | 330 | public static function selectUserFields() { |
331 | | - return array( 'COALESCE(user_name,rev_user_text) AS rev_user_name' ); |
| 331 | + return array( 'user_name' ); |
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
— | — | @@ -376,10 +376,12 @@ |
377 | 377 | $this->mTextRow = null; |
378 | 378 | } |
379 | 379 | |
380 | | - if ( isset( $row->rev_user_name ) ) { |
381 | | - $this->mUserText = $row->rev_user_name; // current user name |
382 | | - } else { // fallback to rev_user_text |
383 | | - $this->mUserText = $row->rev_user_text; // de-normalized |
| 380 | + // Use user_name for users and rev_user_text for IPs. |
| 381 | + // Also fallback to rev_user_text if user_name not given. |
| 382 | + if ( isset( $row->user_name ) ) { |
| 383 | + $this->mUserText = $row->user_name; // logged-in user (ideally) |
| 384 | + } else { |
| 385 | + $this->mUserText = $row->rev_user_text; // IP user (ideally) |
384 | 386 | } |
385 | 387 | } elseif( is_array( $row ) ) { |
386 | 388 | // Build a new revision to be saved... |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -481,15 +481,15 @@ |
482 | 482 | $join_cond['user'] = array( 'LEFT JOIN', 'rev_user != 0 AND user_id = rev_user' ); |
483 | 483 | |
484 | 484 | $queryInfo = array( |
485 | | - 'tables' => $tables, |
486 | | - 'fields' => array_merge( Revision::selectUserFields(), array( |
487 | | - 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect', |
488 | | - 'page_len', 'rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment', |
489 | | - 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted', |
490 | | - 'rev_len' |
491 | | - ) ), |
492 | | - 'conds' => $conds, |
493 | | - 'options' => array( 'USE INDEX' => array('revision' => $index) ), |
| 485 | + 'tables' => $tables, |
| 486 | + 'fields' => array_merge( |
| 487 | + Revision::selectFields(), |
| 488 | + Revision::selectUserFields(), |
| 489 | + array( 'page_namespace', 'page_title', 'page_is_new', |
| 490 | + 'page_latest', 'page_is_redirect', 'page_len' ) |
| 491 | + ), |
| 492 | + 'conds' => $conds, |
| 493 | + 'options' => array( 'USE INDEX' => array( 'revision' => $index ) ), |
494 | 494 | 'join_conds' => $join_cond |
495 | 495 | ); |
496 | 496 | |
— | — | @@ -567,8 +567,8 @@ |
568 | 568 | $batch = new LinkBatch(); |
569 | 569 | # Give some pointers to make (last) links |
570 | 570 | foreach ( $this->mResult as $row ) { |
571 | | - $batch->addObj( Title::makeTitleSafe( NS_USER, $row->rev_user_name ) ); |
572 | | - $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->rev_user_name ) ); |
| 571 | + $batch->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) ); |
| 572 | + $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) ); |
573 | 573 | } |
574 | 574 | $batch->execute(); |
575 | 575 | $this->mResult->seek( 0 ); |
Index: trunk/phase3/includes/specials/SpecialMergeHistory.php |
— | — | @@ -452,8 +452,8 @@ |
453 | 453 | # Give some pointers to make (last) links |
454 | 454 | $this->mForm->prevId = array(); |
455 | 455 | foreach ( $this->mResult as $row ) { |
456 | | - $batch->addObj( Title::makeTitleSafe( NS_USER, $row->rev_user_name ) ); |
457 | | - $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->rev_user_name ) ); |
| 456 | + $batch->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) ); |
| 457 | + $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) ); |
458 | 458 | |
459 | 459 | $rev_id = isset( $rev_id ) ? $rev_id : $row->rev_id; |
460 | 460 | if( $rev_id > $row->rev_id ) { |
Index: trunk/phase3/includes/RevisionList.php |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | } |
297 | 297 | |
298 | 298 | public function getAuthorNameField() { |
299 | | - return 'rev_user_name'; // see Revision::selectUserFields() |
| 299 | + return 'user_name'; // see Revision::selectUserFields() |
300 | 300 | } |
301 | 301 | |
302 | 302 | public function canView() { |