Skip to content
Open
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
6 changes: 3 additions & 3 deletions api/v3/Contacts/Correctnamecasesjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ function contacts_correctnamecasesjob_correct_name_case(&$aName) {
* @return array API result descriptor
* @see civicrm_api3_create_success
* @see civicrm_api3_create_error
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_contacts_correctnamecasesjob($params) {

$lastContactExaminedOffset = CRM_Core_BAO_Setting::getItem(CAPSCORRECT_EXTENSION_NAME, CAPSCORRECT_LAST_CONTACT_OFFSET);
// See if the returned value is NULL or negative
if ( $lastContactExaminedOffset === NULL || $lastContactExaminedOffset < 0 ) {
throw new API_Exception(/*errorMessage*/ 'Unable to complete scheduled job, the offset was not returned.', /*errorCode*/ 1);
throw new CRM_Core_Exception(/*errorMessage*/ 'Unable to complete scheduled job, the offset was not returned.', /*errorCode*/ 1);
}
// Get the number of contacts to correct this run
$numberOfContactsToRun = DEFAULT_DAILY_CONTACTS_CORRECTED;
Expand All @@ -82,7 +82,7 @@ function civicrm_api3_contacts_correctnamecasesjob($params) {
);
$getContactsApiResults = civicrm_api('Contact', 'get', $getContactsApiParams);
if ( civicrm_error($getContactsApiResults) ){
throw new API_Exception(/*errorMessage*/ 'Unable to complete scheduled job, error fetching contacts.', /*errorCode*/ 2);
throw new CRM_Core_Exception(/*errorMessage*/ 'Unable to complete scheduled job, error fetching contacts.', /*errorCode*/ 2);
}

$contactsCorrectedThisRun = 0;
Expand Down