// check that this is a valid, active custom field of Contact Reference type
$params = array('id' => $cfID);
$returnProperties = array('filter', 'data_type', 'is_active');
- $fldValues = array();
+ $fldValues = $cf = array();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $cf, $returnProperties);
if (!$cf['id'] || !$cf['is_active'] || $cf['data_type'] = !'ContactReference') {
echo "$name|error\n";
CRM_Utils_System::civiExit();
}
- if ($cf['filter']) {
+ if (!empty($cf['filter'])) {
$filterParams = array();
parse_str($cf['filter'], $filterParams);
$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
$offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
$rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
- $sort = isset($_REQUEST['iSortCol_0']) ? $sortMapper[CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer')] : 'sort_name';
+ $sort = 'sort_name';
$sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
$gid = isset($_REQUEST['gid']) ? CRM_Utils_Type::escape($_REQUEST['gid'], 'Integer') : 0;