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

CustomValue CREATE API 3 - wrong param order

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.7
    • Fix Version/s: 3.4.8
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      civicrm_api3_custom_value_create calls CRM_Core_BAO_CustomField::getCustomFieldID($i, $n) to get custom field ID (line 92).
      $i - supposed to be group name
      $n - field name

      getCustomFieldID accepts parameters in this order: $fieldName, $groupName.

      Solution - call the method with parementers with reversed order:
      // Lookup names if ID was not supplied
      $key = CRM_Core_BAO_CustomField::getCustomFieldID($n, $i);

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              matuszemi Matus Zeman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5 minutes
                5m
                Remaining:
                Remaining Estimate - 5 minutes
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified