Last modified: 2012-10-19 04:18:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T43198, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41198 - "Invalid argument supplied for foreach" in User::saveOptions() during automatic account creation
"Invalid argument supplied for foreach" in User::saveOptions() during automat...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User login and signup (Other open bugs)
1.21.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 41175 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-19 02:54 UTC by Tim Starling
Modified: 2012-10-19 04:18 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Starling 2012-10-19 02:54:53 UTC
Since 1.21wmf2 we are logging "invalid argument supplied for foreach" errors in User::saveOptions(). Debugging on the live site indicates that this is caused by interaction between a recent change to CentralAuth (I92f57fc2) a long-standing bug in User::clearInstanceCache(), and AbuseFilter #18 on en.wikibooks.org.

User::clearInstanceCache() clears $this->mOptions but does not set $this->mOptionsLoaded to false, as would be expected for a cache clear. It is called by addToDatabase(). This is not normally a problem for CentralAuth:: attemptAddUser() since it calls User::loadDefaults() before it calls addToDatabase(), and loadDefaults() does set $this->mOptionsLoaded to false.

I92f57fc2 rearranged the calling sequence so that the AbortAutoAccount hook is called in between the loadDefaults() call and the addToDatabase() call. When an AbortAutoAccount hook function then loads the user options for some reason, the invalid state is created and User::addToDatabase() generates the warning.

AF #18 on en.wikibooks.org loads the user options when AbuseFilter::executeFilterActions() calls $wgOut->parseInline(), which constructs a ParserOptions object.
Comment 1 Andre Klapper 2012-10-19 03:01:34 UTC
Dup of bug 41175? However this one has a perfect analysis that I'd love to see copied to 41175 in case I'm correct. :)
Comment 2 Tim Starling 2012-10-19 04:16:58 UTC
*** Bug 41175 has been marked as a duplicate of this bug. ***
Comment 3 Tim Starling 2012-10-19 04:18:16 UTC
Fixed in https://gerrit.wikimedia.org/r/#/c/28659/ and deployed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links