Details
-
Type: Bug
-
Status: Open
-
Priority: Trivial
-
Resolution: Unresolved
-
Affects Version/s: 4.7.28
-
Fix Version/s: 4.7.30
-
Component/s: Core CiviCRM
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Needs Funding
-
Verified?:No
Description
If I try to update the greeting template on an existing contact I get an e-notice when trying to call
$contact = $this->callAPISuccess('Contact', 'create', array(
{{ 'id' => $contact['id'], }}
'postal_greeting_id' => 2,
));
The issue occurs when calling
{{CRM_Core_PseudoConstant::greeting($filter); }}
with a filter for contact_type.
Contact type is unknown at this point. Further passing it in makes the code LESS efficient rather than MORE efficient. The code loads possible values to a static index. If it returns too many options no harm is done because the calling code is only looking for the one option for which it has an ID. If, however, it does filter it then it means it stores one static var for household, one for individual & one for organisation, resulting in marginally more queries running. (I think the performance is marginal in both scenarios but just trying to explore what reason, if any, there is for the filter.)