diff --git a/CRM/Eventbrite/EvenbriteApi.php b/CRM/Eventbrite/EvenbriteApi.php index 03ed241..885f5c5 100644 --- a/CRM/Eventbrite/EvenbriteApi.php +++ b/CRM/Eventbrite/EvenbriteApi.php @@ -72,8 +72,18 @@ public function request($path, $body = array(), $expand = array(), $method = 'GE $url .= '&expand=' . implode(',', $expand); } - $context = stream_context_create($options); - $result = @file_get_contents($url, FALSE, $context); + // Display 100 events ordered by start date asc. on Add Event page. + if ( preg_match( '/\/organizations\/[0-9]+\/events\//', $path ) ) { + $url .= '&order_by=start_desc&page_size=100'; + } + + $context = stream_context_create($options); + if ( 'GET' == $method ) { + $result = @file_get_contents($url); + } else { + $result = @file_get_contents($url, FALSE, $context); + } + // Log error if $result is null, probably network is unreachable. if ($result == NULL) { $bt = debug_backtrace(); diff --git a/CRM/Eventbrite/WebhookProcessor/Attendee.php b/CRM/Eventbrite/WebhookProcessor/Attendee.php index 1f88261..e62bfdb 100644 --- a/CRM/Eventbrite/WebhookProcessor/Attendee.php +++ b/CRM/Eventbrite/WebhookProcessor/Attendee.php @@ -398,8 +398,7 @@ private function updateCustomFields() { $extends = $field['api.CustomGroup.getsingle']['extends']; if ($extends == 'Individual' || $extends == 'Contact') { $contactValues['custom_' . $fieldId] = $answerValue; - } - elseif ($extends == 'Individual' || $extends == 'Contact') { + } elseif ($extends == 'Participant') { $participantValues['custom_' . $fieldId] = $answerValue; } }