* Delete custom value.
*/
public static function deleteCustomValue() {
- header('Content-Type: text/plain');
+ CRM_Utils_System::setHttpHeader('Content-Type', 'text/plain');
$customValueID = CRM_Utils_Type::escape($_REQUEST['valueID'], 'Positive');
$customGroupID = CRM_Utils_Type::escape($_REQUEST['groupID'], 'Positive');
-
+ $contactId = CRM_Utils_Request::retrieve('contactId', 'Positive', CRM_Core_DAO::$_nullObject);
CRM_Core_BAO_CustomValue::deleteCustomValue($customValueID, $customGroupID);
- $contactId = CRM_Utils_Array::value('contactId', $_REQUEST);
if ($contactId) {
- echo CRM_Contact_BAO_Contact::getCountComponent('custom_' . $_REQUEST['groupID'], $contactId);
+ echo CRM_Contact_BAO_Contact::getCountComponent('custom_' . $customGroupID, $contactId);
}
// reset the group contact cache for this group