Skip to content
Snippets Groups Projects
Commit c6ff5b0d authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

fixes notes display for search builder CRM-11790

parent f06c4974
Branches
Tags
No related merge requests found
......@@ -578,12 +578,10 @@ class CRM_Contact_BAO_Query {
* @access public
*/
function selectClause() {
$properties = array();
$this->addSpecialFields();
foreach ($this->_fields as $name => $field) {
// skip component fields
// there are done by the alter query below
// and need not be done on every field
......@@ -607,14 +605,27 @@ class CRM_Contact_BAO_Query {
continue;
}
//special handling for groups/tags
// make an exception for special cases, to add the field in select clause
$makeException = FALSE;
if (in_array($name, array('groups', 'tags'))
//special handling for groups/tags
if (in_array($name, array('groups', 'tags', 'notes'))
&& isset($this->_returnProperties[substr($name, 0, -1)])
) {
$makeException = TRUE;
}
// since note has 3 different options we need special handling
// note / note_subject / note_body
if ($name == 'notes') {
foreach (array('note', 'note_subject', 'note_body') as $noteField) {
if (isset($this->_returnProperties[$noteField])) {
$makeException = TRUE;
break;
}
}
}
$cfID = CRM_Core_BAO_CustomField::getKeyID($name);
if (
CRM_Utils_Array::value($name, $this->_paramLookup) ||
......
......@@ -1073,9 +1073,16 @@ SELECT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', contact_a.dis
$properties = array();
foreach ($returnProperties as $name => $value) {
if ($name != 'location') {
// special handling for group and tag
if (in_array($name, array('group', 'tag'))) {
$name = "{$name}s";
}
// special handling for notes
if (in_array($name, array('note', 'note_subject', 'note_body'))) {
$name = "notes";
}
$properties[] = $name;
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment