Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.0, 4.4.0
-
Fix Version/s: 4.4.3
-
Component/s: None
-
Labels:None
Description
using api call :
// i want to disable option value with id = 2
$result = civicrm_api3('option_value', 'create', array('id' => 2, 'is_active' => 0));
throws :
CiviCRM_API3_Exception: A fatal error was triggered in civicrm_api3() (line 254 of /home/pratik/git/v44/api/api.php).
This fatal error is raised due to not passing the option_group_id to params used to update a option value.
Raised from here - CRM_Core_BAO_OptionValue::add() function line 201 :
$groupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
$params['option_group_id'], 'name', 'id'
);