From: Brad Jorsch Date: Tue, 5 May 2015 20:16:05 +0000 (-0400) Subject: API: Ignore META_BC_SUBELEMENTS elements that aren't actually set X-Git-Tag: 1.31.0-rc.0~11305^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=0e61e0edd2758956ece0d373de94908094dd4594;p=lhc%2Fweb%2Fwiklou.git API: Ignore META_BC_SUBELEMENTS elements that aren't actually set Shouldn't happen, but if it does let's not log a bunch of warnings. Bug: T98185 Change-Id: I7e626ab2c829633a84f3db0358080011baf5d9f2 --- diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index 044b6e067c..7c573a8f75 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -832,11 +832,13 @@ class ApiResult implements ApiSerializable { isset( $metadata[self::META_BC_SUBELEMENTS] ) ) { foreach ( $metadata[self::META_BC_SUBELEMENTS] as $k ) { - $data[$k] = array( - '*' => $data[$k], - self::META_CONTENT => '*', - self::META_TYPE => 'assoc', - ); + if ( isset( $data[$k] ) ) { + $data[$k] = array( + '*' => $data[$k], + self::META_CONTENT => '*', + self::META_TYPE => 'assoc', + ); + } } }