r52075 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52074‎ | r52075 | r52076 >
Date:21:11, 17 June 2009
Author:aaron
Status:ok
Tags:
Comment:
(bug 19214) Make sure new pages have page ID cached for getTitle()
Modified paths:
  • /trunk/phase3/includes/RecentChange.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RecentChange.php
@@ -119,6 +119,8 @@
120120 public function &getTitle() {
121121 if( $this->mTitle === false ) {
122122 $this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
 123+ # Make sure the correct page ID is process cached
 124+ $this->mTitle->resetArticleID( $this->mAttribs['rc_cur_id'] );
123125 }
124126 return $this->mTitle;
125127 }
@@ -158,7 +160,7 @@
159161
160162 ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
161163 if( $dbw->cascadingDeletes() and $this->mAttribs['rc_cur_id']==0 ) {
162 - unset ( $this->mAttribs['rc_cur_id'] );
 164+ unset( $this->mAttribs['rc_cur_id'] );
163165 }
164166
165167 # Insert new row

Status & tagging log