diff --git a/CRM/TwingleCampaign/BAO/TwingleEvent.php b/CRM/TwingleCampaign/BAO/TwingleEvent.php index e779fac..f3e2b8d 100644 --- a/CRM/TwingleCampaign/BAO/TwingleEvent.php +++ b/CRM/TwingleCampaign/BAO/TwingleEvent.php @@ -241,6 +241,7 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign { $parentCampaign = civicrm_api3('Campaign', 'get', [ 'sequential' => 1, $cf_project_id => $this->values['project_id'], + 'options' => ['limit' => 0] ]); if ($parentCampaign['is_error'] == 0) { return (int) $parentCampaign['id']; diff --git a/CRM/TwingleCampaign/Form/Settings.php b/CRM/TwingleCampaign/Form/Settings.php index f76e869..d28b7cc 100644 --- a/CRM/TwingleCampaign/Form/Settings.php +++ b/CRM/TwingleCampaign/Form/Settings.php @@ -102,6 +102,7 @@ class CRM_TwingleCampaign_Form_Settings extends CRM_Core_Form { try { $result = civicrm_api3('CaseType', 'get', [ 'sequential' => 1, + 'options' => ['limit' => 0] ]); if (is_array($result['values'])) { foreach ($result['values'] as $case) { diff --git a/CRM/TwingleCampaign/Utils/ExtensionCache.php b/CRM/TwingleCampaign/Utils/ExtensionCache.php index 20bbb05..365b50a 100644 --- a/CRM/TwingleCampaign/Utils/ExtensionCache.php +++ b/CRM/TwingleCampaign/Utils/ExtensionCache.php @@ -78,7 +78,11 @@ class CRM_TwingleCampaign_Utils_ExtensionCache { $campaign_type_id = civicrm_api3( 'OptionValue', 'get', - ['sequential' => 1, 'name' => $campaign_type['name']] + [ + 'sequential' => 1, + 'name' => $campaign_type['name'], + 'options' => ['limit' => 0], + ] )['values']; if ($campaign_type_id) { $this->campaigns['campaign_types'][$campaign_type['name']]['id'] = diff --git a/api/v3/TwingleCampaign/Get.php b/api/v3/TwingleCampaign/Get.php index 4a280a8..dce6b3a 100644 --- a/api/v3/TwingleCampaign/Get.php +++ b/api/v3/TwingleCampaign/Get.php @@ -126,6 +126,9 @@ function civicrm_api3_twingle_campaign_Get(array $params): array { // Include campaign type ot TwingleCampaigns in $params $params['campaign_type_id'] = $twingle_campaign_campaign_type_id; + // Do not limit the number of results + $params['options'] = ['limit' => 0]; + // Get TwingleCampaign children campaigns of the TwingleProject $campaigns = civicrm_api3('Campaign', 'get', diff --git a/api/v3/TwingleEvent/Get.php b/api/v3/TwingleEvent/Get.php index 45b03d7..2398d66 100644 --- a/api/v3/TwingleEvent/Get.php +++ b/api/v3/TwingleEvent/Get.php @@ -108,7 +108,9 @@ function civicrm_api3_twingle_event_Get(array $params): array { $custom_field_mapping_reverse = array_flip($custom_field_mapping); $params['campaign_type_id'] = 'twingle_event'; - $query = []; + + // Do not limit the number of results + $query = ['options' => ['limit' => 0]]; foreach ($params as $key => $value) { if ( $key != 'id' && diff --git a/api/v3/TwingleForm/Get.php b/api/v3/TwingleForm/Get.php index 2c3a786..e759a69 100644 --- a/api/v3/TwingleForm/Get.php +++ b/api/v3/TwingleForm/Get.php @@ -73,11 +73,17 @@ function civicrm_api3_twingle_form_Get(array $params): array { unset($params['twingle_project_type']); } - $params['campaign_type_id'] = "twingle_project"; - $params['is_active'] = 1; + // Set query parameters + $query = [ + 'campaign_type_id' => "twingle_project", + 'is_active' => 1, + 'options' => ['limit' => 0] + ]; + + $query = array_merge($params, $query); try { - $result = civicrm_api3('Campaign', 'get', $params); + $result = civicrm_api3('Campaign', 'get', $query); if ($result['is_error'] == 0) { foreach($result['values'] as $value) { @@ -92,7 +98,7 @@ function civicrm_api3_twingle_form_Get(array $params): array { 'counter' => $value[$custom_field_mapping['twingle_project_counter']] ]; } - return civicrm_api3_create_success($returnValues, $params, 'TwingleForm', 'Get'); + return civicrm_api3_create_success($returnValues, $query, 'TwingleForm', 'Get'); } else { return civicrm_api3_create_error($result['message']); diff --git a/api/v3/TwingleProject/Get.php b/api/v3/TwingleProject/Get.php index 12d2d0b..5754ba3 100644 --- a/api/v3/TwingleProject/Get.php +++ b/api/v3/TwingleProject/Get.php @@ -123,7 +123,8 @@ function civicrm_api3_twingle_project_Get(array $params): array { $custom_field_mapping_reverse = array_flip($custom_field_mapping); $params['campaign_type_id'] = 'twingle_project'; - $query = []; + // Do not limit the number of results + $query = ['options' => ['limit' => 0]]; foreach ($params as $key => $value) { if ( $key != 'id' &&