Closed the-csaba closed 12 months ago
2024 now... errors also show on product list mage, making it almost unusable. busy deloping new site (to replace current site) so php errors are enabled, and this makes it a nightmare. How's it closed? Am I missing somthing? Plugin is up to date.
Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetExists($key) 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/pnp/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 65
Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/pnp/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 47
Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/pnp/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 56
Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/pnp/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 72
@gsim what version of the main Woo Subscriptions extension do you have running on your store? The issue you're seeing was fixed in version 5.6.0.
Fixes #436
Description
This update adds the
ReturnTypeWillChange
attribute to methods in theWCS_Array_Property_Post_Meta_Black_Magic
class. This change will makeArrayAccess
implementations compatible with PHP 8.1 and above. By using the attribute instead of changing the method signatures, we can maintain compatibility with older PHP versions (i.e., PHP 7.x).As developers of the WooCommerce Zapier plugin, which adds Zapier integration to Subscriptions, we have a vested interest in ensuring that our code and tests are compatible with newer PHP versions.
By design, adding this attribute will appear like a comment in older PHP versions, so we do not anticipate any code-breaking changes.
Without this change, in PHP 8.1, if you try to create Variable Subscriptions, a deprecation notice occurs:
How to Test This PR
WP_DEBUG
andWP_DEBUG_DISPLAY
Product Impact