Page MenuHomePhabricator

Mediawiki core needs uses of global $wgUser removed
Open, MediumPublic

Description

This task deals with reducing the references to wgUser in core.
See the parent task for deprecating and removing it entirely

Codesearch: https://codesearch.wmflabs.org/core/?q=wgUser%5B%5Ea-zA-Z%5D&i=nope&files=%5C.php%24&repos=

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenDannyS712
OpenDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
OpenDannyS712
ResolvedDannyS712
OpenDannyS712
DeclinedDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
StalledDannyS712
ResolvedDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
ResolvedDannyS712
StalledDannyS712
StalledDannyS712
ResolvedDannyS712
StalledDannyS712
ResolvedDannyS712
StalledDannyS712
ResolvedDannyS712
ResolvedYaron_Koren
ResolvedDannyS712
ResolvedDannyS712
StalledDannyS712
ResolvedDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
ResolvedDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
OpenDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
StalledDannyS712
OpenDannyS712
ResolvedDannyS712
Resolvedaaron
OpenNone
ResolvedDannyS712
OpenNone
OpenDannyS712
ResolvedDannyS712
OpenNone
ResolvedDannyS712
ResolvedNone
ResolvedDannyS712
OpenNone
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
OpenNone
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
OpenDannyS712
StalledDannyS712
OpenDannyS712
OpenNone
OpenNone
ResolvedDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
ResolvedDannyS712
OpenNone
OpenDannyS712
OpenDannyS712
OpenDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
OpenDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712

Event Timeline

DannyS712 triaged this task as Medium priority.Jan 26 2020, 9:55 AM
DannyS712 created this task.
Restricted Application added a project: User-DannyS712. · View Herald TranscriptJan 26 2020, 9:55 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 567324 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] FileDeleteForm: Pass output, user, and request to showForm

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

Change 567325 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] ImageBuilder: Update to LocalFile::recordUpload2, pass a user

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

DannyS712 updated the task description. (Show Details)Feb 6 2020, 7:42 AM

Change 571226 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add a user parameter to LanguageConverter::getUserVariant

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

DannyS712 updated the task description. (Show Details)Feb 11 2020, 12:17 AM

Change 567325 merged by jenkins-bot:
[mediawiki/core@master] ImageBuilder: Update to LocalFile::recordUpload2, pass a user

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

Change 571226 merged by jenkins-bot:
[mediawiki/core@master] Add a user parameter to LanguageConverter::getUserVariant

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

DannyS712 added a comment.EditedFeb 22 2020, 1:18 AM

Status update for all mentions of $wgUser in core (checked means nothing more to do for 1.35)

  • AjaxResponse::checkLastModified uses $wgUser, not as a fallback -> T245800
  • FileDeleteForm::__construct falls back to $wgUser -> not passing a user is hard deprecated, see T245233, T245581
  • FileDeleteForm::doDelete falls back to $wgUser -> not passing a user is hard deprecated, see T245682, T245802, T245801
  • GlobalFunctions - just a comment
  • OutputPage - comments
  • Revision (lots) - entire class is soft deprecated
  • Setup - only use is setting $wgUser
  • Title::userCan falls back to $wgUser -> entire function is harddeprecated, see T244923
  • Title::quickUserCan falls back to $wgUser -> entire function is hard deprecated, see T244927
  • Title::getNotificationTimestamp falls back to $wgUser -> not passing a user is hard deprecated, see T245702
  • Title::moveSubpages - was hard deprecated, removed, see T245483
  • WebRequest::getLimitOffset uses $wgUser -> hard deprecated, see T243805, T245779, T245777
  • ApiMain::__construct - writes to $wgUser
  • ApiQuery(Info|RecentChanges|Revisions|Users) - lots, see T245329
  • GenderCache::getGenderOff
  • MessageCache::getParserOptions (made private to simplify further changes, see T247189)
  • RecentChange::markPatrolled falls back to $wgUser - entire function should be hard deprecated, see T245195
  • RequestContext::importScopedSession - writes to $wgUser
  • LocalFile::recordUpload - entire function should be hard deprecated
  • LocalFile::recordUpload2 falls back to $wgUser
  • LocalFileDeleteBatch::__construct falls back to $wgUser - see T245710
  • Installer::__construct - writes to $wgUser
  • DoubleRedirectJob - writes to $wgUser
  • Linker::userToolLinks - reads from $wgUser, use removed, see T244602
  • LogEventsList::typeAction - uses $wgUser
  • LogEventsList::userCan(Bitfield|ViewLogType)? - falls back to $wgUser, not passing a user is hard deprecated, see T245704
  • LogEventsList::getExcludeClause
  • LogPage::addEntry - falls back to $wgUser, not passing a user is hard deprecated, see T243652, T245701
  • PatrolLog::record - falls back to $wgUser, not passing a user is hard deprecated, see T245707
  • Article - comment
  • PageArchive::undelete - falls back to $wgUser
  • WikiPage::doEditContent - falls back to $wgUser, entire function is soft deprecated
  • WikiPage::prepareContentForEdit - falls back to $wgUser, entire function is soft deprecated
  • WikiPage::insertProtectNullRevision - falls back to $wgUser (in Revision::newNullRevision), not passing a user is hard deprecated, see T245705
  • WikiPage::doDeleteArticleReal - falls back to $wgUser
  • Parser - comment
  • ParserOptions::__construct
  • SessionProvider - comment
  • LoginSignupSpecialPage - writes to $wgUser
  • SpecialPageFactory - writes to $wgUser
  • (deprecated, old) SpecialPageFactory - should all be hard deprecated, see T245686
  • UploadFromUrl::isValidRequest
  • UploadStash::__construct falls back to $wgUser
  • User - comments
  • Language::userAdjust and ::dateFormat
  • LanguageConverter::getPreferredVariant
  • maintenance scripts writing to wgUser: cleanupSpam, deleteBatch, deleteDefaultMessages, deleteEqualMessages, edit, importImages, importSiteScripts, moveBatch, preprocessorFuzzTest, undelete

Tests

  • ParserTestRunner::perTestSetup writes to $wgUser
  • MediaWikiIntegrationTestCase
  • EditPageTest
  • RevisionDbTestBase (will be removed in T246411)
  • RevisionTest
  • ApiLogoutTest
  • ApiMainTest
  • ApiTestCase lots (::doLogin is hard deprecated, see T244039, T245332, T245355)
  • ApiUserrightsTest
  • CheckBlocksSecondaryAuthenticationProviderTest
  • CssContentTest
  • TextContentTest
  • RequestContextTest
  • ConverterRuleTest
  • LogFormatterTest
  • WikiPageDbTestBase
  • ParserOptionsTest
  • UploadStashTest
  • UserTest
  • LanguageConverterTest
  • DumpTestCase

Change 576194 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] UploadFromUrl: Remove redundant check of user perms in isValidRequest

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

Change 579097 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Tests: Remove unneeded uses of global $wgUser

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

Change 579097 merged by jenkins-bot:
[mediawiki/core@master] Tests: Remove unneeded uses of global $wgUser

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

Change 579799 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Don't declare global $wgUser unless needed

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

Change 579799 merged by jenkins-bot:
[mediawiki/core@master] WikiPageDbTestBase: Remove use of global $wgUser

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

Change 580160 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] ApiLogoutTest: Remove use of global $wgUser

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

Change 588161 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] LanguageConverterTest: Reduce direct references to $wgUser

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

Change 588161 merged by jenkins-bot:
[mediawiki/core@master] LanguageConverterTest: Reduce direct references to $wgUser

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

Change 593279 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] ParserOptionsTest: Rename non-global variable $wgUser

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

Change 593279 merged by jenkins-bot:
[mediawiki/core@master] ParserOptionsTest: Rename non-global variable $wgUser

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