Details
-
Type: Patch
-
Status: Open
-
Priority: Trivial
-
Resolution: Unresolved
-
Affects Version/s: 4.4.5
-
Fix Version/s: Unscheduled
-
Component/s: CiviCRM API
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
Description
New warnings in PHP 5.5 gives spurious messages in logfiles:
PHP Warning: Invalid argument supplied for foreach() in /administrator/components/com_civicrm/civicrm/api/v3/Domain.php on line 59
Simple fix. Change lines 59 from:
$domains = _civicrm_api3_dao_to_array($bao, $params, true,'domain');
foreach ($domains as $domain) {
to
$domains = _civicrm_api3_dao_to_array($bao, $params, true,'domain');
foreach ((array)$domains as $domain) {
Better idea could be for _civicrm_api3_dao_to_array to return an array and not a false on empty domains.
A check could be made for similar functions also.