[REF] Apply fix for CRM-607 for when building the select section of the query as...
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 26 Feb 2020 02:02:04 +0000 (13:02 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 26 Feb 2020 02:02:04 +0000 (13:02 +1100)
CRM/Core/BAO/CustomQuery.php

index 7e60838cba79da9ac82391149f9ab39a4aa935de..737b4b180c09be8a993d16fcd903a87a4893a07d 100644 (file)
@@ -198,6 +198,10 @@ SELECT f.id, f.label, f.data_type,
     }
 
     foreach (array_keys($this->_ids) as $id) {
+      // Ignore any custom field ids within the ids array that are not present in the fields array.
+      if (empty($this->_fields[$id])) {
+        continue;
+      }
       $field = $this->_fields[$id];
 
       if ($this->_contactSearch && $field['search_table'] === 'contact_a') {