In the context of a proposed fix for T86612, Anomie mentioned the following:
This analysis is not correct. LinkCache::addGoodLinkObjFromRow is never called from ApiPageSet. The real bug is that Title::getContentModel() assumes that if $this->mContentModel is falsey then $this->getArticleID() is going to add the title to the link cache. But that doesn't happen (without GAID_FOR_UPDATE, which we don't need here) when $this->mArticleID is already initialized.
In other words, the real fix is that Title::getContentModel() needs to call $linkCache->addLinkObj( $this ) itself before calling $linkCache->getGoodLinkFieldObj( $this, 'model' ), since it can't rely on $this->getArticleID() having done it.
This means code like the following (referring to pages on my test wiki) may return the wrong result:
> var_dump(Title::newFromRow((object)['page_id'=>638,'page_namespace'=>'0','page_title'=>'XD'])->getContentModel()); // should be "text" string(8) "wikitext"
when the content model is actually something else like "text". Title::isRedirect() and Title::getLength() appear to have the same issue:
> var_dump(Title::newFromRow((object)['page_id'=>7,'page_namespace'=>'0','page_title'=>'Abc'])->isRedirect()); // should be true bool(false) > var_dump(Title::newFromRow((object)['page_id'=>7,'page_namespace'=>'0','page_title'=>'Abc'])->getLength()); // should be 37 int(0)
This issue also exists when Title::resetArticleID() is used to clear the LinkCache entry for the title and an article ID is provided. It is related to T71789, for which the fix was thus incomplete.