(bug 37209) Title no longer relies on entries already being in LinkCache
authorVitaliy Filippov <vitalif@yourcmc.ru>
Tue, 20 Nov 2012 17:43:55 +0000 (21:43 +0400)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Fri, 11 Jan 2013 14:55:32 +0000 (15:55 +0100)
This fixes "LinkCache doesn't currently know about this title" error
in some cases, for example, in the case when LinkCache is flushed.

Change-Id: I2fc3966ee5d462ba050a6c54cfda1a0dfd972635

RELEASE-NOTES-1.21
includes/Title.php

index f19a1b0..e8a1432 100644 (file)
@@ -140,6 +140,7 @@ production.
 * (bug 41733) Hide "New user message" (.usermessage) element from printable view.
 * (bug 39062) Special:Contributions will display changes that don't have
   a parent id instead of just an empty bullet item.
+* (bug 37209) "LinkCache doesn't currently know about this title" error fixed.
 * wfMerge() now works if $wgDiff3 contains spaces
 
 === API changes in 1.21 ===
index 48791f0..60e3a1a 100644 (file)
@@ -2986,6 +2986,7 @@ class Title {
                        return $this->mLatestID = 0;
                }
                $linkCache = LinkCache::singleton();
+               $linkCache->addLinkObj( $this );
                $cached = $linkCache->getGoodLinkFieldObj( $this, 'revision' );
                if ( $cached === null ) { # check the assumption that the cache actually knows about this title
                        # XXX: this does apparently happen, see https://bugzilla.wikimedia.org/show_bug.cgi?id=37209