Skip to content

Commit

Permalink
Fixed array null with $event
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-adigital committed May 9, 2023
1 parent d1ddd4d commit 38eb79a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .craftplugin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"pluginName":"Eventbrite","pluginDescription":"Integration with Eventbrite API","pluginVersion":"1.0.0","pluginAuthorName":"Mark @ A Digital","pluginVendorName":"a-digital","pluginAuthorUrl":"https://adigital.agency/","pluginAuthorGithub":"eventbrite","codeComments":"yes","pluginComponents":["controllers","cpsection","services","settings","variables","widgets"],"consolecommandName":"","controllerName":"","cpsectionName":"","elementName":"","fieldName":"","modelName":"","purchasableName":"","recordName":"","serviceName":"","taskName":"","utilityName":"","widgetName":"","apiVersion":"api_version_3_0"}
{"pluginName":"Eventbrite","pluginDescription":"Integration with Eventbrite API","pluginVersion":"1.0.8","pluginAuthorName":"Mark @ A Digital","pluginVendorName":"a-digital","pluginAuthorUrl":"https://adigital.agency/","pluginAuthorGithub":"eventbrite","codeComments":"yes","pluginComponents":["controllers","cpsection","services","settings","variables","widgets"],"consolecommandName":"","controllerName":"","cpsectionName":"","elementName":"","fieldName":"","modelName":"","purchasableName":"","recordName":"","serviceName":"","taskName":"","utilityName":"","widgetName":"","apiVersion":"api_version_3_0"}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.8 - 2023-05-09
### Changed
- Fixed array null with $event

## 1.0.7 - 2022-09-20
### Changed
- Errors are now suppressed in production environments
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "adigital/eventbrite",
"description": "Integration with Eventbrite API",
"type": "craft-plugin",
"version": "1.0.7",
"version": "1.0.8",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/services/EventbriteEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function getEvent($eventId, $expansions = null, $fullDescription = true,
$event = $this->curlWrap($method);

$otherEventIds = array_column(json_decode(Eventbrite::$plugin->nonAdminSettings->get()->one()->otherEventIds), 0);
if (($unlistedEvent === false && $event['listed'] === false) || ($event['organization_id'] != Eventbrite::$plugin->getSettings()->organisationId && !array_search($eventId, $otherEventIds)))
if (is_array($event) && ($unlistedEvent === false && $event['listed'] === false) || ($event['organization_id'] != Eventbrite::$plugin->getSettings()->organisationId && !array_search($eventId, $otherEventIds)))
{
$event = null;
}
Expand Down

0 comments on commit 38eb79a

Please sign in to comment.