Skip to content

Commit

Permalink
Merge pull request #7106 from pods-framework/hotfix/7105-tribe-servic…
Browse files Browse the repository at this point in the history
…e-provider
  • Loading branch information
sc0ttkclark authored Jun 23, 2023
2 parents e55f042 + ed7e90e commit e43bb4a
Show file tree
Hide file tree
Showing 15 changed files with 150 additions and 29 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ Found a bug? Have a great feature idea? Get on GitHub and tell us about it and w

Our GitHub has the full list of all prior releases of Pods: https://github.com/pods-framework/pods/releases

= 2.9.18 - June 23rd, 2023 =

* Tweak: Abstract all container calls for Tribe Common library to Pods specific functions. (@sc0ttkclark)
* Fixed: Prevent fatal errors with our service provider classes that was caused by a new version of The Events Calendar / Event Tickets plugin from a change to the Tribe Common library that they made. #7105 #7106 (@JoryHogeveen, @sc0ttkclark)

= 2.9.17 - June 22nd, 2023 =

* Performance: Allow disabling showing fields in the Media Library modals for sites that experience heavy performance issues from large media grids in the admin area. This new option is available in Pods Admin > Settings > Performance. (@sc0ttkclark)
Expand Down
16 changes: 8 additions & 8 deletions classes/PodsInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function maybe_set_common_lib_info() {
static function( $value ) {
remove_filter(
'determine_current_user',
tribe_callback( 'promoter.connector', 'authenticate_user_with_connector' )
pods_container_callback( 'promoter.connector', 'authenticate_user_with_connector' )
);

return $value;
Expand Down Expand Up @@ -2676,19 +2676,19 @@ public function run() {

$ran = true;

tribe_register_provider( \Pods\Service_Provider::class );
tribe_register_provider( \Pods\Admin\Service_Provider::class );
tribe_register_provider( \Pods\Blocks\Service_Provider::class );
tribe_register_provider( \Pods\Integrations\Service_Provider::class );
tribe_register_provider( \Pods\REST\V1\Service_Provider::class );
tribe_register_provider( \Pods\Integrations\WPGraphQL\Service_Provider::class );
pods_container_register_service_provider( \Pods\Service_Provider::class );
pods_container_register_service_provider( \Pods\Admin\Service_Provider::class );
pods_container_register_service_provider( \Pods\Blocks\Service_Provider::class );
pods_container_register_service_provider( \Pods\Integrations\Service_Provider::class );
pods_container_register_service_provider( \Pods\REST\V1\Service_Provider::class );
pods_container_register_service_provider( \Pods\Integrations\WPGraphQL\Service_Provider::class );

// Add WP-CLI commands.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once PODS_DIR . 'classes/cli/Pods_CLI_Command.php';
require_once PODS_DIR . 'classes/cli/PodsAPI_CLI_Command.php';

tribe_register_provider( \Pods\CLI\Service_Provider::class );
pods_container_register_service_provider( \Pods\CLI\Service_Provider::class );
}

$this->load_i18n();
Expand Down
39 changes: 39 additions & 0 deletions includes/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -4416,3 +4416,42 @@ function pods_container( $slug_or_class = null ) {

return call_user_func_array( 'tribe', func_get_args() );
}

/**
* Set up the container callback and return it.
*
* @since 2.9.18
*
* @param string $slug_or_class A class or interface fully qualified name or a string slug.
* @param string $method The method that should be called on the resolved implementation with the
* specified array arguments.
* @param mixed [$argsN] (optional) Any number of arguments that will be passed down to the Callback.
*
* @return callable|null A PHP Callable based on the Slug and Methods passed or null if the function does not exist yet.
*/
function pods_container_callback( $slug_or_class, $method ) {
if ( ! function_exists( 'tribe_callback' ) ) {
_doing_it_wrong( __FUNCTION__, 'The function tribe_callback() is not defined yet, there may be a problem loading the Tribe Common library.', '2.8.17' );

return null;
}

return call_user_func_array( 'tribe_callback', func_get_args() );
}

/**
* Register the service provider.
*
* @since 2.9.18
*
* @param string $provider_class The full class name for the service provider.
*/
function pods_container_register_service_provider( $provider_class ) {
if ( ! function_exists( 'tribe_register_provider' ) ) {
_doing_it_wrong( __FUNCTION__, 'The function tribe_register_provider() is not defined yet, there may be a problem loading the Tribe Common library.', '2.8.17' );

return;
}

call_user_func_array( 'tribe_register_provider', func_get_args() );
}
4 changes: 2 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Pods - Custom Content Types and Fields
* Plugin URI: https://pods.io/
* Description: Pods is a framework for creating, managing, and deploying customized content types and fields
* Version: 2.9.17
* Version: 2.9.18
* Author: Pods Framework Team
* Author URI: https://pods.io/about/
* Text Domain: pods
Expand Down Expand Up @@ -43,7 +43,7 @@
add_action( 'init', 'pods_deactivate_pods_ui' );
} else {
// Current version.
define( 'PODS_VERSION', '2.9.17' );
define( 'PODS_VERSION', '2.9.18' );

// Current database version, this is the last version the database changed.
define( 'PODS_DB_VERSION', '2.3.5' );
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pods",
"version": "2.9.17",
"version": "2.9.18",
"description": "Pods is a development framework for creating, extending, managing, and deploying customized content types in WordPress.",
"author": "Pods Foundation, Inc",
"homepage": "https://pods.io/",
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: pods, custom post types, custom taxonomies, content types, custom fields,
Requires at least: 5.7
Tested up to: 6.2
Requires PHP: 5.6
Stable tag: 2.9.17
Stable tag: 2.9.18
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -175,6 +175,11 @@ Pods really wouldn't be where it is without all the contributions from our [dono

== Changelog ==

= 2.9.18 - June 23rd, 2023 =

* Tweak: Abstract all container calls for Tribe Common library to Pods specific functions. (@sc0ttkclark)
* Fixed: Prevent fatal errors with our service provider classes that was caused by a new version of The Events Calendar / Event Tickets plugin from a change to the Tribe Common library that they made. #7105 #7106 (@JoryHogeveen, @sc0ttkclark)

= 2.9.17 - June 22nd, 2023 =

* Performance: Allow disabling showing fields in the Media Library modals for sites that experience heavy performance issues from large media grids in the admin area. This new option is available in Pods Admin > Settings > Performance. (@sc0ttkclark)
Expand Down
3 changes: 1 addition & 2 deletions src/Pods/Admin/Service_Provider.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/Pods/Blocks/Service_Provider.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/Pods/CLI/Service_Provider.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/Pods/Integrations/Service_Provider.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/Pods/Integrations/WPGraphQL/Service_Provider.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/Pods/REST/V1/Service_Provider.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/Pods/Service_Provider.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions src/Pods/Service_Provider_Base.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions src/Pods/Service_Provider_Fallback.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e43bb4a

Please sign in to comment.