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.wmcloud.org/core/?q=wgUser(%5B%3B%2C%27%22-%5D%7C%5Cs%7C%24)&i=nope&files=%5C.php%24&repos=

Details

ProjectBranchLines +/-Subject
mediawiki/coremaster+2 -2
mediawiki/coremaster+8 -4
mediawiki/coremaster+16 -4
mediawiki/coremaster+0 -3
mediawiki/coremaster+0 -1
mediawiki/coremaster+0 -1
mediawiki/coremaster+2 -2
mediawiki/coremaster+1 -1
mediawiki/coremaster+5 -4
mediawiki/coremaster+0 -1
mediawiki/coremaster+1 -24
mediawiki/coremaster+0 -1
mediawiki/coremaster+3 -3
mediawiki/coremaster+80 -96
mediawiki/coremaster+22 -23
mediawiki/coremaster+13 -0
mediawiki/coremaster+41 -64
mediawiki/coremaster+7 -5
mediawiki/coremaster+33 -26
mediawiki/coremaster+4 -5
mediawiki/coremaster+56 -41
mediawiki/coremaster+1 -3
mediawiki/coremaster+0 -11
mediawiki/coremaster+11 -12
mediawiki/coremaster+10 -6
Show related patches Customize query in gerrit

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenDannyS712
OpenNone
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
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenNone
OpenNone
DeclinedDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
InvalidNone
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedYaron_Koren
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedPRODUCTION ERRORcscott
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
Resolvedaaron
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
DeclinedPchelolo
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
ResolvedDannyS712
OpenDannyS712
StalledDannyS712
StalledDannyS712
OpenDannyS712
OpenDannyS712
OpenDannyS712
ResolvedDannyS712
OpenDannyS712
OpenDannyS712
ResolvedDannyS712
OpenDannyS712
OpenDannyS712
OpenDannyS712
OpenNone
OpenNone

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
DannyS712 triaged this task as Medium priority.Jan 26 2020, 9:55 AM
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

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

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

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

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

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

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

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

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

Change 603068 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Reduce direct uses of $wgUser in ApiQueryInfo's token methods

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

Change 603068 merged by jenkins-bot:
[mediawiki/core@master] Reduce direct uses of $wgUser in ApiQueryInfo's token methods

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

Change 609632 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Mark token methods in query apis as internal

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

Change 609632 abandoned by DannyS712:
[mediawiki/core@master] Mark token methods in query apis as internal

Reason:
since the hooks were removed, users can now be injected

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

Change 626246 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Remove uses of $wgUser in api token methods

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

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

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

Change 626246 merged by jenkins-bot:
[mediawiki/core@master] Remove uses of $wgUser in api token methods

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

Change 626897 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Reduce use of $wgUser in EditPageTest

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

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

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

Change 626899 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] RequestContextTest: No need to set $wgUser

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

Change 626898 merged by jenkins-bot:
[mediawiki/core@master] Remove use of $wgUser in ApiUserrightsTest

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

Change 626899 merged by jenkins-bot:
[mediawiki/core@master] RequestContextTest: No need to set $wgUser

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

Change 626905 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Remove outdated documentation from addNewUserLogEntry

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

Change 626905 merged by jenkins-bot:
[mediawiki/core@master] Remove User::addNewUserLogEntry

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

Change 627219 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Remove use of $wgUser from LogFormatterTest, unneeded

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

Change 627219 merged by jenkins-bot:
[mediawiki/core@master] Remove use of $wgUser from LogFormatterTest, unneeded

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

Change 626897 merged by jenkins-bot:
[mediawiki/core@master] Reduce use of $wgUser in EditPageTest

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

Change 627225 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] cleanupSpam - reduce direct references to $wgUser

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

Change 627225 merged by jenkins-bot:
[mediawiki/core@master] cleanupSpam - reduce direct references to $wgUser

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

DannyS712 updated the task description. (Show Details)Sep 15 2020, 3:21 AM

Change 627463 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] CheckBlocksSecondaryAuthenticationProviderTest: No need to set $wgUser

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

Change 627464 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] UserTest: No need to set $wgUser

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

Change 627465 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] EditPageTest: No need to set $wgUser

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

Change 627606 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] LanguageFi::translateBlockExpiry update $user docs

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

Change 627606 merged by jenkins-bot:
[mediawiki/core@master] Language::translateBlockExpiry update $user docs

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

Change 627463 merged by jenkins-bot:
[mediawiki/core@master] CheckBlocksSecondaryAuthenticationProviderTest: No need to set $wgUser

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

Change 627464 merged by jenkins-bot:
[mediawiki/core@master] UserTest: No need to set $wgUser

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

Change 627465 merged by jenkins-bot:
[mediawiki/core@master] EditPageTest: No need to set $wgUser

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

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

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

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

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

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

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

Change 633248 merged by jenkins-bot:
[mediawiki/core@master] Reduce some references to $wgUser

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