From f1e78c32ca82a0fbc436d5fa3cdc1a93ef969856 Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Mon, 2 Oct 2023 10:59:46 -0500 Subject: [PATCH 1/4] Add fix for php deprecation notices on return type --- changelog.txt | 2 +- readme.txt | 2 +- src/Pods/API/Whatsit/Value_Field.php | 1 + src/Pods/Whatsit.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index c517600d07..84fcfb0175 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,7 +11,7 @@ Our GitHub has the full list of all prior releases of Pods: https://github.com/p * Fixed: Normalize numbers when doing conditional logic comparisons. (@sc0ttkclark) * Fixed: Add new options to trim content of fields by removing empty p tags, trimming whitespace at the end of lines, and removing extra lines. Default those to off (previously they were just always on). (@sc0ttkclark) * Fixed: Add `tribe()` backward compatibilty function for Pods add-ons that still call that function. This only gets included by Pods when Tribe Common is not detected on the site. (@sc0ttkclark) -* Fixed: Resolve file/relationship lookups for settings pages that are DB vs file-based configs. (@sc0ttkclark) +* Fixed: Resolve file/relationship lookups for settings pages that are DB vs file-based configs. (@sc0ttkclark) = 3.0.4 - September 25th, 2023 = diff --git a/readme.txt b/readme.txt index 76c425e65d..61f371df3b 100644 --- a/readme.txt +++ b/readme.txt @@ -186,7 +186,7 @@ Pods really wouldn't be where it is without all the contributions from our [dono * Fixed: Normalize numbers when doing conditional logic comparisons. (@sc0ttkclark) * Fixed: Add new options to trim content of fields by removing empty p tags, trimming whitespace at the end of lines, and removing extra lines. Default those to off (previously they were just always on). (@sc0ttkclark) * Fixed: Add `tribe()` backward compatibilty function for Pods add-ons that still call that function. This only gets included by Pods when Tribe Common is not detected on the site. (@sc0ttkclark) -* Fixed: Resolve file/relationship lookups for settings pages that are DB vs file-based configs. (@sc0ttkclark) +* Fixed: Resolve file/relationship lookups for settings pages that are DB vs file-based configs. (@sc0ttkclark) = 3.0.4 - September 25th, 2023 = diff --git a/src/Pods/API/Whatsit/Value_Field.php b/src/Pods/API/Whatsit/Value_Field.php index 31fb752248..16be45f2c9 100644 --- a/src/Pods/API/Whatsit/Value_Field.php +++ b/src/Pods/API/Whatsit/Value_Field.php @@ -67,6 +67,7 @@ public function __toString() { * * @return bool Whether the offset exists. */ + #[\ReturnTypeWillChange] public function offsetExists( $offset ) { return $this->__isset( $offset ); } diff --git a/src/Pods/Whatsit.php b/src/Pods/Whatsit.php index 1fe7f3481c..ce47e6d785 100644 --- a/src/Pods/Whatsit.php +++ b/src/Pods/Whatsit.php @@ -372,6 +372,7 @@ public function __toString() { * * @return bool Whether the offset exists. */ + #[\ReturnTypeWillChange] public function offsetExists( $offset ): bool { return $this->__isset( $offset ); } From cbad52350a2c2f8a23f3bf110981bd5a2885f27f Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Mon, 2 Oct 2023 13:20:10 -0500 Subject: [PATCH 2/4] Update more return types --- changelog.txt | 5 +++++ src/Pods/API/Whatsit/Value_Field.php | 5 +++++ src/Pods/Whatsit.php | 3 +++ 3 files changed, 13 insertions(+) diff --git a/changelog.txt b/changelog.txt index 84fcfb0175..f0d39fb8b8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 += 3.0.6 - October 2nd, 2023 = + +* Fixed: +* Fixed: PHP deprecated notices resolved for return types in PHP 8+ + = 3.0.5 - October 2nd, 2023 = * Tweak: Added the "full" image size to the reference list in the Pods Template editor. #7183 #7184 (@JoryHogeveen) diff --git a/src/Pods/API/Whatsit/Value_Field.php b/src/Pods/API/Whatsit/Value_Field.php index 16be45f2c9..8b77a04f37 100644 --- a/src/Pods/API/Whatsit/Value_Field.php +++ b/src/Pods/API/Whatsit/Value_Field.php @@ -56,6 +56,7 @@ public static function init( Whatsit $field ) { * * @uses Whatsit::__toString() */ + #[\ReturnTypeWillChange] public function __toString() { return $this->_field->get_identifier(); } @@ -79,6 +80,7 @@ public function offsetExists( $offset ) { * * @return mixed|null Offset value, or null if not set. */ + #[\ReturnTypeWillChange] public function &offsetGet( $offset ) { // We fake the pass by reference to avoid PHP errors for backcompat. $value = $this->__get( $offset ); @@ -119,6 +121,7 @@ public function offsetUnset( $offset ) { * * @uses Whatsit::__isset() */ + #[\ReturnTypeWillChange] public function __isset( $offset ) { if ( 'value' === $offset ) { return isset( $this->_value ); @@ -136,6 +139,7 @@ public function __isset( $offset ) { * * @uses Whatsit::__get() */ + #[\ReturnTypeWillChange] public function __get( $offset ) { if ( 'value' === $offset ) { return $this->_value; @@ -187,6 +191,7 @@ public function __unset( $offset ) { * * @return mixed The method response. */ + #[\ReturnTypeWillChange] public function __call( $method, $arguments ) { return call_user_func_array( [ $this->_field, $method ], $arguments ); } diff --git a/src/Pods/Whatsit.php b/src/Pods/Whatsit.php index ce47e6d785..d890690ec3 100644 --- a/src/Pods/Whatsit.php +++ b/src/Pods/Whatsit.php @@ -361,6 +361,7 @@ public function valid(): bool { * * @return string Object identifier. */ + #[\ReturnTypeWillChange] public function __toString() { return $this->get_identifier(); } @@ -423,6 +424,7 @@ public function offsetUnset( $offset ): void { * * @return bool Whether the offset exists. */ + #[\ReturnTypeWillChange] public function __isset( $offset ) { if ( is_int( $offset ) ) { $args = $this->getArrayCopy(); @@ -454,6 +456,7 @@ public function __isset( $offset ) { * * @return mixed|null Offset value, or null if not set. */ + #[\ReturnTypeWillChange] public function __get( $offset ) { if ( is_int( $offset ) ) { $args = $this->getArrayCopy(); From b825eee471fbf54365ce81b3784f97d339912f53 Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Mon, 2 Oct 2023 13:20:37 -0500 Subject: [PATCH 3/4] Move tribe() compatibility into a file that loads during plugins_loaded and add additional checks to prevent loading during plugin activation --- classes/PodsInit.php | 2 ++ includes/compatibility.php | 35 +++++++++++++++++++++++++++++++++++ includes/general.php | 23 ----------------------- 3 files changed, 37 insertions(+), 23 deletions(-) create mode 100644 includes/compatibility.php diff --git a/classes/PodsInit.php b/classes/PodsInit.php index d2fd10aa73..cb1356707a 100644 --- a/classes/PodsInit.php +++ b/classes/PodsInit.php @@ -2438,6 +2438,8 @@ public function run() { // Compatibility for Query Monitor conditionals add_filter( 'query_monitor_conditionals', array( $this, 'filter_query_monitor_conditionals' ) ); + + require_once PODS_DIR . 'includes/compatibility.php'; } /** diff --git a/includes/compatibility.php b/includes/compatibility.php new file mode 100644 index 0000000000..cf55959251 --- /dev/null +++ b/includes/compatibility.php @@ -0,0 +1,35 @@ +register( $provider_class ); } - -// Add backwards compatibility for tribe() for old add-ons that may still call it. -if ( - ! function_exists( 'tribe_is_not_min_php_version' ) - && ! function_exists( 'tribe' ) -) { - /** - * Compatibility function for Pods 2.x add-ons that may still call tribe(). - * - * @since 3.0.5 - * - * @param string|null $slug_or_class Either the slug of a binding previously registered using singleton or - * register or the full class name that should be automagically created or - * `null` to get the container instance itself. - * - * @return mixed|null The pods_container() object or null if the function does not exist yet. - */ - function tribe( $slug_or_class = null ) { - _doing_it_wrong( 'tribe', 'tribe() is no longer included in Pods Framework directly. Please use pods_container() instead.', '3.0' ); - - return pods_container( $slug_or_class ); - } -} From 9dce9c59bc62fa675428163fb4221d2b1060aa99 Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Mon, 2 Oct 2023 13:21:25 -0500 Subject: [PATCH 4/4] Pods 3.0.6 --- changelog.txt | 4 ++-- init.php | 4 ++-- package.json | 2 +- readme.txt | 7 ++++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/changelog.txt b/changelog.txt index f0d39fb8b8..3a2a4c364c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,8 +4,8 @@ Our GitHub has the full list of all prior releases of Pods: https://github.com/p = 3.0.6 - October 2nd, 2023 = -* Fixed: -* Fixed: PHP deprecated notices resolved for return types in PHP 8+ +* Fixed: Resolved a plugin conflict with The Events Calendar / Event Tickets plugins that was introduced in 3.0.5. (@sc0ttkclark) +* Fixed: PHP deprecated notices resolved for return types in PHP 8+ (@sc0ttkclark) = 3.0.5 - October 2nd, 2023 = diff --git a/init.php b/init.php index 98b4f2e390..742e9499b3 100644 --- a/init.php +++ b/init.php @@ -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: 3.0.5 + * Version: 3.0.6 * Author: Pods Framework Team * Author URI: https://pods.io/about/ * Text Domain: pods @@ -43,7 +43,7 @@ add_action( 'init', 'pods_deactivate_pods_ui' ); } else { // Current version. - define( 'PODS_VERSION', '3.0.5' ); + define( 'PODS_VERSION', '3.0.6' ); // Current database version, this is the last version the database changed. define( 'PODS_DB_VERSION', '2.3.5' ); diff --git a/package.json b/package.json index 28f35d75c7..45327c0c53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pods", - "version": "3.0.5", + "version": "3.0.6", "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/", diff --git a/readme.txt b/readme.txt index 61f371df3b..6ebbf16180 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: pods, custom post types, custom taxonomies, content types, custom fields, Requires at least: 6.0 Tested up to: 6.3 Requires PHP: 7.2 -Stable tag: 3.0.5 +Stable tag: 3.0.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -177,6 +177,11 @@ Pods really wouldn't be where it is without all the contributions from our [dono == Changelog == += 3.0.6 - October 2nd, 2023 = + +* Fixed: Resolved a plugin conflict with The Events Calendar / Event Tickets plugins that was introduced in 3.0.5. (@sc0ttkclark) +* Fixed: PHP deprecated notices resolved for return types in PHP 8+ (@sc0ttkclark) + = 3.0.5 - October 2nd, 2023 = * Tweak: Added the "full" image size to the reference list in the Pods Template editor. #7183 #7184 (@JoryHogeveen)