Page MenuHomePhabricator

Call to undefined method MediaWiki\Preferences\DefaultPreferencesFactory::setUser()
Closed, ResolvedPublic

Description

Hi, im getting "Error from line 42 of /srv/mediawiki/w/extensions/GlobalPreferences/includes/Hooks.php: Call to undefined method MediaWiki\Preferences\DefaultPreferencesFactory::setUser()".

https://github.com/wikimedia/mediawiki-extensions-GlobalPreferences/blob/master/includes/Hooks.php#L43

Im using MediaWiki 1.32 and php 7.2

See also: T238466: Deprecate GlobalPreferencesFactory::setUser() [medium]

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Paladox updated the task description. (Show Details)

Call stack/how to reproduce?

@MaxSem Ah sorry, here's the stack trace:

[9fdb2e34dc336cc4e699ba7a] [no req]   Error from line 42 of /srv/mediawiki/w/extensions/GlobalPreferences/includes/Hooks.php: Call to undefined method MediaWiki\Preferences\DefaultPreferencesFactory::setUser()
Backtrace:
#0 /srv/mediawiki/w/includes/Hooks.php(174): GlobalPreferences\Hooks::onUserLoadOptions(User, array)
#1 /srv/mediawiki/w/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#2 /srv/mediawiki/w/includes/user/User.php(5549): Hooks::run(string, array)
#3 /srv/mediawiki/w/includes/user/User.php(3168): User->loadOptions()
#4 /srv/mediawiki/w/includes/parser/ParserOptions.php(1182): User->getOption(string)
#5 /srv/mediawiki/w/includes/parser/ParserOptions.php(991): ParserOptions->initialiseFromUser(User, LanguageEn)
#6 /srv/mediawiki/w/includes/parser/ParserOptions.php(1029): ParserOptions->__construct(User, LanguageEn)
#7 /srv/mediawiki/w/includes/Storage/DerivedPageDataUpdater.php(776): ParserOptions::newFromUserAndLang(User, LanguageEn)
#8 /srv/mediawiki/w/includes/Storage/PageUpdater.php(676): MediaWiki\Storage\DerivedPageDataUpdater->prepareContent(User, MediaWiki\Storage\RevisionSlotsUpdate, boolean)
#9 /srv/mediawiki/w/includes/page/WikiPage.php(1887): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#10 /srv/mediawiki/w/extensions/Flow/maintenance/FlowCreateTemplates.php(114): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User)
#11 /srv/mediawiki/w/extensions/Flow/maintenance/FlowCreateTemplates.php(86): FlowCreateTemplates->create(Title, WikitextContent)
#12 /srv/mediawiki/w/maintenance/Maintenance.php(1698): FlowCreateTemplates->doDBUpdates()
#13 /srv/mediawiki/w/maintenance/update.php(215): LoggedUpdateMaintenance->execute()
#14 /srv/mediawiki/w/maintenance/doMaintenance.php(94): UpdateMediaWiki->execute()
#15 /srv/mediawiki/w/maintenance/update.php(248): require_once(string)
#16 {main}

Im not entirely sure how to reproduce as i copied one of our wiki's db into another wiki's db (i deleted it and recreated it) as i wanted to test MW 1.32 performance. But running update.php is reproducing that error at least on this wiki's db.

Niharika removed a project: Community-Tech.

This ticket is difficult to work on until we have a better idea of how to reproduce the issue.

This doesn't seem wider spread... Literally no other reports

I'm not saying it's invalid, but it seems very specific to this wiki (cluster).

Are you doing something weird with the services?

Krinkle raised the priority of this task from Low to High.EditedMar 4 2020, 2:42 AM
Krinkle added a subscriber: Krinkle.

Still seen from time to time and it is breaking the Jenkins jobs for mediawiki/core Gerrit commits.

https://integration.wikimedia.org/ci/job/wmf-quibble-selenium-php72-docker/23842/console

Error from line 290 of /workspace/src/extensions/GlobalPreferences/includes/Hooks.php: Call to undefined method MediaWiki\Preferences\DefaultPreferencesFactory::setUser()
Backtrace:
#0 /workspace/src/extensions/GlobalPreferences/includes/Hooks.php(43): GlobalPreferences\Hooks::getPreferencesFactory(User)
#1 /workspace/src/includes/Hooks.php(174): GlobalPreferences\Hooks::onUserLoadOptions(User, array)
#2 /workspace/src/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#3 /workspace/src/includes/user/User.php(5217): Hooks::run(string, array)
#4 /workspace/src/includes/user/User.php(2978): User->loadOptions()
#5 /workspace/src/includes/parser/ParserOptions.php(1177): User->getOption(string)
#6 /workspace/src/includes/parser/ParserOptions.php(986): ParserOptions->initialiseFromUser(User, LanguageEn)
#7 /workspace/src/includes/parser/ParserOptions.php(1024): ParserOptions->__construct(User, LanguageEn)
#8 /workspace/src/includes/Storage/DerivedPageDataUpdater.php(783): ParserOptions::newFromUserAndLang(User, LanguageEn)
#9 /workspace/src/includes/Storage/PageUpdater.php(704): MediaWiki\Storage\DerivedPageDataUpdater->prepareContent(User, MediaWiki\Storage\RevisionSlotsUpdate, boolean)
#10 /workspace/src/includes/page/WikiPage.php(1942): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#11 /workspace/src/extensions/Flow/maintenance/FlowCreateTemplates.php(116): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User)
#12 /workspace/src/extensions/Flow/maintenance/FlowCreateTemplates.php(88): FlowCreateTemplates->create(Title, WikitextContent)
#13 /workspace/src/maintenance/Maintenance.php(1759): FlowCreateTemplates->doDBUpdates()
#14 /workspace/src/maintenance/update.php(209): LoggedUpdateMaintenance->execute()
#15 /workspace/src/maintenance/doMaintenance.php(99): UpdateMediaWiki->execute()
#16 /workspace/src/maintenance/update.php(270): require_once(string)
2020-04-06T23:02:13 snapshot1008  /srv/mediawiki/multiversion/MWScript.php maintenance/sql.php --wiki wikidatawiki --json --query SELECT MAX(page_id) AS max_page_id FROM page


Fatal error: Call to undefined method MediaWiki\Preferences\DefaultPreferencesFactory::setUser()
Krinkle claimed this task.