User: Allow newSystemUser() to create over anonymous actors
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 28 Oct 2019 15:51:05 +0000 (11:51 -0400)
committerReedy <reedy@wikimedia.org>
Mon, 23 Dec 2019 19:22:02 +0000 (19:22 +0000)
commitf3bdd2f4a1796c95490796a521f0d31f4a4ee9af
tree315eb436909aaaa6a1a91b930498c125452b81d1
parent476413e2ee9486e1b8c692e48f672ea67e44f4e5
User: Allow newSystemUser() to create over anonymous actors

Various maintenance scripts assume reserved usernames like
"MediaWiki default" exist, but since they're reserved
User::isUsableName() returns false and therefore the actor migration
created them as anonymous actors. Which would then prevent those
maintenance scripts from using User::newSystemUser() to ensure they
actually exist.

This adjusts User::newSystemUser() to be able to create users for
those anonymous actors.

This also adjusts uses of "MediaWiki default" in core to create it as a
system user.

Bug: T236444
Change-Id: I59a646df36ff9343cc43c05aa20b2b69b2ee124a
(cherry picked from commit 685b505628099a027ab5c9451502f522b489c109)
includes/installer/Installer.php
includes/user/User.php
maintenance/deleteDefaultMessages.php
tests/phpunit/includes/user/UserTest.php