Page MenuHomePhabricator

Make userOptions.php ready for temporary accounts
Closed, ResolvedPublic

Description

Running userOptions.php in beta yielded the following error:

InvalidArgumentException from line 429 of /srv/mediawiki/php-master/includes/user/Options/UserOptionsManager.php: MediaWiki\User\Options\UserOptionsManager::saveOptionsInternal was called on anon or temporary user                               
#0 /srv/mediawiki/php-master/includes/user/Options/UserOptionsManager.php(403): MediaWiki\User\Options\UserOptionsManager->saveOptionsInternal(Object(MediaWiki\User\UserIdentityValue), Object(Wikimedia\Rdbms\DBConnRef))                         
#1 /srv/mediawiki/php-master/maintenance/userOptions.php(219): MediaWiki\User\Options\UserOptionsManager->saveOptions(Object(MediaWiki\User\UserIdentityValue))                                                                                     
#2 /srv/mediawiki/php-master/maintenance/userOptions.php(76): UserOptionsMaintenance->updateOptions()
#3 /srv/mediawiki/php-master/maintenance/includes/MaintenanceRunner.php(698): UserOptionsMaintenance->execute()
#4 /srv/mediawiki/php-master/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#5 /srv/mediawiki/multiversion/MWScript.php(158): require_once('/srv/mediawiki/...')
#6 {main}

Event Timeline

Change 991290 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@master] userOptions: Do not crash on temporary accounts

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

Change 991290 merged by jenkins-bot:

[mediawiki/core@master] userOptions: Do not crash on temporary accounts

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