bug fix: get all events of all projects

This commit is contained in:
Marc Michalsky forumZFD 2020-11-12 15:17:30 +01:00
parent 080157754b
commit c93ddffa05
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 2 additions and 2 deletions

View file

@ -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']);

View file

@ -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