Merge pull request #9781 from agh1/release-notes-4.7.16
[civicrm-core.git] / api / v3 / Job.php
index 5ae0363f8d5b836a496512fb429e97724b102a9c..381ce176653deb8b6fe26be63f15ed4ae80104ca 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -477,12 +477,13 @@ function civicrm_api3_job_process_respondent($params) {
  * @throws \CiviCRM_API3_Exception
  */
 function civicrm_api3_job_process_batch_merge($params) {
-  $rule_group_id = CRM_Utils_Array::value('rgid', $params);
+  $rule_group_id = CRM_Utils_Array::value('rule_group_id', $params);
   if (!$rule_group_id) {
     $rule_group_id = civicrm_api3('RuleGroup', 'getvalue', array(
       'contact_type' => 'Individual',
       'used' => 'Unsupervised',
       'return' => 'id',
+      'options' => array('limit' => 1),
     ));
   }
   $gid = CRM_Utils_Array::value('gid', $params);
@@ -501,9 +502,10 @@ function civicrm_api3_job_process_batch_merge($params) {
  * @param $params
  */
 function _civicrm_api3_job_process_batch_merge_spec(&$params) {
-  $params['rgid'] = array(
+  $params['rule_group_id'] = array(
     'title' => 'Dedupe rule group id, defaults to Contact Unsupervised rule',
     'type' => CRM_Utils_Type::T_INT,
+    'api.aliases' => array('rgid'),
   );
   $params['gid'] = array(
     'title' => 'group id',
@@ -632,7 +634,7 @@ function civicrm_api3_job_disable_expired_relationships($params) {
 function civicrm_api3_job_group_rebuild($params) {
   $lock = Civi::lockManager()->acquire('worker.core.GroupRebuild');
   if (!$lock->isAcquired()) {
-    throw new API_Exception('Could not acquire lock, another EmailProcessor process is running');
+    throw new API_Exception('Could not acquire lock, another GroupRebuild process is running');
   }
 
   $limit = CRM_Utils_Array::value('limit', $params, 0);