Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CRM/Eventbrite/EvenbriteApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions CRM/Eventbrite/WebhookProcessor/Attendee.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down