From c93ddffa0536aa435a8b791df72193900718f778 Mon Sep 17 00:00:00 2001 From: Marc Michalsky forumZFD Date: Thu, 12 Nov 2020 15:17:30 +0100 Subject: [PATCH] bug fix: get all events of all projects --- CRM/TwingleCampaign/BAO/TwingleApiCall.php | 2 +- api/v3/TwingleSync/Post.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/TwingleCampaign/BAO/TwingleApiCall.php b/CRM/TwingleCampaign/BAO/TwingleApiCall.php index 60ce8a5..52d2627 100644 --- a/CRM/TwingleCampaign/BAO/TwingleApiCall.php +++ b/CRM/TwingleCampaign/BAO/TwingleApiCall.php @@ -173,7 +173,7 @@ class TwingleApiCall { 'public' => 0, ]; $response = $this->curlGet($url, $params); - $finished = is_null($eventId) || count($response['data']) < $this->limit; + $finished = ($eventId) || count($response['data']) < $this->limit; $offset = $offset + $this->limit; if ($response['data']) { $result = array_merge($result, $response['data']); diff --git a/api/v3/TwingleSync/Post.php b/api/v3/TwingleSync/Post.php index 977d07a..b2c6eb4 100644 --- a/api/v3/TwingleSync/Post.php +++ b/api/v3/TwingleSync/Post.php @@ -67,7 +67,7 @@ function civicrm_api3_twingle_sync_Post(array $params) { ? trim(Civi::settings()->get('twingle_api_key')) : trim($params['twingle_api_key']); // If function call does not provide a limit, set a default value - $limit = empty($params['limit']) ?? 20; + $limit = ($params['limit']) ?? NULL; $twingleApi = new TwingleApiCall($apiKey, $limit); // Get all projects from Twingle