CRM-8121 API v3 option_value_create() fails - does not pass sufficient arguments to core

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.1
    • Fix Version/s: 3.4.2
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      API v3 option_value_create is called, the core method (CRM_Core_BAO_OptionValue::add) throws an error as it does not receive the correct number of parameters.

      CRM_Core_BAO_OptionValue::add requires both $params and $ids, but only $params is passed by the API. There is very little information available as to what the $ids array is supposed to be contain, and so proposing a patch is difficult.

      I do note that the CRM_Core_BAO_CustomField does not call this particular method, but prefers CRM_Core_BAO_OptionValue::save. However, it is important that this call works for both creation and updates via the API.

        Attachments

          Activity

          [CRM-8121] API v3 option_value_create() fails - does not pass sufficient arguments to core
          Tom Gillett added a comment -

          The following patch (inspired by eileen) seems to resolve the issue.

            People

            • Assignee:
              Donald A. Lobo
              Reporter:
              Tom Gillett

              Dates

              • Created:
                Updated:
                Resolved: