Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14926

Spurious messages in logfiles with PHP 5.5

    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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ylavoie Yves Lavoie
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 1 minute
                1m
                Remaining:
                Remaining Estimate - 1 minute
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified