Page MenuHomePhabricator

Remove MediaWiki code marked for removal in a past release
Open, LowestPublic

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)

  • 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() (rMW1a2ef297eb17)
  • Parser::uniqPrefix() (rMW1a2ef297eb17)
  • $uniq_prefix in Parser::extractTagsAndParams() (rMW1a2ef297eb17)
  • ApiQueryLogEvents::addLogParams()
  • 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()
  • ChangeTags::listExtensionDefinedTags()
  • VFormHTMLForm::isVForm()
  • User::setCookie()
  • User::clearCookie()
  • User::setExtendedLoginCookie()
  • ApiPageSet::getInvalidTitles()
  • User::createNew()
  • User::getEditTokenTimestamp()
  • User::getPasswordFactory()
  • Revision::getRawUser() (rMW318706a27c52)
  • Revision::getRawUserText() (rMW318706a27c52)
  • Revision::getRawComment() (rMW318706a27c52)
  • 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 (rMWc4145b2f087c)
  • OutputPage::addExtensionStyle() (Unknown Commit)
  • OutputPage::getExtStyle() (Unknown Commit)
  • HTMLForm::isVForm()

Details

Reference
bz59113
Related Gerrit Patches:
mediawiki/extensions/PageForms : masterStatically call the Users::EDIT_TOKEN_SUFFIX constant.
mediawiki/core : masterRemove User::EDIT_TOKEN_SUFFIX, a deprecated constant since 1.27.
mediawiki/core : masterRemove SpecialResetTokens class (Deprecated since 1.26)
mediawiki/core : masterRemove three deprecated functions from the Revision class.
mediawiki/core : masterRemove three deprecated functions from the Revision class.
mediawiki/core : masterRemove two deprecated functions and one depreciated variable in a function call within Parser.php
mediawiki/core : masterChange WikiImporter to now requires the second parameter to be an instance of the Config class.
mediawiki/core : masterRemove deprecated function Article::getContent()
mediawiki/core : masterRemoved deprecated function 'Article::getContent()'
mediawiki/core : masterRemove deprecated function Article::doEdit() and WikiPage::doEdit()
mediawiki/core : masterRemoved deprecated unused method in RedisConnectionPool.php
mediawiki/core : masterRemoved deprecated Linker functions
mediawiki/extensions/Video : masterReplaced usage of Linker::getLinkAttributesInternal
mediawiki/core : masterRemove incorrect deprecated notice from function WikiRevision::getText()
mediawiki/core : masterRemoved deprecated Title::moveNoAuth function
mediawiki/core : masterRemoved deprecated class ImageGallery
mediawiki/core : masterRemoved deprecated function in includes/Title.php
mediawiki/core : masterRemove WebRequest::checkSessionCookie() method as being deprecated
mediawiki/core : masterRemoved deprecated functions in includes/Revision.php
mediawiki/core : masterRemoved deprecated class RevisiondeleteAction
mediawiki/core : masterRemoved deprecated class RevisiondeleteAction()

Event Timeline

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

Change 325163 had a related patch set uploaded (by Filip):
Removed MediaWiki code marked for removal in a past release

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

Change 325163 abandoned by Filip:
Removed MediaWiki code marked for removal in a past release

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

Change 325163 restored by Filip:
Removed MediaWiki code marked for removal in a past release

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

Reedy updated the task description. (Show Details)Dec 4 2016, 2:41 PM
Paladox added a subscriber: Paladox.Dec 4 2016, 2:52 PM

Change 325167 had a related patch set uploaded (by Filip):
Removed deprecated class RevisiondeleteAction()

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

Change 325163 abandoned by Filip:
Removed deprecated class RevisiondeleteAction()

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

Change 325167 merged by jenkins-bot:
Removed deprecated class RevisiondeleteAction

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

Change 329322 had a related patch set uploaded (by Subins2000):
Removed deprecatd function WikiRevision::getText()

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

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

Florian added a subscriber: Florian.Jan 4 2017, 7:11 AM

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 added a subscriber: Matthewrbowker.

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?

Matthewrbowker added a comment.EditedAug 12 2017, 9:01 PM

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)Aug 14 2017, 3:59 PM
Florian updated the task description. (Show Details)
Florian updated the task description. (Show Details)Aug 14 2017, 4:22 PM

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

Framawiki moved this task from Backlog to Doing on the good first task board.Dec 2 2017, 1:40 PM

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