Page MenuHomePhabricator

Use of SpecialBlock::canBlockEmail was deprecated in MediaWiki 1.36. [Called from SpecialCheckUser::getBlockForm]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.13

message
Use of SpecialBlock::canBlockEmail was deprecated in MediaWiki 1.36. [Called from SpecialCheckUser::getBlockForm]

Impact

Logspam obscuring other work.

Notes

Details

Request ID
5288ea95-5ad6-4c2e-8434-5b2079b49202
Request URL
https://login.wikimedia.org/wiki/Special:CheckUser
Stack Trace
exception.trace
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /srv/mediawiki/php-1.36.0-wmf.13/includes/debug/MWDebug.php(329): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.36.0-wmf.13/includes/debug/MWDebug.php(305): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /srv/mediawiki/php-1.36.0-wmf.13/includes/debug/MWDebug.php(234): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /srv/mediawiki/php-1.36.0-wmf.13/includes/GlobalFunctions.php(1029): MWDebug::deprecated(string, string, string, integer)
#5 /srv/mediawiki/php-1.36.0-wmf.13/includes/specials/SpecialBlock.php(960): wfDeprecated(string, string)
#6 /srv/mediawiki/php-1.36.0-wmf.13/extensions/CheckUser/includes/specials/SpecialCheckUser.php(1635): SpecialBlock::canBlockEmail(User)
#7 /srv/mediawiki/php-1.36.0-wmf.13/extensions/CheckUser/includes/specials/SpecialCheckUser.php(1574): SpecialCheckUser->getBlockForm(string, string)
#8 /srv/mediawiki/php-1.36.0-wmf.13/extensions/CheckUser/includes/specials/SpecialCheckUser.php(1228): SpecialCheckUser->doIPUsersRequestOutput(Wikimedia\Rdbms\ResultWrapper, string, boolean, string, string)
#9 /srv/mediawiki/php-1.36.0-wmf.13/extensions/CheckUser/includes/specials/SpecialCheckUser.php(144): SpecialCheckUser->doIPUsersRequest(string, boolean, integer, string, string)
#10 /srv/mediawiki/php-1.36.0-wmf.13/includes/specialpage/SpecialPage.php(600): SpecialCheckUser->execute(NULL)
#11 /srv/mediawiki/php-1.36.0-wmf.13/includes/specialpage/SpecialPageFactory.php(837): SpecialPage->run(NULL)
#12 /srv/mediawiki/php-1.36.0-wmf.13/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#13 /srv/mediawiki/php-1.36.0-wmf.13/includes/MediaWiki.php(940): MediaWiki->performRequest()
#14 /srv/mediawiki/php-1.36.0-wmf.13/includes/MediaWiki.php(543): MediaWiki->main()
#15 /srv/mediawiki/php-1.36.0-wmf.13/index.php(53): MediaWiki->run()
#16 /srv/mediawiki/php-1.36.0-wmf.13/index.php(46): wfIndexMain()
#17 /srv/mediawiki/w/index.php(3): require(string)
#18 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 14 2020, 10:25 PM
Reedy added a subscriber: Reedy.Oct 15 2020, 12:59 AM

Caused by T189073: Refactor logic for creating and logging a block out of SpecialBlock so it can be easily reused elsewhere / rMWd1784d139a29: Hard deprecate SpecialBlock::canBlockEmail

There's two usages of SpecialBlock::canBlockEmail in CheckUser (so one other than the report)

Method
    canBlockEmail
Found usages  (2 usages found)
    Method call  (2 usages found)
        mediawiki  (2 usages found)
            mediawiki/extensions/CheckUser/includes/specials  (2 usages found)
                SpecialCheckUser.php  (2 usages found)
                    364 SpecialBlock::canBlockEmail( $this->getUser() ) ||
                    1635 if ( SpecialBlock::canBlockEmail( $this->getUser() ) ) {

Sorry I missed those before merging
@Urbanecm has a patch at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CheckUser/+/628506 that would replace the uses, or would it be easier to just revert for now?

Thanks for pointing out that patch. I'm inclined to think we should revert the hard deprecations, and re-apply them in 1.37.

The policy does allow for hard deprecating in the same version as soft deprecating, but during the reorganization of the Block-related classes, we have tended to soft deprecate first, then hard deprecate one version later. This gives third parties some warning via the release notes before they are subjected to the warnings. When the deprecated methods simply call the new methods and require almost no maintenance, it seems like a helpful thing to do.

Change 634100 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/core@master] Revert "Hard deprecate SpecialBlock::canBlockEmail"

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

Restricted Application added a project: User-Urbanecm. · View Herald TranscriptOct 15 2020, 12:08 PM

Change 634100 merged by jenkins-bot:
[mediawiki/core@master] Revert "Hard deprecate SpecialBlock::canBlockEmail"

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

Urbanecm closed this task as Resolved.Oct 21 2020, 7:15 AM

Deprecation reverted, replacing usage to be solved at T263334