(bug 19214) Make sure new pages have page ID cached for getTitle()
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 17 Jun 2009 21:11:29 +0000 (21:11 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 17 Jun 2009 21:11:29 +0000 (21:11 +0000)
includes/RecentChange.php

index 8e3f110..2ca2f69 100644 (file)
@@ -119,6 +119,8 @@ class RecentChange
        public function &getTitle() {
                if( $this->mTitle === false ) {
                        $this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
+                       # Make sure the correct page ID is process cached
+                       $this->mTitle->resetArticleID( $this->mAttribs['rc_cur_id'] );
                }
                return $this->mTitle;
        }
@@ -158,7 +160,7 @@ class RecentChange
 
                ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
                if( $dbw->cascadingDeletes() and $this->mAttribs['rc_cur_id']==0 ) {
-                       unset ( $this->mAttribs['rc_cur_id'] );
+                       unset( $this->mAttribs['rc_cur_id'] );
                }
 
                # Insert new row