Last modified: 2014-06-21 19:58:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 44907 - ResourceLoader: Invalid argument supplied for foreach
ResourceLoader: Invalid argument supplied for foreach
Status: NEW
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2013-02-12 15:51 UTC by Sam Reed (reedy)
Modified: 2014-06-21 19:58 UTC (History)
6 users (show)

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


Attachments

Description Sam Reed (reedy) 2013-02-12 15:51:51 UTC
Warning:  Invalid argument supplied for foreach() in /usr/local/apache/common-local/php-1.21wmf9/includes/resourceloader/ResourceLoaderWikiModule.php on line 225
Comment 1 Krinkle 2013-02-13 23:31:15 UTC
--- class ResourceLoaderWikiModule
--- protected function getTitleMtimes
		if ( !$batch->isEmpty() ) {
			$res = $dbr->select( 'page',
				array( 'page_namespace', 'page_title', 'page_touched' ),
				$batch->constructSet( 'page', $dbr ),
				__METHOD__
			);
			foreach ( $res as $row ) {
Comment 2 Umherirrender 2013-03-22 20:06:32 UTC
Database::select
	 * @return ResultWrapper. If the query returned no rows, a ResultWrapper
	 *   with no rows in it will be returned. If there was a query error, a
	 *   DBQueryError exception will be thrown, except if the "ignore errors"
	 *   option was set, in which case false will be returned.


Someone leaks the ignore error option here?
Comment 3 Tyler Romeo 2013-04-09 18:06:05 UTC
So I did a quick grep on the core, and $db->ignoreErrors() is not called anywhere. The function is literally unused. The only reason I can think of for this error occurring is if DBO_IGNORE is set in the flags for starting the database connection.

On that note, is it really sane to be returning false from $dbr->select()? If the ignore errors flag was set, it means the caller doesn't give a damn about errors whatsoever. I feel like the correct behavior would be to return some sort of empty fake result wrapper.
Comment 4 Mark A. Hershberger 2014-06-21 19:58:01 UTC
Removing target milestone that was in the past.

If you want this in a specific release, have a good reason AND you are willing to find resources to fix this bug, feel free to change it to something appropriate.

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


Navigation
Links