Skip Navigation

[Fixed in next Release] Views: PHP 8.2 deprecations: #[\ReturnTypeWillChange] attribute messages

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 10 replies, has 4 voices.

Last updated by pascalS 1 year ago.

Assisted by: Mateus Getulio.

Author
Posts
#2691498

I'm in the process of testing an upgrade from PHP 7.4.33 to PHP 8.2.14. While enabling the test driver, I'm receiving a series of at least 3 deprecation notices from the Views plugin, seen via Query Monitor.

The messages:

Return type of OTGS\Toolset\Common\Utils\RecursiveDotFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice 
wp-content/plugins/wp-views/vendor/toolset/toolset-common/inc/autoloaded/utils/PhpIteratorFactory.php:45
Return type of OTGS\Toolset\Twig\Node\Node::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice 
wp-content/plugins/wp-views/vendor/toolset/toolset-common/lib/Twig/src/Node/Node.php:175
Return type of OTGS\Toolset\Twig\Node\Node::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice 
wp-content/plugins/wp-views/vendor/toolset/toolset-common/lib/Twig/src/Node/Node.php:179
#2691669

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for contacting our support.

As of now, we have not yet conducted a full-scale review for compatibility with PHP 8.2.

Toolset is confirmed to work seamlessly with PHP 8.0 and 8.1. For PHP 8.2, we've been actively addressing any concerns raised by our clients. So far, these have been mostly minor and often related to PHP deprecation notices appearing in the logs, as only a limited number of clients are using PHP 8.2 at the moment.

Those deprecation notes should be addressed in the upcoming versions of Toolset.

Best regards,
Mateus

#2692129

Thanks, Mateus.

At the moment 8.2 is my managed host's only upgrade path. It looks like the PHP project's 8.1 active support has already ended and 8.2's will end in Dec 2024. Thankfully these are just deprecation notices and not fatal errors. Let me know if there's any other information you need from me. I'm using the Bricks builder theme + child (1.9.7.1), as that might have some interactions with what I'm seeing in some Views-related stack traces, but some appear to be only Types/Views.

#2692265

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Jonathan

Thank you for providing us with that extra information.

Upon further inspection, I noticed that you have an update available for the Toolset Views.

Can you please update the Toolset plugins to see if the deprecation warnings you reported are fixed?

You can manually update it by downloading the latest version here: https://toolset.com/account/downloads/

Or you could update the plugins by following the procedure:

- Inside your wp-admin please go to Plugins -> Add New.
- Then click on the "Commercial" tab and click on the "Check for updates" button in the Toolset section
- After that please select every red plugin available in the list and then click on "Download" at the bottom of the grid.

Thank you, please let us know.

#2692304

Thanks Mateus,

Surprising that I missed the update! That's usually the first thing I check. In this case, though, it doesn't seem to have resolved the issue.

#2692484

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Jonathan,

Thank you for confirming it.

I checked it and I was able to locate the exact same deprecated warning in our escalated tickets, this has been addressed and the fix should be available in the next version of Types.

While I'm afraid I can't give you an exact ETA for the release of the next version, it is very likely to be released prior to the end of support of PHP 8.1.

We thank you for your patience and understanding with this.

Best regards,
Mateus

#2700106

Hi Mateus and co,

I updated last week to the latest version of Views (3.6.15), but I'm still getting deprecation notices in a variety of places. The changelog indicates that these errors were fixed. The messages are the same as my initial post.

#2700125

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

Sorry, it looks like Mateus mis-read the exact details of the notices you reported, we had similar-but-different existing reports which were just fixed.

I have created an internal ticket for the developers with these specific notices. It is usually fairly straightforward to fix, and so we should be able to include fixes in the upcoming releases.

#2703353

Hi Nigel and co.,

Is there a timeframe on when an update might be released? I've been running into some issues with the Bricks page builder not showing content correctly in the editor, seemingly tied to these notices.

#2703429

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Jonathan

Internally this is already fixed, we are just prepping a few things to bundle together into a release, which will probably happen the week after next on current estimates.

#2703500

Also getting affected by this