Remove the page from the LinkCache before adding it again in WikiPage::loadFromRow()
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 9 Mar 2013 20:00:14 +0000 (21:00 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 9 Mar 2013 20:00:14 +0000 (21:00 +0100)
This makes sure the LinkCache doesn't list a page both as good and bad link at the
same time, e.g. when a page gets created or deleted in the request.

Change-Id: I6774132ba8e4d28deed1908150c02fbaa42111a5

includes/WikiPage.php

index 2da314f..da90811 100644 (file)
@@ -377,6 +377,7 @@ class WikiPage implements Page, IDBAccessObject {
         */
        public function loadFromRow( $data, $from ) {
                $lc = LinkCache::singleton();
+               $lc->clearLink( $this->mTitle );
 
                if ( $data ) {
                        $lc->addGoodLinkObjFromRow( $this->mTitle, $data );