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

test should include isset in API contact.php

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.4.0
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      I get a php warning when importing contacts.
      It's due to line 501 of civicrm/api/v3/Contact.php.

      This is the original code:

      $customValue = $params['contact_id'] ? CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
      $params['contact_id'],
      "{$key}{$greeting}_custom"
      ) : FALSE;

      adding an isset() removes the php warning:

      $customValue = isset($params['contact_id']) ? CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
      $params['contact_id'],
      "{$key}{$greeting}_custom"
      ) : FALSE;

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              alainb Alain Benbassat
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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