Page MenuHomePhabricator

WebRequest::getLimitOffset should accept a user
Closed, ResolvedPublic

Description

Currently, WebRequest::getLimitOffset accepts an optional default limit, and an optional option name, as parameters.
There should be a user parameter accepted, and eventually, required, for accessing user preferences.
To clarify that the function gets the limit and offset for a specific user, I suggest:

  • Create WebRequest::getLimitOffsetForUser
    • Which requires a user to be passed to get the user preference for an option
  • Convert WebRequest::getLimitOffset to a wrapper that simple uses $wgUser
  • Replace uses of ::getLimitOffset with ::getLimitOffsetForUser, supplying a user, since whether its needed or not depends on unknown user input
  • Deprecate ::getLimitOffset

Deployed uses of getLimitOffset:
https://codesearch.wmflabs.org/deployed/?q=getLimitOffset%5C(&i=nope&files=&repos=

Event Timeline

Restricted Application added a project: User-DannyS712. · View Herald TranscriptJan 28 2020, 12:27 AM

Change 567528 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add WebRequest::getLimitOffsetForUser to replace ::getLimitOffset

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

DannyS712 updated the task description. (Show Details)Jan 28 2020, 12:33 AM
DannyS712 updated the task description. (Show Details)Jan 28 2020, 12:40 AM

Change 567528 merged by jenkins-bot:
[mediawiki/core@master] Add WebRequest::getLimitOffsetForUser to replace ::getLimitOffset

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

Restricted Application added projects: Growth-Team, Wikidata. · View Herald TranscriptFeb 19 2020, 12:39 AM

Change 573027 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/CentralNotice@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

Change 573029 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Flow@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

Change 573030 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/ProofreadPage@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

Change 573031 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Wikibase@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

Change 573033 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

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

Change 573030 merged by jenkins-bot:
[mediawiki/extensions/ProofreadPage@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

Change 573033 merged by jenkins-bot:
[mediawiki/core@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

DannyS712 updated the task description. (Show Details)Feb 19 2020, 1:37 AM

Change 573027 merged by jenkins-bot:
[mediawiki/extensions/CentralNotice@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

DannyS712 updated the task description. (Show Details)Feb 19 2020, 5:40 AM

Change 573068 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Deprecate WebRequest::getLimitOffset

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

DannyS712 updated the task description. (Show Details)Feb 19 2020, 5:44 AM

Change 573031 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

Change 573029 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser

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

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

Change 573068 merged by jenkins-bot:
[mediawiki/core@master] Hard deprecate WebRequest::getLimitOffset

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

DannyS712 closed this task as Resolved.Feb 20 2020, 8:45 PM
DannyS712 updated the task description. (Show Details)