Index: trunk/extensions/Wikilog/WikilogItem.php |
— | — | @@ -233,8 +233,8 @@ |
234 | 234 | $comments = array(); |
235 | 235 | foreach ( $result as $row ) { |
236 | 236 | $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 ); |
239 | 239 | $comment->setText( $rev->getText() ); |
240 | 240 | } |
241 | 241 | $comments[] = $comment; |
Index: trunk/extensions/Wikilog/WikilogComment.php |
— | — | @@ -321,9 +321,9 @@ |
322 | 322 | $comment->mCommentPage = $row->wlc_comment_page; |
323 | 323 | |
324 | 324 | # 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; |
328 | 328 | } |
329 | 329 | return $comment; |
330 | 330 | } |
— | — | @@ -478,10 +478,10 @@ |
479 | 479 | * used in database queries. |
480 | 480 | */ |
481 | 481 | private static function selectInfo( $dbr ) { |
482 | | - extract( $dbr->tableNames( 'wikilog_comments', 'page' ) ); |
| 482 | + list( $wlc, $page ) = $dbr->tableNamesN( 'wikilog_comments', 'page' ); |
483 | 483 | return array( |
484 | 484 | 'tables' => |
485 | | - "{$wikilog_comments} " . |
| 485 | + "{$wlc} " . |
486 | 486 | "LEFT JOIN {$page} ON (page_id = wlc_comment_page)", |
487 | 487 | 'fields' => array( |
488 | 488 | 'wlc_id', |
— | — | @@ -495,9 +495,9 @@ |
496 | 496 | 'wlc_timestamp', |
497 | 497 | 'wlc_updated', |
498 | 498 | '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' |
502 | 502 | ) |
503 | 503 | ); |
504 | 504 | } |