Skip to content
Snippets Groups Projects
Unverified Commit e5c67186 authored by mattwire's avatar mattwire Committed by GitHub
Browse files

Merge pull request #18651 from eileenmcnaughton/cf

[REF] Minor simplification - don't use a variable for table name
parents 97c29aa2 84ad04e8
No related branches found
No related tags found
No related merge requests found
......@@ -365,7 +365,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
$fields = Civi::Cache('fields')->get("custom importableFields $cacheKey");
if ($fields === NULL) {
$cfTable = self::getTableName();
$extends = '';
if (is_array($customDataType)) {
......@@ -398,37 +397,37 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
// 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) {
......@@ -465,7 +464,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
$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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment