Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21551 Add parameter to support skipping processing greetings when… #11405

Merged
merged 1 commit into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,12 @@ public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE
}
}

self::processGreetings($contact);
// In order to prevent a series of expensive queries in intensive batch processing
// api calls may pass in skip_greeting_processing, probably doing it later via the
// scheduled job. CRM-21551
if (empty($params['skip_greeting_processing'])) {
self::processGreetings($contact);
}

return $contact;
}
Expand Down
6 changes: 6 additions & 0 deletions api/v3/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ function _civicrm_api3_contact_create_spec(&$params) {
'description' => 'Throw error if contact create matches dedupe rule',
'type' => CRM_Utils_Type::T_BOOLEAN,
);
$params['skip_greeting_processing'] = array(
'title' => 'Skip Greeting processing',
'description' => 'Do not process greetings, (these can be done by scheduled job and there may be a preference to do so for performance reasons)',
'type' => CRM_Utils_Type::T_BOOLEAN,
'api.default' => 0,
);
$params['prefix_id']['api.aliases'] = array('individual_prefix', 'individual_prefix_id');
$params['suffix_id']['api.aliases'] = array('individual_suffix', 'individual_suffix_id');
$params['gender_id']['api.aliases'] = array('gender');
Expand Down