Page MenuHomePhabricator

Remove LinkCache::addGoodLinkObj()
Closed, ResolvedPublic

Description

LinkCache::addGoodLinkObj() has many optional arguments, but omitting them actually means corrupting the cache. Production code should never call this method, it should use addGoodLinkObjFromRow instead.

addGoodLinkObj() is kind of handy to have for tests. We should introduce a separate method, addGoodLinkObjForTest(), that can only be used of MW_PHPUNIT_TEST is set.

addGoodLinkObj() is used in six extensions, see https://codesearch.wmcloud.org/extensions/?q=-%3EaddGoodLinkObj%5C(&i=nope&files=&excludeFiles=&repos=

Deployed:

  • CirrusSearch
  • Babel
  • Flow
  • GeoData
  • Wikibase

Other:

  • Favorites (beta)

Event Timeline

Change 699071 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] LinkCache: hard deprecate addGoodLinkObj()

https://gerrit.wikimedia.org/r/699071

Change 699071 merged by jenkins-bot:

[mediawiki/core@master] LinkCache: soft deprecate addGoodLinkObj()

https://gerrit.wikimedia.org/r/699071

Change 734657 had a related patch set uploaded (by Vlad.shapik; author: Vlad.shapik):

[mediawiki/core@master] Hard deprecate LinkCache::addGoodLinkObj

https://gerrit.wikimedia.org/r/734657

I believe a patch to hard-deprecate this method can be submitted now, and we're done.

The patch has already landed -> https://gerrit.wikimedia.org/r/c/mediawiki/core/+/734657

Change 734657 merged by jenkins-bot:

[mediawiki/core@master] Hard deprecate LinkCache::addGoodLinkObj

https://gerrit.wikimedia.org/r/734657