Skip to content

Commit

Permalink
Fatal Error with older versions of EVA
Browse files Browse the repository at this point in the history
  • Loading branch information
pattihis committed Jun 12, 2024
1 parent b59a60f commit 4b72a50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 66 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Fix - The Decorated repository was not returning values from `save()` and other methods. Now they return as expected. [BTRIA-2310]
* Fix - Resolved an issue where transient notices would disappear given a certain order of operations. [ECP-1804]
* Tweak - Added a new action hook `tec_event_automator_zapier_provider_registered` to fire after the Zapier service has successfully registered. [EVA-159]

= [5.2.7] 2024-05-14 =

Expand Down
4 changes: 2 additions & 2 deletions src/Common/Event_Automator/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @package TEC\Event_Automator
*/
class Plugin {
class Plugin extends \tad_DI52_ServiceProvider {
/**
* Stores the version for the plugin.
*
Expand Down Expand Up @@ -109,7 +109,7 @@ public function set_container( $container = null ): void {
*
* @param ?\Tribe__Container $container The container to use, if any. If not provided, the global container will be used.
*/
public static function boot( $container = null ): void {
public function boot( $container = null ): void {
$plugin = new static();
$plugin->register_autoloader();
$plugin->set_container( $container );
Expand Down
71 changes: 7 additions & 64 deletions src/Common/Event_Automator/Zapier/Zapier_Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ public function register() {
$ajax_capability = apply_filters( 'tec_event_automator_zapier_admin_ajax_capability', 'manage_options' );

$this->route_admin_by_nonce( $this->admin_routes(), $ajax_capability );

/**
* Fires after the Zapier provider has been registered.
*
* @since TBD
*/
do_action( 'tec_event_automator_zapier_provider_registered' );
}

/**
Expand Down Expand Up @@ -181,8 +188,6 @@ protected function setup_add_to_queues() {
* @since TBD Migrated to Common from Event Automator
*/
protected function add_filters() {
add_filter( 'tribe_addons_tab_fields', [ $this, 'filter_tec_integrations_tab_fields' ] );
add_filter( 'tec_tickets_plus_integrations_tab_fields', [ $this, 'filter_et_integrations_tab_fields' ], 30 );
add_filter( 'tec_event_automator_zapier_settings_fields', [ $this, 'add_dashboard_fields' ] );
add_filter( 'tec_event_automator_zapier_endpoint_details', [ $this, 'filter_create_event_details' ], 10, 2 );
add_filter( 'tec_event_automator_zapier_enable_add_to_queues', [ $this, 'filter_enable_add_to_queues' ], 10 );
Expand Down Expand Up @@ -212,20 +217,6 @@ public function register_admin_assets() {
public function register_endpoints() {
$this->container->make( Swagger_Documentation::class )->register();
$this->container->make( Authorize::class )->register();
$this->container->make( Canceled_Events::class )->register();
$this->container->make( New_Events::class )->register();
$this->container->make( Updated_Events::class )->register();
$this->container->make( Attendees::class )->register();
$this->container->make( Updated_Attendees::class )->register();
$this->container->make( Orders::class )->register();
$this->container->make( Refunded_Orders::class )->register();
$this->container->make( Checkin::class )->register();

$this->container->make( Create_Events::class )->register();
$this->container->make( Update_Events::class )->register();
$this->container->make( Find_Events::class )->register();
$this->container->make( Find_Attendees::class )->register();
$this->container->make( Find_Tickets::class )->register();
}

/**
Expand All @@ -235,54 +226,6 @@ public function register_endpoints() {
*/
public function add_endpoints_to_dashboard() {
$this->container->make( Authorize::class )->add_to_dashboard();
$this->container->make( New_Events::class )->add_to_dashboard();
$this->container->make( Canceled_Events::class )->add_to_dashboard();
$this->container->make( Updated_Events::class )->add_to_dashboard();
$this->container->make( Attendees::class )->add_to_dashboard();
$this->container->make( Updated_Attendees::class )->add_to_dashboard();
$this->container->make( Checkin::class )->add_to_dashboard();
$this->container->make( Orders::class )->add_to_dashboard();
$this->container->make( Refunded_Orders::class )->add_to_dashboard();

$this->container->make( Create_Events::class )->add_to_dashboard();
$this->container->make( Update_Events::class )->add_to_dashboard();
$this->container->make( Find_Events::class )->add_to_dashboard();
$this->container->make( Find_Attendees::class )->add_to_dashboard();
$this->container->make( Find_Tickets::class )->add_to_dashboard();
}

/**
* Filters the fields in the Events > Settings > Integrations tab to Zapier settings.
*
* @since TBD Migrated to Common from Event Automator
*
* @param array<string,array> $fields The current fields.
*
* @return array<string,array> The fields, as updated by the settings.
*/
public function filter_tec_integrations_tab_fields( $fields ) {
if ( ! is_array( $fields ) ) {
return $fields;
}

return tribe( Settings::class )->add_fields_tec( $fields );
}

/**
* Filters the fields in the Tickets > Settings > Integrations tab to Zapier settings.
*
* @since TBD Migrated to Common from Event Automator
*
* @param array<string,array> $fields The current fields.
*
* @return array<string,array> The fields, as updated by the settings.
*/
public function filter_et_integrations_tab_fields( $fields ) {
if ( ! is_array( $fields ) ) {
return $fields;
}

return tribe( Settings::class )->add_fields_et( $fields );
}

/**
Expand Down

0 comments on commit 4b72a50

Please sign in to comment.