r62495 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62494‎ | r62495 | r62496 >
Date:04:38, 15 February 2010
Author:juliano
Status:deferred
Tags:
Comment:
Rename comment field aliases to avoid conflict with items.
Modified paths:
  • /trunk/extensions/Wikilog/WikilogComment.php (modified) (history)
  • /trunk/extensions/Wikilog/WikilogItem.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikilog/WikilogItem.php
@@ -233,8 +233,8 @@
234234 $comments = array();
235235 foreach ( $result as $row ) {
236236 $comment = WikilogComment::newFromRow( $this, $row );
237 - if ( $row->page_latest ) {
238 - $rev = Revision::newFromId( $row->page_latest );
 237+ if ( $comment->mCommentRev ) {
 238+ $rev = Revision::newFromId( $row->mCommentRev );
239239 $comment->setText( $rev->getText() );
240240 }
241241 $comments[] = $comment;
Index: trunk/extensions/Wikilog/WikilogComment.php
@@ -321,9 +321,9 @@
322322 $comment->mCommentPage = $row->wlc_comment_page;
323323
324324 # This information may not be available for deleted comments.
325 - if ( $row->page_title && $row->page_latest ) {
326 - $comment->mCommentTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
327 - $comment->mCommentRev = $row->page_latest;
 325+ if ( $row->wlc_page_title && $row->wlc_page_latest ) {
 326+ $comment->mCommentTitle = Title::makeTitle( $row->wlc_page_namespace, $row->wlc_page_title );
 327+ $comment->mCommentRev = $row->wlc_page_latest;
328328 }
329329 return $comment;
330330 }
@@ -478,10 +478,10 @@
479479 * used in database queries.
480480 */
481481 private static function selectInfo( $dbr ) {
482 - extract( $dbr->tableNames( 'wikilog_comments', 'page' ) );
 482+ list( $wlc, $page ) = $dbr->tableNamesN( 'wikilog_comments', 'page' );
483483 return array(
484484 'tables' =>
485 - "{$wikilog_comments} " .
 485+ "{$wlc} " .
486486 "LEFT JOIN {$page} ON (page_id = wlc_comment_page)",
487487 'fields' => array(
488488 'wlc_id',
@@ -495,9 +495,9 @@
496496 'wlc_timestamp',
497497 'wlc_updated',
498498 'wlc_comment_page',
499 - 'page_namespace',
500 - 'page_title',
501 - 'page_latest'
 499+ 'page_namespace AS wlc_page_namespace',
 500+ 'page_title AS wlc_page_title',
 501+ 'page_latest AS wlc_page_latest'
502502 )
503503 );
504504 }

Status & tagging log