Page MenuHomePhabricator

Remove methods in MW core deprecated since MW 1.25 or earlier
Closed, ResolvedPublic

Description

Idea from T34603: search around MediaWiki for "remove after 1.XX release" code and similar and kill that code (or file bugs to remember to remove the code later).

Make sure you use a commit summary that explains what you're doing/removing (reusing this task title isn't a good one!), and also add an entry to RELEASE-NOTES-1.29 similar to those that exist already https://github.com/wikimedia/mediawiki/blob/2c74b04/RELEASE-NOTES-1.29#L54-L68

Example: https://www.mediawiki.org/wiki/Special:Code/MediaWiki/104318 added "Do not release 1.19 with this." in a comment. Search for phrases like that.

List of things that could be removed (thanks to @Matthewrbowker):
Remove after...
<None found>

Deprecated, use ... instead

  • class ResetUserTokens
  • Skin::doEditSectionLink()
  • User::getImplicitGroups()

@deprecated (Soft deprecated)

wfDeprecated (Hard deprecated)

  • Parser::getRandomString() (rMW1a2ef297eb17)
  • Parser::uniqPrefix() (rMW1a2ef297eb17)
  • $uniq_prefix in Parser::extractTagsAndParams() (rMW1a2ef297eb17)
  • ApiQueryLogEvents::addLogParams()(rMW6ff65e57bbf2)
  • In DifferenceEngine::textDiff() there is a notation deprecating a variable
  • $wgSessionsInObjectCache in class Setup
  • SearchEngine::getOpenSearchTemplate()
  • WikiImproter::__construct() without a Config instance (rMWaf1434ff2fea)
  • LoginSignupSpecialPage::getFakeTemplate() has hook references depricated
  • ChangeTags::listExtensionActivatedTags()(rMW390f6411e09b)
  • ChangeTags::listExtensionDefinedTags()(rMW390f6411e09b)
  • VFormHTMLForm::isVForm()(rMWae7237ea9839)
  • User::setCookie()(rMW5ab3ae037114)
  • User::clearCookie()(rMW5ab3ae037114)
  • User::setExtendedLoginCookie()(rMW5ab3ae037114)
  • ApiPageSet::getInvalidTitles()(rMW6ff65e57bbf2)
  • User::createNew()
  • User::getEditTokenTimestamp()(rMWc8ea95160ae0)
  • User::getPasswordFactory()(rMWc8ea95160ae0)
  • Revision::getRawUser() (rMW318706a27c52)
  • Revision::getRawUserText() (rMW318706a27c52)
  • Revision::getRawComment() (rMW318706a27c52)
  • MWLBFactory::getLBFactoryClass() (inside the class)
  • Class LoginForm
  • Job::batchInsert()
  • UploadBase::stashFileGetKey()(rMWe745bfed82c4)
  • UploadBase::stashSession()(rMWe745bfed82c4)
  • MWExceptionHandler::getLogId()
  • ApiResult::__construct - handing instance of ApiMain
  • ApiBase::getModuleProfileName()(rMW80f787fba3e8)
  • ApiBase::safeProfileOut()(rMW6ff65e57bbf2)
  • ApiBase::getProfileTime()(rMW64b146e55a13)
  • ApiBase::profileDBIn()(rMW6ff65e57bbf2)
  • ApiBase::profileDBOut()(rMW6ff65e57bbf2)
  • ApiBase::getProfileDBTime()(rMW3f1230e9ec36)
  • ResourceLoader::readStyleFiles() without a ResourceLoader context.
  • SpecialPageFactory::getList()
  • SpecialPageFactory::getPage() - Array syntax
  • StripState::__construct called with any arguements
  • GlobalFunctions.php - wfErrorLog()
  • GlobalFuctions.php - wfFixSessionID()
  • GlobalFunctions.php - wfResetSessionID()
  • GlobalFunctions.php - wfSetupSession()
  • Linker::getLinkColour()(rMW03e7ae45bcb1)
  • Linker::link() with $query as string
  • SkinTemplate::outputPage() (Not sure on this one, it's hidden in an if())
  • Linker::formatTemplates()(rMW8d47f5368785)
  • MailAddress::__construct() called with a user object
  • Block::__construct with multiple arguements
  • OutputPage::__construct with no context (rMWc4145b2f087c)
  • OutputPage::addExtensionStyle() (Unknown Commit)
  • OutputPage::getExtStyle() (Unknown Commit)
  • HTMLForm::isVForm()(rMWae7237ea9839)

Details

Reference
bz59113
SubjectRepoBranchLines +/-
mediawiki/extensions/PageFormsmaster+1 -1
mediawiki/coremaster+1 -7
mediawiki/coremaster+1 -167
mediawiki/coremaster+5 -34
mediawiki/coremaster+5 -34
mediawiki/coremaster+5 -28
mediawiki/coremaster+4 -5
mediawiki/coremaster+1 -18
mediawiki/coremaster+1 -18
mediawiki/coremaster+1 -127
mediawiki/coremaster+1 -16
mediawiki/coremaster+4 -138
mediawiki/extensions/Videomaster+2 -2
mediawiki/coremaster+0 -4
mediawiki/coremaster+1 -12
mediawiki/coremaster+2 -15
mediawiki/coremaster+2 -12
mediawiki/coremaster+2 -20
mediawiki/coremaster+8 -55
mediawiki/coremaster+1 -66
mediawiki/coremaster+0 -66
Show related patches Customize query in gerrit

Related Objects

StatusSubtypeAssignedTask
ResolvedNone
ResolvedNone

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 329322 merged by jenkins-bot:
Remove incorrect deprecated notice from function WikiRevision::getText()

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

Change 329336 had a related patch set uploaded (by Subins2000):
Remove deprecated function Article::doEdit()

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

Change 329335 had a related patch set uploaded (by Subins2000):
Remove deprecated function Article::getContent()

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

Change 329511 had a related patch set uploaded (by Victorbarbu):
Remove WebRequest::checkSessionCookie() method as being deprecated

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

Change 329710 had a related patch set uploaded (by Awu42):
Removed deprecated functions in includes/Title.php

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

Change 329766 had a related patch set uploaded (by Divadsn):
Removed deprecated functions in includes/Revision.php

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

Change 329766 abandoned by Divadsn:
Removed deprecated functions in includes/Revision.php

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

Change 329773 had a related patch set uploaded (by Divadsn):
Removed deprecated class ImageGallery

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

Change 329773 had a related patch set uploaded (by Divadsn):
Removed deprecated class ImageGallery

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

This change relates on these changes which remove the left usages of ImageGallery, see topic deprecated-ImageGallery:
https://gerrit.wikimedia.org/r/#/q/topic:deprecated-ImageGallery+(status:open+OR+status:merged)

Change 329511 merged by jenkins-bot:
Remove WebRequest::checkSessionCookie() method as being deprecated

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

Change 329801 had a related patch set uploaded (by Awu42):
Removed deprecated Title::moveNoAuth function

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

Change 329710 abandoned by Awu42:
Removed deprecated function in includes/Title.php

Reason:
Moved to https://gerrit.wikimedia.org/r/#/c/329801/

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

Change 329773 merged by jenkins-bot:
Removed deprecated class ImageGallery

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

Change 329801 merged by jenkins-bot:
Removed deprecated Title::moveNoAuth function

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

Change 330594 had a related patch set uploaded (by Awu42):
Removed deprecated Linker functions

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

Change 330840 had a related patch set uploaded (by Awu42):
Replaced usage of Linker::getLinkAttributesInternal

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

Change 331118 had a related patch set uploaded (by Filip):
Removed deprecated function 'Article::getContent()'

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

Change 330840 merged by jenkins-bot:
Replaced usage of Linker::getLinkAttributesInternal

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

Change 330594 merged by jenkins-bot:
Removed deprecated Linker functions

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

Is code marked with deprecated, use ... instead considered good to remove?

Is code marked with deprecated, use ... instead considered good to remove?

As long Reedy won't find any usages in other extensions and the code is marked as deprecated since version <1.28, it should be good :)

@Victorbarbu Of course, you can remove code, that is marked as deprecated, too :) As far as I can see, the task is already resolved, as there are no more code usages left which are marked as "remove after ...", right? Can anyone recheck? Should we keep this task open as long as the Google Code-In hasn't finished, so stuendts can remove functions and classes, whicha re marked as deprecated (@deprecated or a call to wfDeprecated)?

Change 331465 had a related patch set uploaded (by Georggi199):
Removed deprecated unused method in RedisConnectionPool.php

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

Change 331465 merged by jenkins-bot:
Removed deprecated unused method in RedisConnectionPool.php

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

Change 329336 merged by jenkins-bot:
Remove deprecated function Article::doEdit() and WikiPage::doEdit()

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

Change 331118 abandoned by Reedy:
Removed deprecated function 'Article::getContent()'

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

Change 329335 abandoned by Reedy:
Remove deprecated function Article::getContent()

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

All patches mentioned are either merged or abandoned.

What's the measurable criteria to call this task resolved?

Matthewrbowker subscribed.

A good chance for me to make a foray into the MediaWiki code...

I'll make one more pass through, looking for any "remove after ...", "deprecated, use ... instead", "@deprecated" or "wfDeprecated". If I find none before 1.28, I'll close. Will that work?

Okay, searching through a current MediaWiki checkout (rMW21a34a42f4) I found the following. Note that I have ignored anything greater than 1.28.

Remove after...
<None found>

Deprecated, use ... instead

  • class ResetUserTokens
  • Skin::doEditSectionLink()
  • User::getImplicitGroups()

@deprecated (Soft deprecated)

  • class ProfileSection
  • function wfProfileIn() (ProfilerFunctions.php)
  • function wfProfileOut() (ProfilerFunctions.php)
  • class SpecialResetTokens
  • EDIT_TOKEN_SUFFIX (in User.php)
  • User::randomPassword()
  • User::setPassword()
  • User::setInternalPassword()
  • User::setNewpassword()
  • User::getTokenFromOption()
  • User::setCookie()
  • User::clearCookie()
  • User::setExtendedLoginCookie()
  • User::checkPassword()
  • User::checkTemporaryPassword()
  • User::getEditTokenTimestamp()
  • User::addNewUserLogEntry()
  • User::addNewUserLogEntryAutoCreate()
  • BufferingStatsdDataFactory::getBuffer()
  • User::getPasswordFactory()
  • User::passwordChangeInputAttribs()
  • Language::initEncoding()
  • Language::recodeForEdit()
  • Language::recodeInput()
  • Interwiki::isValidInterwiki()
  • Interwiki::fetch()
  • Inetwiki::getAllPrefixes()
  • class AuthManagerAuthPlugin
  • Class AuthManagerAuthPluginUser
  • Status::getErrorsArray()
  • Status::getWarningsArray()
  • $mUniqPrefix (in class Parser)
  • Parser::getRandomString()
  • Parser::uniqPrefix()
  • Parser::disableCache()
  • SkinFactory::getDefaultInstance()
  • ApiQueryInfo::getTokenFunctions()
  • ApiQueryInfo::resetTokenCache()
  • ApiQueryInfo::getEditToken()
  • ApiQueryInfo::getDeleteToken()
  • ApiQueryInfo::getProtectToken()
  • ApiQueryInfo::getMoveToken()
  • ApiQueryInfo::getBlockToken()
  • ApiQueryInfo::getUnblockToken()
  • ApiQueryInfo::getEmailToken()
  • ApiQueryInfo::getImportToken()
  • ApiQueryInfo::getWatchToken()
  • ApiQueryInfo::getOptionsToken()
  • LoadBalancer::getLaggedSlaveMode()
  • LoadBalancer::laggedSlaveUsed()
  • MimeMagic::singleton()
  • class ApiTokens

wfDeprecated (Hard deprecated)

  • Parser::getRandomString()
  • Parser::uniqPrefix()
  • $uniq_prefix in Parser::extractTagsAndParams()
  • ApiQueryLogEvents::addLogParams()
  • In DifferenceEngine::textDiff() there is a notation deprecating a variable
  • $wgSessionsInObjectCache in class Setup
  • SearchEngine::getOpenSearchTemplate()
  • WikiImproter::__construct() without a Config instance
  • LoginSignupSpecialPage::getFakeTemplate() has hook references depricated
  • ChangeTags::listExtensionActivatedTags()
  • ChangeTags::listExtensionDefinedTags()
  • VFormHTMLForm::isVForm()
  • User::setCookie()
  • User::clearCookie()
  • User::setExtendedLoginCookie()
  • ApiPageSet::getInvalidTitles()
  • User::createNew()
  • User::getEditTokenTimestamp()
  • User::getPasswordFactory()
  • Revision::getRawUser()
  • Revision::getRawUserText()
  • Revision::getRawComment()
  • MWLBFactory::getLBFactoryClass() (inside the class)
  • Class LoginForm
  • Job::batchInsert()
  • UploadBase::stashFileGetKey()
  • UploadBase::stashSession()
  • MWExceptionHandler::getLogId()
  • ApiResult::__construct - handing instance of ApiMain
  • ApiBase::getModuleProfileName()
  • ApiBase::safeProfileOut()
  • ApiBase::getProfileTime()
  • ApiBase::profileDBIn()
  • ApiBase::profileDBOut()
  • ApiBase::getProfileDBTime()
  • ResourceLoader::readStyleFiles() without a ResourceLoader context.
  • SpecialPageFactory::getList()
  • SpecialPageFactory::getPage() - Array syntax
  • StripState::__construct called with any arguements
  • GlobalFunctions.php - wfErrorLog()
  • GlobalFuctions.php - wfFixSessionID()
  • GlobalFunctions.php - wfResetSessionID()
  • GlobalFunctions.php - wfSetupSession()
  • Linker::getLinkColour()
  • Linker::link() with $query as string
  • SkinTemplate::outputPage() (Not sure on this one, it's hidden in an if())
  • Linker::formatTemplates()
  • MailAddress::__construct() called with a user object
  • Block::__construct with multiple arguements
  • OutputPage::__construct with no context
  • OutputPage::addExtensionStyle()
  • OutputPage::getExtStyle()
  • HTMLForm::isVForm()

Change 371764 had a related patch set uploaded (by Matthewrbowker; owner: Matthewrbowker):
[mediawiki/core@master] Change WikiImporter to now requires the second parameter to be an instance of the Config class.

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

Florian updated the task description. (Show Details)

Change 371764 merged by jenkins-bot:
[mediawiki/core@master] Change WikiImporter to now requires the second parameter to be an instance of the Config class.

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

Change 372113 had a related patch set uploaded (by Matthewrbowker; owner: Matthewrbowker):
[mediawiki/core@master] Remove two deprecated functions and one depreciated variable in a function call within Parser.php

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

Change 372113 merged by jenkins-bot:
[mediawiki/core@master] Remove two deprecated functions and one depreciated variable in a function call within Parser.php

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

Change 400618 had a related patch set uploaded (by Matthewrbowker; owner: Matthewrbowker):
[mediawiki/core@master] Remove three deprecated functions from the Revision class.

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

Change 400618 abandoned by Matthewrbowker:
Remove three deprecated functions from the Revision class.

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

Change 430443 had a related patch set uploaded (by Matthewrbowker; owner: Matthewrbowker):
[mediawiki/core@master] Remove three deprecated functions from the Revision class.

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

Change 430443 merged by jenkins-bot:
[mediawiki/core@master] Remove three deprecated functions from the Revision class.

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

Change 476586 had a related patch set uploaded (by Matthewrbowker; owner: Matthewrbowker):
[mediawiki/core@master] Remove SpecialResetTokens class (Deprecated since 1.26)

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

Change 476603 had a related patch set uploaded (by Matthewrbowker; owner: Matthewrbowker):
[mediawiki/core@master] Remove EDIT_TOKEN_SUFFIX, a deprecated constant in Users.php since 1.27.

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

Change 476586 abandoned by Matthewrbowker:
Remove SpecialResetTokens class (Deprecated since 1.26)

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

Change 477612 had a related patch set uploaded (by Matthewrbowker; owner: Matthewrbowker):
[mediawiki/extensions/PageForms@master] Statically call the Users::EDIT_TOKEN_SUFFIC constant.

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

Change 476603 merged by jenkins-bot:
[mediawiki/core@master] Remove User::EDIT_TOKEN_SUFFIX, a deprecated constant since 1.27.

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

@Zoranzoki21: Why did you remove those two release project tags if some patches were merged for these two releases?

@Zoranzoki21: Why did you remove those two release project tags if some patches were merged for these two releases?

@Aklapper Because @ReleaseTaggerBot usually removes it.

Change 477612 abandoned by Thiemo Kreuz (WMDE):
Statically call the Users::EDIT_TOKEN_SUFFIX constant.

Reason:
This is a false positive. Have a look at what I4b3f7b7 did. In older MediaWiki version this constant actually existed. The code touched in this patch is targeted at these older MediaWiki versions. So the reference is actually correct as it is.

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

Krinkle renamed this task from Remove MediaWiki code marked for removal in a past release to Remove methods in MW core deprecated since MW 1.25 or earlier.May 29 2022, 10:02 PM
matmarex subscribed.

Looks like this task was somewhat forgotten, and I just found it by accident when searching for something else. I was curious and checked, and it looks like we have removed almost everything deprecated in 1.25 or earlier, with a few exceptions that have good reasons: https://codesearch.wmcloud.org/core/?q=(%40deprecated|wfDeprecated).*1\.(\d|1\d|2[012345])\b

  • $wgOpenSearchTemplate – Would be a breaking change for site administrators, not just developers
  • $wgTrackingCategories – Would be a breaking change for site administrators, not just developers
  • ApiQueryDeletedrevs – Would be a breaking change for API users, not just developers – but see T221869
  • WikiPage::replaceSectionContent – Would be a breaking change for API users (the method is still called when using API action=edit&basetimestamp=... without baserevid=..., which is not even deprecated) – see T58849
  • TablePager::getBody – This one actually should be removed, but despite being deprecated in 1.24, it only emits deprecation warnings since 1.41, so we can give it a few more releases

I'll close it, given the above. The two removals that need tasks already have them.