From 6f993086c96383f8ed3cd1960d8d7f3074cdcd14 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Sat, 31 Jan 2015 12:02:23 -0500 Subject: [PATCH] CRM-15899 - Reports: "order by" can contain mismatched table aliases --- CRM/Report/Form.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 9314b1f1f0..d8bae48bde 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -2546,6 +2546,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND // For custom fields referenced in $this->_customGroupExtends $fields = CRM_Utils_Array::value('fields', $table, array()); } + else { + continue; + } if (!empty($fields) && is_array($fields)) { foreach ($fields as $fieldName => $field) { if ($fieldName == $orderBy['column']) { -- 2.25.1