$fields = Civi::Cache('fields')->get("custom importableFields $cacheKey");
if ($fields === NULL) {
- $cfTable = self::getTableName();
$extends = '';
if (is_array($customDataType)) {
// Temporary hack - in 5.27 a new field is added to civicrm_custom_field. There is a high
// risk this function is called before the upgrade page can be reached and if
// so it will potentially result in fatal error.
- $serializeField = CRM_Core_BAO_Domain::isDBVersionAtLeast('5.27.alpha1') ? "$cfTable.serialize," : '';
+ $serializeField = CRM_Core_BAO_Domain::isDBVersionAtLeast('5.27.alpha1') ? "custom_field.serialize," : '';
- $query = "SELECT $cfTable.id, $cfTable.label,
+ $query = "SELECT custom_field.id, custom_field.label,
$cgTable.title,
- $cfTable.data_type,
- $cfTable.html_type,
- $cfTable.default_value,
- $cfTable.options_per_line, $cfTable.text_length,
- $cfTable.custom_group_id,
- $cfTable.is_required,
- $cfTable.column_name,
- $cgTable.extends, $cfTable.is_search_range,
+ custom_field.data_type,
+ custom_field.html_type,
+ custom_field.default_value,
+ custom_field.options_per_line, custom_field.text_length,
+ custom_field.custom_group_id,
+ custom_field.is_required,
+ custom_field.column_name,
+ $cgTable.extends, custom_field.is_search_range,
$cgTable.extends_entity_column_value,
$cgTable.extends_entity_column_id,
- $cfTable.is_view,
- $cfTable.option_group_id,
- $cfTable.date_format,
- $cfTable.time_format,
+ custom_field.is_view,
+ custom_field.option_group_id,
+ custom_field.date_format,
+ custom_field.time_format,
$cgTable.is_multiple,
$serializeField
$cgTable.table_name,
og.name as option_group_name
- FROM $cfTable
+ FROM civicrm_custom_field custom_field
INNER JOIN $cgTable
- ON $cfTable.custom_group_id = $cgTable.id
+ ON custom_field.custom_group_id = $cgTable.id
LEFT JOIN civicrm_option_group og
- ON $cfTable.option_group_id = og.id
+ ON custom_field.option_group_id = og.id
WHERE ( 1 ) ";
if (!$showAll) {
- $query .= " AND $cfTable.is_active = 1 AND $cgTable.is_active = 1 ";
+ $query .= " AND custom_field.is_active = 1 AND $cgTable.is_active = 1 ";
}
if ($inline) {
$query .= " $extends AND $permissionClause
ORDER BY $cgTable.weight, $cgTable.title,
- $cfTable.weight, $cfTable.label";
+ custom_field.weight, custom_field.label";
$dao = CRM_Core_DAO::executeQuery($query);