pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

Dynamic properties deprecated in PHP 8.2 #7134

Closed pd-cm closed 1 year ago

pd-cm commented 1 year ago

Description

Deprecated: Creation of dynamic property Pods\REST\V1\Messages::$messages is deprecated in /wordpress/wp-content/plugins/pods/src/Pods/REST/V1/Messages.php on line 25
Creation of dynamic property PodsUI::$temp_row is deprecated in /usr/local/lsws/domain.com/html/wp-content/plugins/pods/classes/PodsUI.php on line 4865

PHP v8.2, WP v6.3, Pods v2.9.19

See https://stackoverflow.com/q/74991682 See https://wordpress.org/support/topic/deprecated-code-alert/ See https://podswp.slack.com/archives/C02SVLHQF/p1692868980832349

Version

2.9.19

Testing Instructions

  1. Upgrade to PHP 8.2.
  2. Run a rest request.
  3. Plan for the future.

Screenshots / Screencast

No response

Possible Workaround

The vars probably need to be explicitly declared.

Site Health Information

No response

Pods Package

No response

spinozarabel commented 1 year ago

PHP ver 8.1.2 WP 6.3 Pods 2.9.19 I too get a PHP deprecated notice as follows:

PHP Deprecated: Return type of Pods\API\Whatsit\Value_Field::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/avasarala.in/wp-content/plugins/pods/src/Pods/API/Whatsit/Value_Field.php on line 70

JoryHogeveen commented 1 year ago

Hi @spinozarabel

These errors are patched in Pods 3.0 through several patches. Most recent: https://github.com/pods-framework/pods/pull/7146

Cheers, Jory