Fixed display when non-default view is selected

This commit is contained in:
CiviWare Solutions 2018-12-12 14:38:16 +00:00
parent 2419a5752e
commit 425d0431c5
2 changed files with 11 additions and 5 deletions

View File

@ -171,14 +171,19 @@ class CRM_ConstituentsOnly_BAO_ConstituentsOnly {
}
}
if (in_array($url, ['civicrm/contact/search/builder']) || !empty($request['uf_group_id'])) {
foreach ($headers as $header) {
if (!empty($header['sort'])) {
$returnProperties[$header['sort']] = 1;
$returnProperties = CRM_Core_Session::singleton()->get('return_properties_search');
if (!empty($returnProperties)) {
foreach ($headers as $header) {
if (!empty($header['sort'])) {
$headerName = str_replace('`', '', $header['sort']);
$returnProperties[$headerName] = 1;
}
}
$returnProperties['contact_sub_type'] = 1;
$returnProperties['contact_type'] = 1;
}
$returnProperties['contact_sub_type'] = 1;
$returnProperties['contact_type'] = 1;
}
$queryParams = CRM_Contact_BAO_Query::convertFormValues($formValues);
$selector = new CRM_Contact_Selector(
'',

View File

@ -13,6 +13,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface {
*
*/
public function select(&$query) {
CRM_Core_Session::singleton()->set('return_properties_search', $query->_returnProperties);
// hack for profile search
$url = CRM_Utils_Array::value('q', $_GET);
if (in_array($url, ['civicrm/profile', 'civicrm/contact/search/builder'])) {