}
$field = $this->_fields[$elementName] ?? NULL;
+ if (isset($this->_pseudoConstantsSelect[$field['name']])) {
+ $this->_pseudoConstantsSelect[$name . '-' . $field['name']] = $this->_pseudoConstantsSelect[$field['name']];
+ }
// hack for profile, add location id
if (!$field) {
}
if (!$likeNames) {
- $likeNames = ['sort_name', 'first_name', 'last_name', 'email', 'note', 'display_name'];
+ $likeNames = ['sort_name', 'email', 'note', 'display_name'];
}
// email comes in via advanced search
$name, $op, $value, $grouping,
'CRM_Contact_DAO_Contact',
$field,
- $field['title'],
+ $field['html']['label'] ?? $field['title'],
CRM_Utils_Type::typeToString($dataType)
);
if ($name === 'gender_id') {
$sqlParts = $this->getSearchSQLParts(NULL, NULL, NULL, FALSE, FALSE, TRUE);
$query = "SELECT DISTINCT LEFT(contact_a.sort_name, 1) as sort_name
{$sqlParts['from']}
- {$sqlParts['where']}
- {$sqlParts['having']}
- GROUP BY sort_name
- ORDER BY sort_name asc";
+ {$sqlParts['where']}";
$dao = CRM_Core_DAO::executeQuery($query);
return $dao;
}
return $field;
}
+ /**
+ * Get the field datatype, using the type in the database rather than the pseudofield, if a pseudofield.
+ *
+ * @param string $fieldName
+ *
+ * @return string
+ */
+ public function getDataTypeForRealField($fieldName) {
+ return CRM_Utils_Type::typeToString($this->getMetadataForRealField($fieldName)['type']);
+ }
+
/**
* If we have a field that is better rendered via the pseudoconstant handled them here.
*