There are so few calls it should be pretty simple to move the $user parameter to first, since all of the parameters are currently optional. Alternatively, would it be clearer/easier to create ::undeleteAsUser and deprecate calling ::undelete?
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T11968 Reduce use of global and public variables | |||
Open | None | T159283 Deprecate non-configuration globals | |||
Open | DannyS712 | T159299 Deprecate and remove $wgUser | |||
Resolved | DannyS712 | T267861 [GOAL] Emit deprecation warnings reading from $wgUser | |||
Open | DannyS712 | T243708 Mediawiki core needs uses of global $wgUser removed | |||
Resolved | DannyS712 | T242935 Deprecate core fallbacks to $wgUser | |||
Resolved | DannyS712 | T247188 PageArchive::undelete falls back to $wgUser |
Event Timeline
Tagging CPT to review which method of requiring a user would be better (moving the parameter to 1st or a new method)
PageArchive::undelete is used by several extensions. A breaking change to the method signature is not advisable. Eventually, the entire class should probably be turned into a service.
Introducing undeleteAsUser and (soft-)deprecating the old undelete method seems like the smoothest transition, though it leaves us with a clunky method name. The alternative is to wait until we turn the entire class into a service.
I'm going to go with undeleteAsUser:
- Introduce new method, soft deprecate old
- Replace deployed uses
- Hard deprecate ::undelete
- Replace remaining uses
- Remove
I'm going to try to get through hard deprecation before 1.35 is cut
Change 580984 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Introduce PageArchive::undeleteAsUser, soft deprecate ::undelete
Change 580984 merged by jenkins-bot:
[mediawiki/core@master] Introduce PageArchive::undeleteAsUser, soft deprecate ::undelete
Code search: https://codesearch.wmflabs.org/search/?q=-%3Eundelete%5C(&i=nope&files=&repos=
For extensions that support multiple versions, can use: if ( method_exists( $pageArchive, 'undeleteAsUser' ) ) { to branch
Change 581026 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Make use of PageArchive::undeleteAsUser
Change 581029 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Cognate@master] Make use of PageArchive::undeleteAsUser when possible
Change 581030 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/CreatedPagesList@master] Make use of PageArchive::undeleteAsUser when possible
Change 581034 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/PhpTagsStorage@master] Make use of PageArchive::undeleteAsUser when possible
Change 581037 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Video@master] Make use of PageArchive::undeleteAsUser when possible
Patches submitted for all extensions, but only core and cognate need to be updated before hard deprecation can occur
Change 581029 merged by jenkins-bot:
[mediawiki/extensions/Cognate@master] Make use of PageArchive::undeleteAsUser when possible
Change 581030 merged by jenkins-bot:
[mediawiki/extensions/CreatedPagesList@master] Make use of PageArchive::undeleteAsUser when possible
Change 581026 merged by jenkins-bot:
[mediawiki/core@master] Make use of PageArchive::undeleteAsUser
Change 581608 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Hard deprecate PageArchive::undelete
Change 581037 merged by jenkins-bot:
[mediawiki/extensions/Video@master] Make use of PageArchive::undeleteAsUser when possible
@Pchelolo the core hard deprecation should be ready to go, since PhpTagsStorage isn't deployed (isn't merging because of unrelated test failures). Can you merge it so that it can then be removed in 1.36? Thanks
Change 581608 merged by jenkins-bot:
[mediawiki/core@master] Hard deprecate PageArchive::undelete
Change 581034 merged by Ppchelko:
[mediawiki/extensions/PhpTagsStorage@master] Make use of PageArchive::undeleteAsUser when possible