Page MenuHomePhabricator

SqlBagOStuff.php on line 232 / Invalid argument supplied for foreach()
Closed, ResolvedPublic

Description

Error

PHP Warning: Invalid argument supplied for foreach() in /home/travis/build/wikimedia/phase3/includes/objectcache/SqlBagOStuff.php on line 232

Cause (line 232)

$res = $db->select( ...) causes a fatal when the select returns a boolean (because DatabaseBase::resultObject is allowed to return a boolean) instead of a ResultWrapper, $res isn't checked and immediately used as input for the succeeding foreach ( $res as $row ) call.

MediaWiki 1.23alpha, other details can be looked up using the attached travis-log.


Version: 1.23.0
Severity: normal
URL: https://s3.amazonaws.com/archive.travis-ci.org/jobs/13455252/log.txt

Details

Reference
bz56661

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:11 AM
bzimport set Reference to bz56661.
bzimport added a subscriber: Unknown Object (MLST).

The question is, why a database error occurs, which will result in a false as return value. See also bug 56909

(In reply to Umherirrender from comment #2)

Maybe fixed by Gerrit change #141619

Now merged, should be fixed.