From: Coleman Watts Date: Sat, 9 Mar 2013 00:07:08 +0000 (-0800) Subject: Fix broken subtype icon CRM-12054 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2bbddafc944647551ddbda88ad24952cb51cd672;p=civicrm-core.git Fix broken subtype icon CRM-12054 --- diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 02311baf6b..33c00616c7 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -752,7 +752,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se $result->contact_id ); - $row['contact_type_orig'] = $result->contact_type; + $row['contact_type_orig'] = $result->contact_sub_type ? $result->contact_sub_type : $result->contact_type; $row['contact_sub_type'] = $result->contact_sub_type ? CRM_Contact_BAO_ContactType::contactTypePairs(FALSE, $result->contact_sub_type, ', ') : $result->contact_sub_type; $row['contact_id'] = $result->contact_id; @@ -861,16 +861,8 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se // allow components to add more actions CRM_Core_Component::searchAction($row, $row['contact_id']); - $contactType = null; - if ( CRM_Utils_Array::value('contact_sub_type', $row) ) { - $contactType = $row['contact_sub_type']; - } - elseif ( CRM_Utils_Array::value('contact_type_orig', $row) ) { - $contactType = $row['contact_type_orig']; - } - - if ( $contactType ) { - $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($contactType, + if (!empty($row['contact_type_orig'])) { + $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($row['contact_type_orig'], FALSE, $row['contact_id']); } }