Page MenuHomePhabricator

Special:GlobalUserMerge fails horribly if the same user is specified as source and destination
Closed, ResolvedPublic

Description

@Keegan reports the following reproduction procedure:

  • Create three accounts: Test 8, Test 9 and Test 10.
  • Make one edit with Test 10
  • In Special:GlobalUserMerge, specify all three accounts in the "usernames" field. In the "new user" field, specify Test 8. Submit the form.

Then at Special:CentralAuth/Test_8, an exception is thrown:

Exception encountered, of type "Exception"
[c91625db] /wiki/Special:CentralAuth/Test_8 Exception from line 2116 of /srv/mediawiki/php-master/extensions/CentralAuth/includes/CentralAuthUser.php: Could not find local user data for Test 8@metawiki
Backtrace:
#0 /srv/mediawiki/php-master/extensions/CentralAuth/includes/CentralAuthUser.php(2056): CentralAuthUser->localUserData(string)
#1 /srv/mediawiki/php-master/extensions/CentralAuth/includes/specials/SpecialCentralAuth.php(94): CentralAuthUser->queryAttached()
#2 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(384): SpecialCentralAuth->execute(string)
#3 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(581): SpecialPage->run(string)
#4 /srv/mediawiki/php-master/includes/MediaWiki.php(267): SpecialPageFactory::executePath(Title, RequestContext)
#5 /srv/mediawiki/php-master/includes/MediaWiki.php(566): MediaWiki->performRequest()
#6 /srv/mediawiki/php-master/includes/MediaWiki.php(414): MediaWiki->main()
#7 /srv/mediawiki/php-master/index.php(46): MediaWiki->run()
#8 /srv/mediawiki/w/index.php(3): include(string)
#9 {main}

This is apparently because as MergeUser finishes merging Test 8 with itself, MergeUser::deleteUser() deletes the Test 8 row from the local user table.

The local equivalent special page, Special:UserMerge, has validation preventing the source from being the same as the destination, but Special:GlobalUserMerge lacks that validation.

Event Timeline

tstarling raised the priority of this task from to Needs Triage.
tstarling updated the task description. (Show Details)
tstarling added subscribers: tstarling, Keegan.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 15 2015, 6:53 AM
Aklapper triaged this task as Normal priority.Apr 15 2015, 4:39 PM
RobLa-WMF set Security to None.
RobLa-WMF added a subscriber: RobLa-WMF.

Change 207522 had a related patch set uploaded (by Legoktm):
GlobalUserMerge: Don't merge a user into themselves

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

Change 207522 merged by jenkins-bot:
GlobalUserMerge: Don't merge a user into themselves

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

Legoktm closed this task as Resolved.May 1 2015, 1:07 AM
Keegan moved this task from To-do to Done on the SUL-Finalization board.May 1 2015, 6:49 AM
Keegan moved this task from Backlog to Closed on the GlobalRename board.May 2 2015, 5:45 AM